Search completed in 1.00 seconds.
2225 results for "alt":
Your results are loading. Please wait...
HTMLImageElement.alt - Web APIs
the htmlimageelement property alt provides fallback (alternate) text to display when the image specified by the <img> element is not loaded.
... perhaps the most important reason to use the alt tag is to support accessibility, as the alt text may be used by screen readers and other assistive technologies to help differently-abled users make full use of your content.
... think of it like this: when choosing alt strings for your images, imagine what you would say when reading the page to someone over the phone without mentioning that there's an image on the page.
...And 25 more matches
Alternative style sheets - CSS: Cascading Style Sheets
specifying alternative style sheets in a web page provides a way for users to see multiple versions of a page, based on their needs or preferences.
... an example: specifying the alternative stylesheets the alternate stylesheets are commonly specified using a <link> element with rel="alternate stylesheet" and title="..." attributes.
... for example: <link href="reset.css" rel="stylesheet" type="text/css"> <link href="default.css" rel="stylesheet" type="text/css" title="default style"> <link href="fancy.css" rel="alternate stylesheet" type="text/css" title="fancy"> <link href="basic.css" rel="alternate stylesheet" type="text/css" title="basic"> in this example, the styles "default style", "fancy", and "basic" will be listed in the page style submenu, with "default style" pre-selected.
...And 9 more matches
USBAlternateInterface - Web APIs
the usbalternateinterface interface of the webusb api provides information about a particular configuration of an interface provided by the usb device.
... an interface includes one or more alternate settings which can configure a set of endpoints based on the operating mode of the device.
... constructor usbalternateinterface.usbalternateinterface creates a new usbalternateinterface object which will be populated with information about the alternate interface of the provided usbinterface with the given alternate setting number.
...And 8 more matches
font-variant-alternates - CSS: Cascading Style Sheets
the font-variant-alternates css property controls the usage of alternate glyphs.
... these alternate glyphs may be referenced by alternative names defined in @font-feature-values.
... /* keyword values */ font-variant-alternates: normal; font-variant-alternates: historical-forms; /* functional notation values */ font-variant-alternates: stylistic(user-defined-ident); font-variant-alternates: styleset(user-defined-ident); font-variant-alternates: character-variant(user-defined-ident); font-variant-alternates: swash(user-defined-ident); font-variant-alternates: ornaments(user-defined-ident); font-variant-alternates: annotation(user-defined-ident); font-variant-alternates: swash(ident1) annotation(ident2); /* global values */ font-variant-alternates: initial; font-variant-alternates: inherit; font-variant-alternates: unset; the @font-feature-values at-rule can define names for alternative glyph functions (stylistic, styleset, character-variant, swash, ornament or annota...
...And 7 more matches
Alt-Svc - HTTP
WebHTTPHeadersAlt-Svc
the alt-svc http response header is used to advertise alternative services through which the same resource can be reached.
... an alternative service is defined by a protocol/host/port combination.
... syntax alt-svc: clear alt-svc: <protocol-id>=<alt-authority>; ma=<max-age> alt-svc: <protocol-id>=<alt-authority>; ma=<max-age>; persist=1 clear the special value ''clear" indicates that the origin requests all alternatives for that origin to be invalidated.
...And 7 more matches
globalThis - JavaScript
the global globalthis property contains the global this value, which is akin to the global object.
... property attributes of globalthis writable yes enumerable no configurable yes description historically, accessing the global object has required different syntax in different javascript environments.
... the globalthis property provides a standard way of accessing the global this value (and hence the global object itself) across environments.
...And 5 more matches
MouseEvent.altKey - Web APIs
WebAPIMouseEventaltKey
the mouseevent.altkey read-only property is a boolean that indicates whether the alt key was pressed or not when a given mouse event occurs.
... be aware that the browser can't always detect the alt key on some operating systems.
... on some linux variants, for example, a left mouse click combined with the alt key is used to move or resize windows.
...And 4 more matches
PRIntervalTime
syntax #include <prinrval.h> typedef pruint32 printervaltime; #define pr_interval_min 1000ul #define pr_interval_max 100000ul #define pr_interval_no_wait 0ul #define pr_interval_no_timeout 0xfffffffful description the units of printervaltime are platform-dependent.
... the increasing interval value represented by printervaltime wraps.
...these constants bound both the period and the resolution of a printervaltime object.
...And 3 more matches
SpeechRecognitionAlternative - Web APIs
the speechrecognitionalternative interface of the web speech api represents a single word that has been recognised by the speech recognition service.
... properties speechrecognitionalternative.transcript read only returns a string containing the transcript of the recognised word.
... speechrecognitionalternative.confidence read only returns a numeric estimate of how confident the speech recognition system is that the recognition is correct.
...And 3 more matches
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
the <altglyph> svg element allows sophisticated selection of the glyphs used to render its child character data.
... value type: <string> ; default value: none; animatable: no xlink:href an <iri> reference either to a <glyph> element in an svg document or to an <altglyphdef> element.
... if the reference is to a <glyph> element and that glyph is available, then that glyph is rendered instead of the character(s) that are inside of the <altglyph> element.
...And 3 more matches
SVGAltGlyphElement - Web APIs
the svgaltglyphelement interface represents an <altglyph> element.
...musical symbols) or even alternate glyphs such as asian text strings it is required that a different set of glyphs be used than the normal given character data.
... svgaltglyphelement.glyphref it corresponds to the attribute glyphref on the given element.
...And 2 more matches
TouchEvent.altKey - Web APIs
WebAPITouchEventaltKey
summary a boolean value indicating whether or not the alt (alternate) key is enabled when the touch event is created.
... if the alt key is enabled, the attribute's value is true.
... syntax var altenabled = touchevent.altkey; return value altenabled true if the alt key is enabled for this event; and false if the alt is not enabled.
...And 2 more matches
GeolocationCoordinates.altitudeAccuracy - Web APIs
the geolocationcoordinates.altitudeaccuracy read-only property is a strictly positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters.
... this value is null if the implementation doesn't support measuring altitude.
... syntax let altacc = geolocationcoordinatesinstance.altitudeaccuracy value a positive double representing the accuracy, with a 95% confidence level, of the altitude expressed in meters.
... specifications specification status comment geolocation apithe definition of 'geolocationcoordinates.altitudeaccuracy' in that specification.
msRealTime - Web APIs
msrealtime is a read/write property which specifies whether or not to enable low-latency playback on the media element.
... syntax ptr = object.msrealtime; value boolean value set to true indicates that low-latency playback will be enabled on the media element.
... you must set the msrealtime before setting the src property in code.
... msrealtime should not be used in non-real-time or non-communication scenarios, such as audio and/or video playback, as this can affects playback startup latency of audio and video playback.
RTCIceServer.credentialType - Web APIs
the rtciceserver dictionary's credentialtype property is a string value from the rtcicecredentialtype enum which indicates what type of credential the rtciceserver.credential value is.
... credentialtype = newcredentialtype, ...
... }; var credentialtype = iceserver.credentialtype; iceserver.credentialtype = newcredentialtype; value the permitted values are found in the rtcicecredentialtype enumerated string type: oauth the rtciceserver requires the use of oauth 2.0 to authenticate in order to use the ice server described.
... mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "turn:turnserver.example.org", // a turn server username: "webrtc", credential: "turnpassword", credentialtype: "password" } ] }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtciceserver.credential' in that specification.
SpeechRecognition.maxAlternatives - Web APIs
the maxalternatives property of the speechrecognition interface sets the maximum number of speechrecognitionalternatives provided per speechrecognitionresult.
... syntax var mymaxalternativenumber = myspeechrecognition.maxalternatives; myspeechrecognition.maxalternatives = 2; value a number representing the maximum returned alternatives for each result.
...sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
... specifications specification status comment web speech apithe definition of 'maxalternatives' in that specification.
SpeechRecognitionAlternative.confidence - Web APIs
syntax var myconfidence = speechrecognitionalternativeinstance.confidence; returns a number betwen 0 and 1.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log('confidence: ' + event.results[0][0].confidence); } specifications specification status comment web speech apithe definition of 'confidence' in that specification.
SpeechRecognitionAlternative.transcript - Web APIs
syntax var mytranscript = speechrecognitionalternativeinstance.transcript; returns a domstring.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'transcript' in that specification.
USBDevice.clearHalt() - Web APIs
the clearhalt() method of the usbdevice interface returns a promise that resolves when a halt condition is cleared.
... a halt condition is when a data tranfer to or from the device has a status of 'stall', which requires the web page (the host system, in usb terminology) to clear that condition.
... syntax var promise = usbdevice.clearhalt(direction, endpointnumber) parameters direction indicates whether the devices input or output should be cleared.
...clearing.'); await device.clearhalt('in', 1); } } specifications specification status comment webusbthe definition of 'clearhalt()' in that specification.
USBDevice.selectAlternateInterface() - Web APIs
the selectalternateinterface() method of the usbdevice interface returns a promise that resolves when the specified alternative endpoint is selected.
... syntax var promise = usbdevice.selectalternateinterface(interfacenumber, alternatesetting) parameters interfacenumber the index of one of the interfaces supported by the device.
... alternatesetting the configuration of the selected interface.
... specifications specification status comment webusbthe definition of 'selectalternateinterface()' in that specification.
gestalt - Archive of obsolete content
gestalt (macintosh only) retrieves information about the operating environment.
... method of install object syntax int gestalt ( string selector ); parameters the gestalt method takes the following parameters: selector the selector code for the information you want.
...description the gestalt method is a wrapper for the gestalt function of the macintosh toolbox.
Event.explicitOriginalTarget - Web APIs
for example, mouse events are retargeted to their parent node when they happen over text nodes (see bug 185889), and in that case currenttarget will show the parent and explicitoriginaltarget will show the text node.
... explicitoriginaltarget differs from originaltarget in that it will never contain anonymous content.
... function mycommand(ev) { alert(ev.explicitoriginaltarget.nodename); // returns 'menuitem' } <xul:command id="my-cmd-anaction" oncommand="mycommand(event);"/> <xul:menulist> <xul:menupopup> <xul:menuitem label="get my element name!" command="my-cmd-anaction"/> </xul:menupopup> </menulist> specifications this is a mozilla-specific property.
GeolocationCoordinates.altitude - Web APIs
the geolocationcoordinates.altitude read-only property is a double representing the altitude of the position in meters, relative to sea level.
... syntax let alt = geolocationcoordinatesinstance.altitude value a double representing the altitude of the position in meters, relative to sea level.
... specifications specification status comment geolocation apithe definition of 'coordinates.altitude' in that specification.
KeyboardEvent.altKey - Web APIs
the keyboardevent.altkey read-only property is a boolean that indicates if the alt key (option or ⌥ on os x) was pressed (true) or not (false) when the event occured.
... syntax var altkeypressed = instanceofkeyboardevent.altkey return value boolean examples <html> <head> <title>altkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key keydown: " + string.fromcharcode(e.charcode) + "\n" + "charcode: " + e.charcode + "\n" + "alt key keydown: " + e.altkey + "\n" ); } </script> </head> <body onkeydown="showchar(event);"> <p> press any character key, with or without holding down the alt key.<br /> you can also use the shift key together with the alt key.
... </p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'keyboardevent.altkey' in that specification.
SVGAltGlyphDefElement - Web APIs
the svgaltglyphdefelement interface corresponds to the <altglyphdef> element.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgaltglyphdefelement" target="_top"><rect x="1" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="106" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgaltglyphdefelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgaltglyphdefelement' in that specification.
SVGAltGlyphItemElement - Web APIs
the svgaltglyphitemelement interface corresponds to the <altglyphitem> element.
... <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/svgaltglyphitemelement" target="_top"><rect x="1" y="1" width="220" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="111" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgaltglyphitemelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgaltglyphitemelement' in that specification.
<altGlyphDef> - SVG: Scalable Vector Graphics
the <altglyphdef> svg element defines a substitution representation for glyphs.
... usage context categoriestext content elementpermitted contenteither: one or more <glyphref> elements, or one or more <altglyphitem> elements attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphdefelement interface.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<altglyphdef>' in that specification.
<altGlyphItem> - SVG: Scalable Vector Graphics
the <altglyphitem> element provides a set of candidates for glyph substitution by the <altglyph> element.
... usage context categoriestext content elementpermitted contentone or more <glyphref> elements example attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphitemelement interface.
... specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of '<altglyphitem>' in that specification.
browser.altClickSave
the preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.
... type:boolean default value: false exists by default: yes application support:firefox 13.0 status: active; last updated 2012-03-19 introduction: pushed to nightly on 2012-03-02 bugs: bug 713052 values true clicking a link while holding the alt key starts the download of that link.
RTCIceCandidateStats.mozLocalTransport - Web APIs
the non-standard mozilla extension to the rtcicecandidatestats dictionary, mozlocaltransport, has been supplanted by the standard relayprotocol property.
... syntax instead of using mozlocaltransport, you should use code like this: localtransport = rtcicecandidatestats.relayprotocol; specifications not part of any specification.
RTCIceCredentialType - Web APIs
the webrtc api's rtcicecredentialtype enumerated string type defines the authentication method used to gain access to an ice server identified by an rtciceserver object.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecredentialtype' in that specification.
alternatingbackground - Archive of obsolete content
« xul reference home alternatingbackground obsolete since gecko 2.0 type: boolean if true, the background of the tree's rows will alternate between two colors.
externalToolbars - Archive of obsolete content
« xul reference externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
PR_IntervalToMicroseconds
syntax #include <prinrval.h> pruint32 pr_intervaltomicroseconds(printervaltime ticks); parameter ticks the number of platform-dependent intervals to convert.
PR_IntervalToMilliseconds
syntax #include <prinrval.h> pruint32 pr_intervaltomilliseconds(printervaltime ticks); parameter ticks the number of platform-dependent intervals to convert.
PR_IntervalToSeconds
syntax #include <prinrval.h> pruint32 pr_intervaltoseconds(printervaltime ticks); parameter ticks the number of platform-dependent intervals to convert.
PR_LocalTimeParameters
syntax #include <prtime.h> prtimeparameters pr_localtimeparameters ( const prexplodedtime *gmt); parameter gmt a pointer to the clock/calendar time whose offsets are to be determined.
Event.originalTarget - Web APIs
note: originaltarget may also be native anonymous content (see bug 208427), in which case it's useless for non-privileged code.
HTMLMediaElement.initialTime - Web APIs
the htmlmediaelement.initialtime is the initial playback position in seconds.
SVGAltGlyphElement.glyphRef - Web APIs
the svgaltglyphelement.glyphref property is a domstring representing a glyph identifier.
Index - Web APIs
WebAPIIndex
135 audiocontext.suspend() api, audio, audiocontext, method, reference, web audio api, suspend the suspend() method of the audiocontext interface suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing cpu/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while.
...although the method is not a part of the audioworkletprocessor interface, each class that derives from it must have it implemented.
... 256 basiccardresponse api, basic card payment, basiccardresponse, experimental, interface, payment request, payment request api, reference the basiccardresponse dictionary (related to the payment request api, although defined in the basic card payment spec) defines an object structure for payment response details such as the number/expiry date of the card used to make the payment, and the billing address.
...And 65 more matches
Images in HTML - Learn web development
note: you can find the finished example from this section running on github (see the source code too.) alternative text the next attribute we'll look at is alt.
...for example, our above code could be modified like so: <img src="images/dinosaur.jpg" alt="the head and torso of a dinosaur skeleton; it has a large head with long sharp teeth"> the easiest way to test your alt text is to purposely misspell your filename.
... if for example our image name was spelled dinosooooor.jpg, the browser wouldn't display the image, and would display the alt text instead: so, why would you ever see or need alt text?
...And 24 more matches
MathML Torture Test
ola</option> <option value="texgyretermes">tex gyre termes</option> <option value="xits">xits</option> </select> <br/> </p> <table> <tr> <td></td> <th scope="col">as rendered by tex</th> <th scope="col">as rendered by your browser</th></tr> <tr> <td>1</td> <td><img src="https://udn.realityripple.com/samples/45/d5a0dbbca3.png" width="38" height="22" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <msup> <mi>y</mi> <mn>2</mn> </msup> </mrow> </math> </td></tr> <tr> <td>2</td> <td><img src="https://udn.realityripple.com/samples/b8/da4a50ea34.png" width="30" heig...
...ht="17" alt="texbook, 16.2-16.3" /></td> <td> <math display="block"> <!-- <mrow> <msub><mi></mi><mn>2</mn></msub> <msub><mi>f</mi><mn>3</mn></msub> </mrow> --> <mrow> <mmultiscripts> <mi>f</mi> <mn>3</mn><none/> <mprescripts/> <mn>2</mn><none/> </mmultiscripts> </mrow> </math> </td></tr> <tr> <td>3</td> <td><img src="https://udn.realityripple.com/samples/8a/1d0e6e073c.png" width="58" height="47" alt="texbook, 17-17.1" /></td> <td> <math display="block"> <mrow> <mfrac> <mrow> <mi>x</mi> <mo>+</mo> <msup> <mi>y</mi> ...
... <mn>2</mn> </msup> </mrow> <mrow> <mi>k</mi> <mo>+</mo> <mn>1</mn> </mrow> </mfrac> </mrow> </math> </td></tr> <tr> <td>4</td> <td><img src="https://udn.realityripple.com/samples/a7/27acbeabcf.png" width="76" height="25" alt="texbook, 17-17.1" /></td> <td> <math display="block"> <mrow> <mi>x</mi> <mo>+</mo> <msup> <mi>y</mi> <mfrac> <mn>2</mn> <mrow> <mi>k</mi> <mo>+</mo> <mn>1</mn> </mrow> </mfrac> </msup> </mrow> </math> </td></tr> <tr> <td>5</td> ...
...And 21 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
the alt attribute holds a text description of the image, which isn't mandatory but is incredibly useful for accessibility — screen readers read this description out to their users so they know what the image means.
... alt text is also displayed on the page if the image can't be loaded for some reason: for example, network errors, content blocking, or linkrot.
... alt defines an alternative text description of the image.
...And 21 more matches
Index - Archive of obsolete content
189 html to dom code snippets, dom, guide, html, intermediate, needsupdate although you can now natively parse html using domparser and xmlhttprequest, this is a new feature that is not yet supported by all browsers in use in the wild.
...liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions.").
... 549 mac os x build prerequisites/fink fink is a package management system for mac os x, alternative to macports.
...And 19 more matches
filter - CSS: Cascading Style Sheets
WebCSSfilter
filter: blur(5px) <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3710/test_form_2.jpg" style="width: 100%;" /></td> <td> <div class="svg-container"> <svg id="img3" overflow="visible" viewbox="0 0 212 161" color-interpolation-filters="srgb"> ...
... <filter id="svgblur" x="-5%" y="-5%" width="110%" height="110%"> <fegaussianblur in="sourcegraphic" stddeviation="3.5"/> </filter> <image xlink:href="/files/3710/test_form_2.jpeg" filter="url(#svgblur)" width="212px" height="161px"/> </svg> </div> </td> <td><img alt="test_form_s.jpg" id="img4" class="internal default" src="/files/3711/test_form_2_s.jpg" style="width: 100%;" /></td> </tr> </tbody> </table> html { height:100%; } body { font: 14px/1.286 "lucida grande", "lucida sans unicode", "dejavu sans", lucida, arial, helvetica, sans-serif; color: rgb(51, 51, 51); height:100%; overflow:hidden; } #img2 { width:100%; height:auto; -webkit-filter:blur(5px); -ms-filter:blur(5px); filter:blur(5p...
...er> </filter> </svg> <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">static example</th> </tr> </thead> <tbody> <tr> <td><img alt="test_form.jpg" id="img1" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> <td><img alt="test_form.jpg" id="img2" class="internal default" src="/files/3708/test_form.jpg" style="width: 100%;" /></td> <td><div class="svg-container"><svg xmlns="http://www.w3.org/2000/svg" id="img3" viewbox="0 0 286 217" color-interpolation-filters="srgb"> <filter id...
...And 19 more matches
HTML: A good basis for accessibility - Learn web development
all rights reversed.</p> </td> </tr> </table> if you try to navigate this using a screen reader, it will probably tell you that there's a table to be looked at (although some screen readers can guess the difference between table layouts and data tables).
... the <caption> element and <table> summary attribute both do similar jobs — they act as alt text for a table, giving a screen reader user a useful quick summary of the table's contents.
... text alternatives whereas textual content is inherently accessible, the same cannot necessarily be said for multimedia content — image and video content cannot be seen by visually-impaired people, and audio content cannot be heard by hearing-impaired people.
...And 16 more matches
HTML: A good basis for accessibility - Learn web development
all rights reversed.</p> </td> </tr> </table> if you try to navigate this using a screen reader, it will probably tell you that there's a table to be looked at (although some screen readers can guess the difference between table layouts and data tables).
... the <caption> element and <table> summary attribute both do similar jobs — they act as alt text for a table, giving a screen reader user a useful quick summary of the table's contents.
... text alternatives whereas textual content is inherently accessible, the same cannot necessarily be said for multimedia content — image and video content cannot be seen by visually-impaired people, and audio content cannot be heard by hearing-impaired people.
...And 16 more matches
nsINavBookmarksService
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...And 16 more matches
SubtleCrypto.unwrapKey() - Web APIs
to unwrap, we ask the user for the password and use pbkdf2 and some salt to derive the aes-kw unwrapping key.
... the salt needs to be the same as the salt that was used to derive the original aes-kw key wrapping key.
... /* salt that is to be used in derivation of the key-wrapping key, alongside the password the user supplies.
...And 15 more matches
Perceivable - Accessibility
guideline 1.1 — providing text alternatives for non-text content the key here is that text can be converted to other forms that people with disabilities can use.
... success criteria how to conform to the criteria practical resource 1.1.1 provide text equivalents (a) all images that convey meaningful content should be given suitable alternative text.
... text alternatives.
...And 15 more matches
Index
alternatively, should you decide that you don't want to work with any persistent recording of certificates, you may initialize nss in a no-database mode.
...it was originally developed for telecommunication systems at times where it was critical to minimize data as much as possible (although it still makes sense to use that principle today for good performance).
...as a consequence, it will be necessary to try multiple different alternative routes while searching for (z), in a recursive manner.
...And 14 more matches
Fullscreen API - Web APIs
note: navigating to another page, changing tabs, or switching to another application using any application switcher (or alt-tab) will likewise exit full-screen mode.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfullscreen deprecatedchrome full support 71 full support 71 full support 15alternate name alternate name uses the non-standard name: webkitisfullscreenedge full support ≤79 full support ≤79 full support ≤79alternate name alternate name uses the non-standard name: webkitisfullscreenfirefox full support ...
... no support 9 — 65alternate name alternate name uses the non-standard name: mozfullscreenie no support noopera full support 58 full support 58 full support 15alternate name alternate name uses the non-standard name: webkitisfullscreensafari fu...
...And 14 more matches
XUL accessibility guidelines - Archive of obsolete content
trees provide alternative functionality for inaccessible operations.
...it is therefore necessary to provide a keyboard accessible alternative for accessing this functionality.
...provide keyboard-accessible alternative access points for this functionality.
...And 13 more matches
Mozilla’s UAAG evaluation report
(p1) vg alt for img: rendered when images turned off.
... see meta bug 41924 for open issues with the alt attribute.
... alt for area element: ?
...And 13 more matches
imgIContainer
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...And 13 more matches
SubtleCrypto.wrapKey() - Web APIs
let salt; /* get some key material to use as input to the derivekey method.
...*/ function getkeymaterial() { const password = window.prompt("enter your password"); const enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* given some key material and some random salt derive an aes-kw key using pbkdf2.
... */ function getkey(keymaterial, salt) { return window.crypto.subtle.derivekey( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, { "name": "aes-kw", "length": 256}, true, [ "wrapkey", "unwrapkey" ] ); } /* wrap the given key.
...And 13 more matches
Defining Cross-Browser Tooltips - Archive of obsolete content
summary: authors are used to having alt text appear as a &quot;tooltip&quot; above images, but that's not how it was meant to be used.
...authors are used to using the alt attribute to create "tooltips" in web browsers.
... the classic example is a "tooltip" of an image; when the user pauses the mouse pointer over an image, the contents of the alt attribute are displayed as a "tooltip." gecko-based browsers such as mozilla, netscape 6+, and compuserve 7 do not support this behavior.
...And 12 more matches
Fundamental text and font styling - Learn web development
ts will change as operating systems evolve, but it's reasonable to consider the following fonts web safe, at least for now (many of them have been popularized thanks to the microsoft core fonts for the web initiative in the late 90s and early 2000s): name generic type notes arial sans-serif it's often considered best practice to also add helvetica as a preferred alternative to arial as, although their font faces are almost identical, helvetica is considered to have a nicer shape, even if arial is more broadly available.
... courier new monospace some oses have an alternative (possibly older) version of the courier new font called courier.
... it's considered best practice to use both with courier new as the preferred alternative.
...And 12 more matches
Text labels and names - Accessibility
use alt attribute to label area elements that have the href attribute in image maps, give each <area> element an alt attribute containing a name that describes what resources the areas links to.
... failure to do so makes an image map hard to use for users of assistive technology — they need alternative text to be able to understand the purpose of an image.
... examples the following example show a simple image map (taken from h24: providing text alternatives for the area elements of image maps): <img src="welcome.gif" usemap="#map1" alt="areas in the library.
...And 12 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
this article is aimed at presenting alternatives to common eval uses in add-ons and other javascript code.
...if it cannot be easily proven that an eval() call is benign and necessary because there are no viable alternatives, a mozilla add-ons gallery reviewer will generally reject the submission!
...it might be possible to execute any retrieved jsonp code in an unprivileged sandbox (which is complicated!), but if you have a choice, just avoid jsonp altogether!
...And 11 more matches
Handling common accessibility problems - Learn web development
people with hearing impairments relying on captions/subtitles or other text alternatives for audio/video content.
... users on alternative browsing devices such as tvs, watches, etc.
... text alternatives text alternatives are very important for accessibility — if a person has a visual or hearing impairment that stops them being able to see or hear some content, then this is a problem.
...And 10 more matches
Web video codec guide - Web media technologies
lost sharpness can make text in the image difficult to read, as text—especially small text—is very detail-oriented content, where minor alterations can significantly impact legibility.
...av1 is fully royalty-free and is designed for use by both the <video> element and by webrtc.
... safari av1 support 70 75 67 no 57 no container support isobmff[1], mpeg-ts, mp4, webm rtp / webrtc compatible yes supporting/maintaining organization alliance for open media specification https://aomediacodec.github.io/av1-spec/av1-spec.pdf licensing royalty-free, open standard [1] iso base media file format [2] see the av1 specification's tables of levels, which describe the maximum resolutions and rates at each level.
...And 10 more matches
OpenType font features guide - CSS: Cascading Style Sheets
in addition to broad feature sets like ligatures or lining figures (numerals that line up evenly as opposed to 'oldstyle', which look more like lower-case letters), there are also very specific ones such as stylistic sets (which might include several specific variants of glyphs meant to be used together), alternates (which might be one or more variants of the letter 'a'), or even language-specific alterations for east asian languages.
... in the latter case, these alterations are actually necessary to properly express the language, so they go beyond the more stylistic preference of most other opentype features.
... alternates (font-variant-alternates) fonts can supply a number of different alternatives for various glyphs, such as different styles of lower case 'a' or more or less elaborate swashes in a script typeface.
...And 9 more matches
The box model - Learn web development
prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, html basics (study introduction to html), and an idea of how css works (study css first steps.) objective: to learn about the css box model, what makes up the box model and how to switch to the alternate model.
...to add some additional complexity, there is a standard and an alternate box model.
... the alternative css box model you might think it is rather inconvenient to have to add up the border and padding to get the real size of the box, and you would be right!
...And 8 more matches
Background Tasks API - Web APIs
</p> <div class="container"> <div class="label">decoding quantum filament tachyon emissions...</div> <progress id="progress" value="0"></progress> <div class="button" id="startbutton"> start </div> <div class="label counter"> task <span id="currenttasknumber">0</span> of <span id="totaltaskcount">0</span> </div> </div> <div class="logbox"> <div class="logheader"> log </div> <div id="log"> </div> </div> the progress box uses a <progress> element to show the progress, along with a label with sections that are changed to present numeric information about the progress.
... variable declarations let tasklist = []; let totaltaskcount = 0; let currenttasknumber = 0; let taskhandle = null; these variables are used to manage the list of tasks that are waiting to be performed, as well as status information about the task queue and its execution: tasklist is an array of objects, each representing one task waiting to be run.
... totaltaskcount is a counter of the number of tasks that have been added to the queue; it will only go up, never down.
...And 8 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
no support 66 — 71notes alternate name disabled notes combinators in the selector list argument may not match correctly (see bug 842157).alternate name uses the non-standard name: :matches()disabled from version 66 until version 71 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support 12notes alternate name notes doesn't support combinators.alternate name uses the non-standard name: :-webkit-any()edge full support 79notes disabled full support 79notes disabled notes combinators in the selector list argument may not match correctly (see bug 842157).disabled from version 79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support 79notes alternate name notes doesn't support combinators.alternate name uses the non-standard name: :-webkit-any()firefox full support 78 full support 78 full support 77notes disabled notes enabled by default in firefox nightly.disabled from version 77: this feature is behind the layout.css.is-where-selectors.enabled preference (needs to be set to enabled).
...And 8 more matches
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none.
... additional attributes in addition to the attributes shared by all <input> elements, image button inputs support the following attributes: attribute description alt alternate string to display when the image can't be shown formaction the url to which to submit the data formenctype the encoding method to use when submitting the form data formmethod the http method to use when submitting the form formnovalidate a boolean which, if present, indicates that the form shouldn't be validated before submission formtarget a string indicating...
... a browsing context from where to load the results of submitting the form height the height, in css pixels, at which to draw the image src the url from which to load the image width the width, in css pixels, at which to draw the image alt the alt attribute provides an alternate string to use as the button's label if the image cannot be shown (due to error, a user agent that cannot or is configured not to show images, or if the user is using a screen reading device).
...And 8 more matches
Link types - HTML: Hypertext Markup Language
list of the defined link types and their significance in html link type description allowed in these elements not allowed in these elements alternate if the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the title attribute must be present and not be the empty string.
... otherwise, the link defines an alternative page, of one of these types: for another medium, like a handheld device (if the media attribute is set) in another language (if the hreflang attribute is set), in another format, such as a pdf (if the type attribute is set) a combination of these <a>, <area>, <link> <form> archives defines a hyperlink to a document that contains an archive link to this one.
... note: although recognized, the singular archive is incorrect and must be avoided.
...And 8 more matches
min-width - CSS: Cascading Style Sheets
WebCSSmin-width
full support 33safari ios full support 11 full support 11 full support 7prefixed prefixed implemented with the vendor prefix: -webkit-samsung internet android full support 5.0alternate name full support 5.0alternate name alternate name uses the non-standard name: -webkit-fill-availablemax-contentchrome full support 46 full support 46 full support 25prefixed prefixed implemented with the vendor ...
... noopera full support 15prefixed full support 15prefixed prefixed implemented with the vendor prefix: -webkit-safari full support 11 full support 11 full support 2alternate name alternate name uses the non-standard name: intrinsicwebview android full support 46 full support 46 full support ≤37prefixed prefixed implemented with the vendor prefix: -webkit-chrome android full support ...
... 66 full support 4prefixed prefixed implemented with the vendor prefix: -moz-opera android full support 33safari ios full support 11 full support 11 full support 1alternate name alternate name uses the non-standard name: intrinsicsamsung internet android full support 5.0min-contentchrome full support 46 full support 46 full support 25prefixed prefixed implemented with the vendor pref...
...And 7 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
16 alternatingbackground xul attributes, xul reference no summary!
... 704 externaltoolbars toolbars, xul, xul reference no summary!
...for an rdf datasource, again, the results are in the order the query generates them, although except in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order.
...And 6 more matches
HTML basics - Learn web development
take the <img> element that we already have in our html page: <img src="images/firefox-icon.png" alt="my test image"> this contains two attributes, but there is no closing </img> tag and no inner content.
...let's revisit the code we put into our index.html example (which we first met in the dealing with files article): <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="images/firefox-icon.png" alt="my test image"> </body> </html> here, we have the following: <!doctype html> — the doctype.
... images let's turn our attention to the <img> element again: <img src="images/firefox-icon.png" alt="my test image"> as we said before, it embeds an image into our page in the position it appears.
...And 6 more matches
Add a hitmap on top of an image - Learn web development
alt text is mandatory, of course, but many people never see it.
... you insert your image much the same way as always (with an <img> element and alt text).
... if the image is only present as a navigation device, you may write alt="", provided you furnish appropriate alt text in the <area> elements later on.
...And 6 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
create a <script> section at the top of src/components/todos.svelte and give it some content, as follows: <script> let todos = [ { id: 1, name: 'create a svelte starter app', completed: true }, { id: 2, name: 'create your first component', completed: true }, { id: 3, name: 'complete the rest of the tutorial', completed: false } ] let totaltodos = todos.length let completedtodos = todos.filter(todo => todo.completed).length </script> now let's do something with that information.
...find the <h2> heading with an id of list-heading and replace the hardcoded number of active and completed tasks with dynamic expressions: <h2 id="list-heading">{completedtodos} out of {totaltodos} items completed</h2> go to the app, and you should see the "2 out of 3 items completed" message as before, but this time the information is coming from the todos array.
... the same is not true for totaltodos and completedtodos, however.
...And 6 more matches
Index
MozillaTechXPCOMIndex
hashtables may seem like arrays, but there are important differences: 123 mozilla::services namespace developing mozilla, xpcom the services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.
...attempting to alter this bit will result in an ns_error_illegal_value.
...as an alternative, you can just use placesutils.favicons from javascript.
...And 6 more matches
nsIXPConnect
bject); void initclasses(in jscontextptr ajscontext, in jsobjectptr aglobaljsobj); nsixpconnectjsobjectholder initclasseswithnewwrappedglobal(in jscontextptr ajscontext, in nsisupports acomobj, in nsiidref aiid, in nsiprincipal aprincipal, in nsisupports aextraptr, in pruint32 aflags); nsivariant jstovariant(in jscontextptr ctx, in jsval value); nsivariant jsvaltovariant(in jscontextptr cx, in jsvalptr ajsval); void movewrappers(in jscontextptr ajscontext, in jsobjectptr aoldscope, in jsobjectptr anewscope); [noscript,notxpcom] void notejscontext(in jscontextptr ajscontext, in nscctraversalcallbackref acb); void releasejscontext(in jscontextptr ajscontext, in prbool nogc); void removejsholder(in voidptr aholder); nat...
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...And 6 more matches
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
css3 sizing.ie no support noopera full support 44safari full support 6.1prefixed full support 6.1prefixed prefixed implemented with the vendor prefix: -webkit- full support 2alternate name alternate name uses the non-standard name: intrinsicwebview android full support 46 full support 46 full support ≤37prefixed prefixed implemented with the vendor prefix: -webkit-chrome android full support ...
...so, the definition of fit-content is simpler than in css3 sizing.opera android full support 43safari ios full support 7prefixed full support 7prefixed prefixed implemented with the vendor prefix: -webkit- full support 1alternate name alternate name uses the non-standard name: intrinsicsamsung internet android full support 5.0max-content experimentalchrome full support 46 full support 46 full support 22prefixed prefixed implemented with th...
...refix: -moz-ie no support noopera full support 44safari full support 6.1prefixed full support 6.1prefixed prefixed implemented with the vendor prefix: -webkit- full support 2alternate name alternate name uses the non-standard name: intrinsicwebview android full support 46 full support 46 full support ≤37prefixed prefixed implemented with the vendor prefix: -webkit-chrome android full support ...
...And 6 more matches
Image file type and format guide - Web media technologies
gif is a good choice for simple images and animations, although converting full color images to gif can result in unsatisfactory dithering.
...no known royalty-bearing patents.
...it's not generally useful for strictly bitmap or photographic images, although it is possible to include bitmap images within an svg.
...And 6 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
although browser detection is perhaps the most common scripting task that every web developer faces, it seems that the variety of different strategies in use for detecting browsers is unlimited.
...for more specific gecko recommendations, please see the gecko compatibility handbook gecko although many web developers are aware of firefox, mozilla, and netscape browsers, far fewer are aware that these browsers are members of an entire family of user agents based upon the gecko layout engine which includes the commercial browser compuserve 7, and open source browsers such as epiphany, galeon, camino, kmeleon, and seamonkey.
...although this approach was considered reasonable at the time, this approach caused problems for browser vendors right from the beginning.
...And 5 more matches
RDF in Mozilla FAQ - Archive of obsolete content
var ds = rdf.getdatasource("http://www.mozilla.org/some-rdf-file.rdf"); // note that ds will load asynchronously, so assertions will not // be immediately available alternatively, you can create one directly using the xpcom component manager, as the following code fragment illustrates: // create an rdf/xml datasource using the xpcom component manager var ds = components .classes["@mozilla.org/rdf/datasource;1?name=xml-datasource"] .createinstance(components.interfaces.nsirdfdatasource); // the nsirdfremotedatasource interface has the interfaces // that we...
...if (bookmarks.hasassertion( rdf.getresource("http://home.netscape.com/nc-rdf#bookmarksroot"), rdf.getresource("http://home.netscape.com/nc-rdf#child"), rdf.getresource("http://home.netscape.com/nc-rdf#personaltoolbarfolder"), true) { // ...
... } alternatively, some datasources have "special" rdf-friendly contractids that make it easy to instantiate the datasource using either the nsirdfserivce's getdatasource() method or the datasources attribute on a xul template.
...And 5 more matches
CSS and JavaScript accessibility best practices - Learn web development
you could style form focus/hover states to make this behaviour more consistent across browsers or fit in better with your page design, but don't get rid of it altogether — again, people rely on these clues to help them know what is going on.
...for example, in our tabbed info box example (see source code) we have three panels of information, but we are positioning them on top of one another and providing tabs that can be clicked to show each one (it is also keyboard accessible — you can alternatively use tab and enter/return to select them).
...for example, making sure you use headings and paragraphs, and <button> and <a> elements making sure content is available as text, either directly as text content, good text labels for form elements, or text alternatives, e.g.
...And 5 more matches
Responsive images - Learn web development
note: the new features discussed in this article — srcset/sizes/<picture> — are all supported in release versions of modern desktop and mobile browsers (including microsoft's edge browser, although not internet explorer.) how do you create responsive images?
...the standard <img> element traditionally only lets you point the browser to a single source file: <img src="elva-fairy-800w.jpg" alt="elva dressed as a fairy"> we can however use two new attributes — srcset and sizes — to provide several additional source images along with hints to help the browser pick the right one.
... you can see an example of this in our responsive.html example on github (see also the source code): <img srcset="elva-fairy-480w.jpg 480w, elva-fairy-800w.jpg 800w" sizes="(max-width: 600px) 480px, 800px" src="elva-fairy-800w.jpg" alt="elva dressed as a fairy"> the srcset and sizes attributes look complicated, but they're not too hard to understand if you format them as shown above, with a different part of the attribute value on each line.
...And 5 more matches
Gecko info for Windows accessibility vendors
the msaa tree and the dom tree are parallel structures, although the msaa tree is a subset of the dom tree.
... we do not currently support directional navigation via accnavigate() we do not currently support scroll bars as iaccessible objects, although we do support event_scrollingend and isimpledomnode::scrollto(), explained below.
... we do not currently support role_system_row, although internet explorer doesn't either, and the reason seems apparent.
...And 5 more matches
Gecko Keypress Event
charcode of dom keypress event if a keypress event is fired without any modifier keys (ctrl/alt(option)/meta(win/command)), then the properties of the event are the same as they were in gecko1.8.1.
... the charcode value depends on the state of capslock and numlock (except they are currently ignored if alt (option) is down on mac - see bug 432953).
... windows the charcode is replaced only when ctrl is down but alt is not down.
...And 5 more matches
Mozilla Web Developer FAQ
it is also possible, although not very likely, that you are seeing a bug.
...for example, the existence of document.getelementbyid() can be checked as follows: if(document.getelementbyid) { /* code that uses document.getelementbyid() */ } why doesn’t mozilla display my alt tooltips?
... contrary to a popular belief stemming from the behavior of a couple browsers running on the windows platform, alt isn’t an abbreviation for ‘tooltip’ but for ‘alternative’.
...And 5 more matches
Setting up the Gecko SDK
to edit project settings, select settings from the project menu (or press alt-f7).
... ispecialthing.idl #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(in long a, in long b); }; next is to build the .h file to compile against and the .xpt for gecko to understand your new interface.
... xpidl -m header ispecialthing.idl xpidl -m typelib ispecialthing.idl the code add the main code, the real work horse.
...And 5 more matches
Guide to the Fullscreen API - Web APIs
in addition, navigating to another page, changing tabs, or switching to another application (using, for example, alt-tab) while in fullscreen mode exits fullscreen mode as well.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfullscreen deprecatedchrome full support 71 full support 71 full support 15alternate name alternate name uses the non-standard name: webkitisfullscreenedge full support ≤79 full support ≤79 full support ≤79alternate name alternate name uses the non-standard name: webkitisfullscreenfirefox full support ...
... no support 9 — 65alternate name alternate name uses the non-standard name: mozfullscreenie no support noopera full support 58 full support 58 full support 15alternate name alternate name uses the non-standard name: webkitisfullscreensafari fu...
...And 5 more matches
KeyboardEvent: code values - Web APIs
keyc" "keyc" 0x002f "keyv" "keyv" 0x0030 "keyb" "keyb" 0x0031 "keyn" "keyn" 0x0032 "keym" "keym" 0x0033 "comma" "comma" 0x0034 "period" "period" 0x0035 "slash" "slash" 0x0036 "shiftright" "shiftright" 0x0037 "numpadmultiply" "numpadmultiply" 0x0038 "altleft" "altleft" 0x0039 "space" "space" 0x003a "capslock" "capslock" 0x003b "f1" "f1" 0x003c "f2" "f2" 0x003d "f3" "f3" 0x003e "f4" "f4" 0x003f "f5" "f5" 0x0040 "f6" "f6" 0x0041 "f7" "f7" 0x0042 "f8" "f8" 0x0043 "f9" "f9" 0x...
...004b "numpad4" "numpad4" 0x004c "numpad5" "numpad5" 0x004d "numpad6" "numpad6" 0x004e "numpadadd" "numpadadd" 0x004f "numpad1" "numpad1" 0x0050 "numpad2" "numpad2" 0x0051 "numpad3" "numpad3" 0x0052 "numpad0" "numpad0" 0x0053 "numpaddecimal" "numpaddecimal" 0x0054 (alt + printscreen) "printscreen" "" 0x0055 "unidentified" "" 0x0056 "intlbackslash" "intlbackslash" 0x0057 "f11" "f11" 0x0058 "f12" "f12" 0x0059 "numpadequal" "" 0x005a "unidentified" "" 0x005b "unidentified" "f13" 0x005c "unidentified" "f14...
... "audiovolumeup" "volumeup" (was "volumeup" until chrome 50) 0xe031 "unidentified" "" 0xe032 "browserhome" "browserhome" 0xe033, 0xe034 "unidentified" "" 0xe035 "numpaddivide" "numpaddivide" 0xe036 "unidentified" "" 0xe037 "printscreen" "printscreen" 0xe038 "altright" "altright" 0xe039, 0xe03a "unidentified" "" 0xe03b "unidentified" "help" 0xe03c~ 0xe044 "unidentified" "" 0xe045 "numlock" "numlock" 0xe046 (ctrl + pause) "pause" "pause" 0xe047 "home" "home" 0xe048 "arrowup" "arrowup" 0xe049 "pageup" "pageu...
...And 5 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
our renderer needs to know where we imagine the camera to be, then alter the position of every visible object to simulate that position and orientation.
... some 3d games offer the ability to change your point of view, such as to look out the various windows of an aircraft in a flight simulator, or to see the views from all the security cameras within the game level (a common feature of spy and stealth-based games).
...this inverse matrix can then be applied to the objects in the world to alter their positions and orientations to simulate the desired camera position.
...And 5 more matches
@font-feature-values - CSS: Cascading Style Sheets
the @font-feature-values css at-rule lets you use a common name in the font-variant-alternates property for features activated differently in opentype.
... syntax feature value blocks @swash specifies a feature name that will work with the swash() functional notation of font-variant-alternates.
... @annotation specifies a feature name that will work with the annotation() functional notation of font-variant-alternates.
...And 5 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
values for the rel attribute, and the elements for which each is relevant rel value description <link> <a> and <area> <form> alternate alternate representations of the current document.
... alternate indicates an alternate representation of the current document.
... with the stylesheet keyword on a <link>, it creates an alternate stylesheet.
...And 5 more matches
Keyboard Shortcuts - Archive of obsolete content
in the example below, the file menu can be selected by pressing alt + f together (or some other key combination for a specific platform).
...although shortcuts such as this might not always be valid, they will usually work any time the window is open.
... alt the user must press the alt key.
...And 4 more matches
Examples - Archive of obsolete content
<dt>mozilla 1.1+/opera 7</dt> <dd>do not apply css or execute the javascript.</dd> <dt>netscape 7.0x/mozilla 1.0.x</dt> <dd>do not apply css but does execute the javascript.</dd> <dt>internet explorer 5.5+</dt> <dd>can not display the document.</dd> </dl> <p> <a href="http://validator.w3.org/check/referer"><img src="https://udn.realityripple.com/samples/8a/9e64asf935.png" alt="valid xhtml 1.0!" height="31" width="88" /></a> </p> </body> </html> back to the article problem 3 <!-- this file should have a .xhtml extension and will generate an error when parsed.
... </p> <p> <a href="http://validator.w3.org/check/referer"><img src="https://udn.realityripple.com/samples/8a/9e64asf935.png" alt="valid xhtml 1.0!" height="31" width="88" /></a> </p> </body> </html> back to the article example 2 <!-- this file should have a .xml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>example 2 - xhtml 1.0 strict as text/xm...
... </p> <p> <a href="http://validator.w3.org/check/referer"><img src="https://udn.realityripple.com/samples/8a/9e64asf935.png" alt="valid xhtml 1.0!" height="31" width="88" /></a> </p> </body> </html> back to the article example 3 <!-- this file should have a .xhtml extension --> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <title>example 3 - xhtml 1.0 strict as appli...
...And 4 more matches
Correctly Using Titles With External Stylesheets - Archive of obsolete content
this is because the title attribute on a <link rel="stylesheeet"> element makes it either preferred or an alternative style sheet.
... there are three kinds of stylesheets that are possible: persistent, preferred, and alternate stylesheets.
...any link element referring to a stylesheet with a title attribute must be either preferred or alternate, depending on the value of the rel attribute.
...And 4 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
197 http header glossary, http header, webmechanics an http header is a field of an http request or response that passes additional information, altering or precising the semantics of the message or of the body.
... although not a strict subset, json closely resembles a subset of javascript syntax.
...the lgpl provides a more permissive alternative for the strictly copyleft gpl.
...And 4 more matches
What is accessibility? - Learn web development
note: the world health organization's disability and health fact sheet states that "over a billion people, about 15% of the world's population, have some form of disability", and "between 110 million and 190 million adults have significant difficulties in functioning." people with visual impairments people with visual impairments include people with blindness, low-level vision, and color blindness.
... in terms of statistics, the world health organization estimates that "285 million people are estimated to be visually impaired worldwide: 39 million are blind and 246 have low vision." (see visual impairment and blindness).
... there are, however, specific techniques for providing textual alternatives to audio content which range from simple text transcripts to text tracks (i.e.
...And 4 more matches
Getting started with React - Learn web development
you may also use the yarn package manager as an alternative, but we'll assume you are using npm in this set of tutorials.
...this file contains our first component, app, and a few other lines of code: import react from 'react'; import logo from './logo.svg'; import './app.css'; function app() { return ( <div classname="app"> <header classname="app-header"> <img src={logo} classname="app-logo" alt="logo" /> <p> edit <code>src/app.js</code> and save to reload.
... function app() { return ( <div classname="app"> <header classname="app-header"> <img src={logo} classname="app-logo" alt="logo" /> <p> edit <code>src/app.js</code> and save to reload.
...And 4 more matches
Package management basics - Learn web development
although there tend to be more pros for installing globally, the pros for installing locally are more important — such as code portability and version locking.
...a successful and popular alternative package manager is yarn.
...we’ll call it parcel-experiment, but you can call it whatever you like: mkdir parcel-experiment cd parcel-experiment next, let's initialise our app as an npm package, which creates a config file — package.json — that allows us to save our configuration details in case we want to recreate this environment later on, or even publish the package to the npm registry (although this is somewhat beyond the scope of this article).
...And 4 more matches
Accessible Toolkit Checklist
alt+f4 closes windows, similar to escape but even works on dialogs without cancel button alt+space opens window menu with restore, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows, initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definab...
... get_acckeyboardshortcut: what is the keyboard shortcut for this iaccessible (underlined alt+combo mnemonic) get_accfocus: which child is focused?
... the high contrast theme can be toggled dynamically with leftalt+leftshift+printscreen expose the spi_getscreenreader flag to xml/scripts so that apps can alter behavior use system highlight color where possible for item selection, but never use that exact color in more than 1 place at a time, otherwise screen reader will read everything with that color whenever highlight changes pay attention to spi_getcaretwidth for the correct width of the...
...And 4 more matches
NSS tools : certutil
-q pqgfile or curve-name read an alternate pqg value from the specified file when generating dsa key pairs.
... -y exp set an alternate exponent value to use in generating a new rsa public key for the database, instead of the default value of 65537.
... the available alternate values are 3 and 17.
...And 4 more matches
NSS Tools certutil
-q pqgfile read an alternate pqg value from the specified file when generating dsa key pairs.
... -y exp set an alternate exponent value to use in generating a new rsa public key for the database, instead of the default value of 65537.
... the available alternate values are 3 and 17.
...And 4 more matches
certutil
-q pqgfile read an alternate pqg value from the specified file when generating dsa key pairs.
... -y exp set an alternate exponent value to use in generating a new rsa public key for the database, instead of the default value of 65537.
... the available alternate values are 3 and 17.
...And 4 more matches
nsIEditorIMESupport
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...And 4 more matches
Comparison of Event Targets - Web APIs
event.explicitoriginaltarget event.webidl if the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retargeting occurs.
... for example, mouse events are retargeted to their parent node when they happen over text nodes (bug 185889), and in that case .target will show the parent and .explicitoriginaltarget will show the text node.
... unlike .originaltarget, .explicitoriginaltarget will never contain anonymous content.
...And 4 more matches
Using the Web Speech API - Web APIs
public declares that it is a public rule, the string in angle brackets defines the recognised name for this term (color), and the list of items that follow the equals sign are the alternative values that will be recognised and accepted as appropriate values for the term.
... speechrecognition.maxalternatives: sets the number of alternative potential matches that should be returned per result.
... this can sometimes be useful, say if a result is not completely clear and you want to display a list if alternatives for the user to choose the correct one from.
...And 4 more matches
ARIA Test Cases - Accessibility
for example, "options, button, alt+shift+t" should be spoken if there is an options button in the alert with alt+shift+t as an accesskey.
... expected at behavior: when focus falls on a button, a screen reader speaks the text of the button plus alternative text of any images within the button (the accessible name of the button).
... (al) alternatively, description are not read automatically but may be accessible from a hotkey.
...And 4 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
the alt attribute displays if the image src is missing.
... <input type="image" name="image" src="" alt="image input"/> month a control for entering a month and year, with no time zone.
... attributes for the <input> element include global html attributes and: attribute type or types description accept file hint for expected file type in file upload controls alt image alt attribute for the image type.
...And 4 more matches
HTTP Index - HTTP
WebHTTPIndex
rudp — the reliable update of udp — is a suitable alternative.
... 65 alt-svc draft, http, http header, needscompattable, needscontent, needsexample, reference the alt-svc header is used to list alternate ways to reach this website.
... 74 content-location http, reference, header the content-location header indicates an alternate location for the returned data.
...And 4 more matches
xlink:href - SVG: Scalable Vector Graphics
22 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use>} html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a xlink:href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> a for <a>, xlink:href...
... value <iri> default value none animatable yes altglyph for <altglyph>, xlink:href defines the reference either to a <glyph> element in an svg document fragment or to an <altglyphdef> element.
... if the reference is to a <glyph> element and that glyph is available, then that glyph is rendered instead of the characters that are inside of the <altglyph> element.
...And 4 more matches
MMgc - Archive of obsolete content
alternately, you can open the mmgc namespace in your c++ source so that you can refer to the objects more concisely: using namespace mmgc; ...
...memory allocated with alloc doesn't need to be explicitly freed, although it can be freed with free if it is known that there are no other references to it.
...if this isn't true we hope to eliminate other threads from doing this and if we can't do that we will be forced to make our gc thread safe, although we hope we don't have to do that.
...And 3 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
tooltips legacy browsers introduced tooltips into html by showing them on links and using the value of the alt attribute as a tooltip's content.
...modern browsers will use the title attribute to display tooltips, and mozilla only supports showing tooltips for that attribute and not the alt attribute.
... alternatively, you can change the markup and close the opened <a /> before the start of the text -- the anchor will continue to work this way.
...And 3 more matches
Elements - Archive of obsolete content
although you can see this content on screen as if it was directly in the file, this content is anonymous and is hidden from the normal dom.
...if set to true, the value of the property cannot be altered.
... onset - the onset attribute's value is a script that executes when the value of the property is being altered.
...And 3 more matches
XUL Structure - Archive of obsolete content
document types: html xml xul css mozilla uses a distinctly different kind of document object (dom) for html and xul, although they share much of the same functionality.
...typically, you put all the xul files for an application in this directory, although extensions are installed in the extensions directory for a particular user.
...although it's normal to combine the files into a jar file, packages may also be accessed in expanded form into a directory.
...And 3 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
when auditors evaluate an organizations financial health, they do so by following the fasb rules.
...it was an elegant workstation with an iconic desktop developed by the engineers at parc (palo alto research center).
...when usability alters too much across products, users complain.
...And 3 more matches
Styling tables - Learn web development
we've coupled this with a width of 100%, meaning that the table will fill any container it is put in, and be nicely responsive (although it would still need some more work to get it looking good on narrow screen widths).
...by default, when you set borders on table elements, they will all have spacing between them, as the below image illustrates: this doesn't look very nice (although it might be the look you want, who knows?) with border-collapse: collapse; set, the borders collapse down into one, which looks much better: we've put a border around the whole table, which is needed because we'll be putting some borders round the table header and footer later on — it looks really odd and disjointed when you don't have a border round the whole outside of the table and end up with gaps.
... first, add the following <link> element into your html head, just above your existing <link> element: <link href='https://fonts.googleapis.com/css?family=rock+salt' rel='stylesheet' type='text/css'> now add the following css into your style.css file, below the previous addition: /* typography */ html { font-family: 'helvetica neue', helvetica, arial, sans-serif; } thead th, tfoot th { font-family: 'rock salt', cursive; } th { letter-spacing: 2px; } td { letter-spacing: 1px; } tbody td { text-align: center; } tfoot th { text-align: right;...
...And 3 more matches
How can we design for all types of users? - Learn web development
note: alternatively you can find a number of contrast checkers online, such as webaim's color contrast checker.
...if you want an elastic/responsive website, and you don't know what the browser's default width is, you can use the max-width property to allow up to 70 characters per line and no more: div.container { max-width:70em; } alternative content for images, audio, and video websites often include stuff besides plain text.
...make sure they feature an empty alt attribute: <img src="deco.gif" alt=""> so they don't clog up the text.
...And 3 more matches
Introduction to client-side frameworks - Learn web development
overview: client-side javascript frameworks next we begin our look at frameworks with a general overview of the area, looking at a brief history of javascript and frameworks, why frameworks exist and what they give us, how to start thinking about choosing a framework to learn, and what alternatives there are to client-side frameworks.
... objective: to understand how client-side javascript frameworks came to exist, what problems they solve, what alternatives there are, and how to go about choosing one.
...these opinions allow for predictability and homogeneity in an application; predictability allows software to scale to an enormous size and still be maintainable; predictability and maintainability are essential for the health and longevity of software.
...And 3 more matches
Handling common JavaScript problems - Learn web development
things have improved significantly since then; modern browsers do a good job of supporting "classic javascript features", and the requirement to use such code has diminished as the requirement to support older browsers has lessened (although bear in mind that they have not gone away altogether).
... libraries javascript libraries are essentially third party units of code that you can attach to your page, providing you with a wealth of ready-made functionality that can be used straight away, saving you a lot of time in the process.
...via a <script> element), although there are normally many other usage options for such libraries, like installing them as bower components, or including them as dependencies via the webpack module bundler.
...And 3 more matches
nsITextInputProcessor
for example, ctrl+c should be "c", ctrl+shift+cshould be "c", altgr+c may be "©" and then, ctrl+altgr+c should be "©".
...although the rules to decide the keycode value are different on each web browser, you should use same rules as gecko because your events are dispatched on gecko.
... sharing modifier state during multiple instances sharemodifierstateof() allows to share modifier state between multiple instances: var shiftkey = new keyboardevent("", { key: "shift", code: "shiftleft" }); var ctrlkey = new keyboardevent("", { key: "control", code: "controlleft" }); var altkey = new keyboardevent("", { key: "alt", code: "altleft" }); tip1.keydown(shiftkey); // tip1's shift state becomes active.
...And 3 more matches
Deprecated tools - Firefox Developer Tools
although these panels have been removed, you still have access to the old code, and there are alternative webextensions that you can try to get similar functionality.
... alternatives in firefox 71+, you can write multi-line javascript code in the web console editor mode, making it similar to the scratchpad.
... alternatives remote debugging is available in about:debugging as of firefox 68.
...And 3 more matches
AudioParam.cancelAndHoldAtTime() - Web APIs
— 56alternate name alternate name uses the non-standard name: cancelvaluesandholdattime()edge full support ≤79firefox no support noie no support noopera full support 44 full support ...
...— 43alternate name alternate name uses the non-standard name: cancelvaluesandholdattime()safari no support nowebview android full support 57 full support 57 no support ?
... — 56alternate name alternate name uses the non-standard name: cancelvaluesandholdattime()chrome android full support 57 full support 57 no support ?
...And 3 more matches
Drag Operations - Web APIs
instead, the user must hold down the alt key to select text with the mouse, or use the keyboard.
...the feedback image will be generated from whatever the image looks like on screen, although for images, they will be drawn at their original size.
...although the exact keys used vary by platform, typically the shift and control keys would be used to switch between copying, moving, and linking.
...And 3 more matches
KeyboardEvent.getModifierState() - Web APIs
windows linux (gtk) mac android 2.3 android 3.0 or latter "alt" either alt key or altgr key pressed alt key pressed ⌥ option key pressed alt key or option key pressed "altgraph" both alt and ctrl keys are pressed, or altgr key is pressed level 3 shift key (or level 5 shift key ) pressed ⌥ option key pressed not supported "capslock" during led for ⇪ caps lock turned on not supported while capsl...
...ock is locked "control" either ctrl key or altgr key pressed ctrl key pressed control key pressed menu key pressed.
... not supported "scrolllock" during led for scroll lock turned on during led for scroll lock turned on, but typically this isn't supported by platform not supported while scrolllock is locked "shift" ⇧ shift key pressed "super" not supported "symbol" not supported "symbollock" not supported on the other platforms, "alt", "control" and "shift" may be supported.
...And 3 more matches
Key Values - Web APIs
keyboardevent.key value description virtual keycode windows mac linux android "alt" [5] the alt (alternative) key.
... vk_menu (0x12) vk_lmenu (0xa4) vk_rmenu (0xa5) kvk_option (0x3a) kvk_rightoption (0x3d) gdk_key_alt_l (0xffe9) gdk_key_alt_r (0xffea) qt::key_alt (0x01000023) keycode_alt_left (57) keycode_alt_right (58) "altgraph" [5] the altgr or altgraph (alternate graphics) key.
... gdk_key_mode_switch (0xff7e) gdk_key_iso_level3_shift (0xfe03) gdk_key_iso_level3_latch (0xfe04) gdk_key_iso_level3_lock (0xfe05) gdk_key_iso_level5_shift (0xfe11) gdk_key_iso_level5_latch (0xfe12) gdk_key_iso_level5_lock (0xfe13) qt::key_altgr (0x01001103 qt::key_mode_switch (0x0100117e) "capslock" the caps lock key.
...And 3 more matches
PannerNode - Web APIs
while this audioparam cannot be directly changed, its value can be altered using its value property.
...while this audioparam cannot be directly changed, its value can be altered using its value property.
...while this audioparam cannot be directly changed, its value can be altered using its value property.
...And 3 more matches
Web accessibility for seizures and physical reactions - Accessibility
"static or moving patterns of discernable light and dark stripes have the same effect as flashing lights because of the alternation of dark and bright areas." the epilepsy foundation of america working group is able to "quantify" the problem a little.
... although static images are possible as triggers, they are less consistent.
...only a few types of epilepsies are photosensitive though, and the vast majority of epilepsies are not." in addition to seizures brought about by photosensitivity, listening to certain pieces of music can also trigger what are called musicogenic seizures, although these types of seizures seem to be much more rare.
...And 3 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
(see understanding success criterion 1.4.3: contrast) a viewer's distance from the screen, the ambient background, the health of his eyes, and more all affect how that color is received by the viewer.
... how the viewer perceives color after it gets to his eyes is yet another matter, and can be affected by overall health.
... newer technologies, such as opengl and direct3d incorporate support for the srgb gamma curve, although some articles for opengl reference use of rgba rather than srgb.
...And 3 more matches
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
the -moz-force-broken-image-icon extended css property can be used to force the broken image icon to be shown even when a broken image has an alt attribute.
... syntax values <integer> a value of 1 means that the broken image icon is shown even if the image has an alt attribute.
... when the value 0 is used the image will act as usual and only display the alt attribute.
...And 3 more matches
animation-direction - CSS: Cascading Style Sheets
the animation-direction css property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward.
... syntax /* single animation */ animation-direction: normal; animation-direction: reverse; animation-direction: alternate; animation-direction: alternate-reverse; /* multiple animations */ animation-direction: normal, reverse; animation-direction: alternate, reverse, normal; /* global values */ animation-direction: inherit; animation-direction: initial; animation-direction: unset; values normal the animation plays forwards each cycle.
... alternate the animation reverses direction each cycle, with the first iteration being played forwards.
...And 3 more matches
font-variant-position - CSS: Cascading Style Sheets
the font-variant-position css property controls the use of alternate, smaller glyphs that are positioned as superscript or subscript.
... /* keyword values */ font-variant-position: normal; font-variant-position: sub; font-variant-position: super; /* global values */ font-variant-position: inherit; font-variant-position: initial; font-variant-position: unset; when the usage of these alternate glyphs is activated, if one character in the run doesn't have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs.
... these alternate glyphs share the same em-box and the same baseline as the rest of the font.
...And 3 more matches
font-variant - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric syntax font-variant: small-caps; font-variant: common-ligatures small-caps; /* global values */ font-variant: inherit; font-variant: initial; font-variant: unset; values normal specifies a normal font face; each of the longhand properties has an initial value of normal.
... longhand properties of font-variant are: font-variant-caps, font-variant-numeric, font-variant-alternates, font-variant-ligatures, and font-variant-east-asian.
... <common-lig-values>, <discretionary-lig-values>, <historical-lig-values>, <contextual-alt-values> specifies the keywords related to the font-variant-ligatures longhand property.
...And 3 more matches
Video player styling basics - Developer guides
e="0" min="0"> <span id="progress-bar"></span> </progress> </div> <button id="mute" type="button" data-state="mute">mute/unmute</button> <button id="volinc" type="button" data-state="volup">vol+</button> <button id="voldec" type="button" data-state="voldown">vol-</button> <button id="fs" type="button" data-state="go-fullscreen">fullscreen</button> </div> related css alteration the previous article simply set the display property of the video controls to block in order to display them.
... simple :hover and :focus states are then set for each button that simply alters the opacity of the button: .controls button:hover, .controls button:focus { opacity:0.5; } to obtain appropriate button images, a set of free common control set icons was downloaded from the web.
... there are some browser-specific properties that need to be set to ensure that firefox and chrome use the required colour for the progress bar: .controls progress::-moz-progress-bar { background-color:#0095dd; } .controls progress::-webkit-progress-value { background-color:#0095dd; } although the same properties are set to the same value, these rules need to be defined separately, otherwise chrome ignores it.
...And 3 more matches
Browser detection using the user agent - HTTP
there is always the alternative of doing feature detection instead.
...while user agent sniffing can sometimes detect these, not all devices are the same: some mobile devices have big screen sizes, some desktops have a small touchscreen, some people use smart tv's which are an entirely different ballgame altogether, and some people can dynamically change the width and height of their screen by flipping their tablet on its side!
...thankfully, there are much better alternatives.
...And 3 more matches
Details of the object model - JavaScript
similarly, although the terms parent, child, ancestor, and descendant do not have formal meanings in javascript; you can use them informally to refer to objects higher or lower in the prototype chain.
...for example, you can add a specialty property to all employees with the following statement: employee.prototype.specialty = 'none'; as soon as javascript executes this statement, the mark object also has the specialty property with the value of "none".
...for example, assume you have the following statements: function engineer(name, projs, mach) { this.base = workerbee; this.base(name, 'engineering', projs); this.machine = mach || ''; } var jane = new engineer('doe, jane', ['navigator', 'javascript'], 'belau'); employee.prototype.specialty = 'none'; the jane object does not inherit the specialty property.
...And 3 more matches
Web audio codec guide - Web media technologies
of course, these effects can be altered by decisions made while encoding the audio.
... in addition to providing audio for specific speakers in a sound system, some codecs may allow audio channels to be used to provide alternative audio, such as vocals in different languages or descriptive audio for visually impaired people.
... container support amr, 3gpp rtp / webrtc compatible no licensing non-free; license fees and annual royalties apply.
...And 3 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
this is created by all of the css inside the first media query: @media all and (max-width: 1024px) { x-card:nth-child(1), x-card:nth-child(2) { width: 50%; } x-card:nth-child(3) { width: 100%; clear: left; } x-card:nth-child(3) img { width: 20%; } } so here we're altering the widths of the columns and removing the float of the third column (and adding clearing to guard against any float funny business).
... we've also altered the width of the images inside the third container (no longer a column — this is the gallery) so that now you get five per line (it was previously three per line).
...you could use a min-width media query to fix the <body> width at a certain point: @media all and (min-width: 1400px) { body { width: 1400px; margin: 0 auto; } } but it's actually easier to just set the following rule instead, and get rid of the media query altogether: body { max-width: 1400px; margin: 0 auto; } orientation fail we also came across some problems with orientation: the mobile-app layout of our example app is designed for portrait orientation, and looks terrible when viewed on a device in landscape orientation.
...And 3 more matches
Install Manifests - Archive of obsolete content
the version format is different from, although backwards-compatible with, 1.0's.
...alternatively you can place your icon in the directory specified in your content package line.
...alternatively you can place your icon in the directory specified in your content package line.
...And 2 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
note: although there is a specification document, its markup is based on implementations and markup as of 2001, and current xul differs from it in many aspects.
...use the ordinal attribute to alter their order.
... <script type="application/javascript"><![cdata[ var nodes = gbrowser.mtabcontainer.childnodes; for (var i = 0; i < nodes.length; i++) alert(nodes[i].label); ]]></script> listing 18: embedding a script in xul note: although embedding javascript is permitted, it's generally encouraged that you instead place your javascript code in an external file.
...And 2 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
the breakdown: 1 master screen media file which imports 4 files: a base file (bulk of formatting) a file for finance/table formatting color file (override colors and background images for specific color scheme) temp file (used for styles associated with temporary features and ad-related pages) 1 print media file 1 aural media file 3 master alternate style sheets which import 1 file each the 3 imported files set alternate font sizes (small, large, larger) how much did the size of a typical wired news page shrink?
...a few changes to the css can completely alter the presentation of thousands of pages.
...however, since some of our stories are broken up into 2 or 3 pages, we created a slightly altered template for print versions which pulls the entire text of the story into one (web) page.
...And 2 more matches
The Joy of XUL - Archive of obsolete content
these applications are easily customized with alternative text, graphics, and layout so they can be readily branded or localized for various markets.
...the layout and appearance of xul applications can be altered independently of the application definition and logic.
...the netscape public license (npl) and mozilla public license (mpl) require developers who alter original work (source code files that are provided with mozilla) to release the source code for these changes to their customers.
...And 2 more matches
Accessible multimedia - Learn web development
previous overview: accessibility next another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives so they can be understood by assistive technologies and their users.
... simple images we already covered simple text alternatives for html images in our html: a good basis for accessibility article — you can refer back to there for the full details.
... in short, you should ensure that where possible visual content has an alternative text available for screenreaders to pick up and read to their users.
...And 2 more matches
Index - Learn web development
the htmlmediaelement api makes a wealth of functionality available for creating simple video and audio players, and that's only the tip of the iceberg.
... 90 build your own function article, beginner, codingscripting, functions, guide, javascript, learn, tutorial, build, invoke, l10n:priority, parameters with most of the essential theory dealt with in the previous article, this article provides practical experience.
...for example, you can use css to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
...And 2 more matches
Drawing graphics - Learn web development
for example, if you were rendering a constantly updating graph of stock prices, the fallback content could be a static image of the latest stock graph, with alt text saying what the prices are in text.
... optimizing animation of graphics is an entire specialty of programming, with lots of clever techniques available.
... parameters 6 and 7 specify the top-left corner of the box into which to draw the slice on the canvas — the x position is 0 + posx, meaning that we can alter the drawing position by altering the posx value.
...And 2 more matches
Manipulating documents - Learn web development
in this article we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways.
...you can use this object to return and manipulate information on the html and css that comprises the document, for example get a reference to an element in the dom, change its text content, apply new styles to it, create new elements and add them to the current element as children, or even delete it altogether.
...the html source code looks like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p> </section> </body> </html> the dom on the other hand looks like this: note: this dom tree diagram was created using ian hickson's live dom view...
...And 2 more matches
TypeScript support in Svelte - Learn web development
alternatively, you can download the setuptypescript.js file to a scripts folder inside your project's root folder, and then run node scripts/setuptypescript.js.
... to fix it, replace tabindex="-1" with tabindex={-1}, like this: <h2 id="list-heading" bind:this={headingel} tabindex={-1}>{completedtodos} out of {totaltodos} items completed</h2> this way typescript can prevent us from incorrectly assigning it to a string variable.
... set the type of our initialtodos array to todotype[].
...And 2 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
add the following contents to it: <script> export let todos $: totaltodos = todos.length $: completedtodos = todos.filter(todo => todo.completed).length </script> <h2 id="list-heading">{completedtodos} out of {totaltodos} items completed</h2> import the file at the beginning of todos.svelte, adding the following import statement below the others: import todosstatus from './todosstatus.svelte' replace the <h2> status heading inside todos.svelte wit...
...h a call to the todosstatus component, passing todos to it as a prop, like so: <todosstatus {todos} /> you can also do a bit of clean-up, removing the totaltodos and completedtodos variables from todos.svelte.
... just remove the $: totaltodos = ...
...And 2 more matches
Software accessibility: Where are we today?
some examples of these assistive devices and software include: screen reading software, which speaks text displayed on the screen using hardware or software text-to-speech, and which allows a blind person to use the keyboard to simulate mouse actions alternate input devices, which allow people with physical disabilities to use alternatives to a keyboard and mouse voice recognition software, which allows a person to simulate typing on a keyboard or selecting with a mouse by speaking into the computer screen magnification software, which allows a low-vision computer user to more easily read portions of the screen comprehension software, which...
...alternative ways to access the screen's contents most computer programs are so visual, they are difficult or impossible to use for persons with visual impairments.
...unfortunately, the unit is not currently produced, although there is occasional talk of resurrecting this useful device.
...And 2 more matches
Downloads.jsm
alternatively, may be an nsiuri, a downloadsource object, or an object with the following properties: url: string containing the uri for the download source.
...alternatively, may be an nsifile, a downloadtarget object, or an object with the following properties: path: string containing the path of the target file.
...alternatively, may be the serializable representation of a downloadsaver object.
...And 2 more matches
Creating localizable web applications
good: <h1> <?printf("<a href=\"%s\"><img src=\"/static/img/logo.png\" alt=\"" .
...better: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/static/img/logo.png" alt="<?= /* l10n: link title attribute */ _("mozilla labs personas"); ?> " /> </a> </h1> ...but don't sacrifice flexibility don't sacrifice flexibility trying to satisfy the rule above.
...bad: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/static/img/logo.png" alt="<?= _("mozilla labs personas"); ?>" /> </a> </h1> snippet 2.
...And 2 more matches
Interval Timing
nspr defines a platform-dependent type, printervaltime, for timing intervals of fewer than approximately 6 hours.
... this chapter describes printervaltime and the functions that allow you to use it for timing purposes: interval time type and constants interval functions interval time type and constants all timed functions in nspr require a parameter that depicts the amount of time allowed to elapse before the operation is declared failed.
... the type of such arguments is printervaltime.
...And 2 more matches
Parser API
interface ifstatement <: statement { type: "ifstatement"; test: expression; consequent: statement; alternate: statement | null; } an if statement.
... note: the debugger statement is new in ecmascript 5th edition, although spidermonkey has supported it for years.
... interface conditionalexpression <: expression { type: "conditionalexpression"; test: expression; alternate: expression; consequent: expression; } a conditional expression, i.e., a ternary ?/: expression.
...And 2 more matches
How to build a binary XPCOM component using Visual Studio
let’s specify a simple interface: #include "nsisupports.idl" [scriptable, uuid(263ed1ba-5cc1-11db-9673-00e08161165f)] interface ispecialthing : nsisupports { attribute astring name; long add(in long a, in long b); }; remember to generate your own guid.
...they could look like this: h file: #ifndef __specialthing_impl_h__ #define __specialthing_impl_h__ #include "comp.h" #include "nsstringapi.h" #define specialthing_contractid "@starkravingfinkle.org/specialthing;1" #define specialthing_classname "specialthing" #define specialthing_cid { 0x245626, 0x5cc1, 0x11db, { 0x96, 0x73, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } } class cspecialthing : public ispecialthing { public: ns_decl_isupports ns_decl_ispe...
...cialthing cspecialthing(); private: ~cspecialthing(); protected: /* additional members */ nsstring mname; }; #endif cpp file: #include "comp-impl.h" ns_impl_isupports1(cspecialthing, ispecialthing) cspecialthing::cspecialthing() { /* member initializers and constructor code */ mname.assign(l"default name"); } cspecialthing::~cspecialthing() { /* destructor code */ } /* attribute astring name; */ ns_imethodimp cspecialthing::getname(nsastring & aname) { aname.assign(mname); return ns_ok; } ns_imethodimp cspecialthing::setname(const nsastring & aname) { mname.assign(aname); return ns_ok; } /* long add (in long a, in long b); */ ns_imethodimp cspecialthing::add(print32 a, print32 b, print32 *_retval) { *_retval = a + b; return ns_ok; } lastly, we need to create the modul...
...And 2 more matches
nsIDOMEvent
explicitoriginaltarget nsidomeventtarget the explicit original target of the event.
...for example, mouse events are retargeted to their parent node when they happen over text nodes (bug 185889), and in that case .target will show the parent and .explicitoriginaltarget will show the text node.
... .explicitoriginaltarget differs from .originaltarget in that it will never contain anonymous content.
...And 2 more matches
XPIDL
the contents of the parentheses of a native type declaration (although native declarations without parentheses are parsable, i do not trust that they are properly handled by the xpidl handlers) is a string equivalent to the c++ type.
... constants are emitted in header files using anonymous enums, although there is an outstanding patch that combines adjacent constants into the same anonymous enums to quiet enum mismatch warnings.
...attributes named 'iid' and methods named 'getiid' are forbidden, although this is checked before binaryname conversion.
...And 2 more matches
DOMMatrixReadOnly - Web APIs
the dommatrix interrface—which is based upon dommatrixreadonly—adds mutability, allowing you to alter the matrix after creating it.
...none of the following methods alter the original matrix.
...the original matrix is not altered.
...And 2 more matches
SpeechRecognitionResult.item() - Web APIs
the item getter of the speechrecognitionresult interface is a standard getter that allows speechrecognitionalternative objects within the result to be accessed via array syntax.
... syntax var myalternative = speechrecognitionresultinstance[0]; returns a speechrecognitionalternative object.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
...And 2 more matches
SpeechRecognitionResult - Web APIs
the speechrecognitionresult interface of the web speech api represents a single recognition match, which may contain multiple speechrecognitionalternative objects.
... speechrecognitionresult.length read only returns the length of the "array" — the number of speechrecognitionalternative objects contained in the result (also referred to as "n-best alternatives".) methods speechrecognitionresult.item a standard getter that allows speechrecognitionalternative objects within the result to be accessed via array syntax.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
...And 2 more matches
TextRange - Web APIs
WebAPITextRange
although it is well supported by ie, most other browsers no longer support this property.
...alternative selection and range interfaces can be used.
...it can be used as an alternative to element.scrollintoview in the lower version of ie.
...And 2 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
they do not have to be unique, although it is common to number them (e.g., 1, 2, 3, ...).
... example 20 - voice tag <v bob>text</v> interfaces there are two interfaces or apis used in webvtt which are: vttcue interface it is used for providing an interface in document object model api, where different attributes supported by it can be used to prepare and alter the cues in number of ways.
...vertical, horizontal, line, linealign, position, positionalign, text, size and align can be used to alter the cue and its formation, just like we can alter the objects form, shape and visibility in html using css.
...And 2 more matches
Lighting a WebXR setting - Web APIs
flashback: simulating lighting in 3d although this article isn't a comprehensive guide to lighting a 3d scene, it's useful to provide a brief reminder as to how lighting works in general.
... the reflected light ray's color may, of course, be altered in intensity and/or hue due to the light's interaction with the surface, but the angle is always the same.
...ambient light is commonly present simply to prevent shadowed areas from becoming too dark, although it affects the entire scene; however, the amount of ambient light in a scene should be very low.
...And 2 more matches
Web APIs
WebAPI
web apis are typically used with javascript, although this doesn't always have to be the case.
...ushmanager pushmessagedata pushregistrationmanager pushsubscription r rtcansweroptions rtccertificate rtcconfiguration rtcdtmfsender rtcdtmftonechangeevent rtcdatachannel rtcdatachannelevent rtcdtlstransport rtcerror rtcerrorevent rtcicecandidate rtcicecandidateinit rtcicecandidatepair rtcicecandidatepairstats rtcicecandidatestats rtcicecandidatetype rtcicecomponent rtcicecredentialtype rtcicegathererstate rtciceparameters rtciceprotocol rtcicerole rtciceserver rtcicetcpcandidatetype rtcicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferoptions rtcoutboundrtpstreamstats rtcpeerconnection rtcpeerconnectioniceerrorevent rtcpeerconnectioniceevent rtcremoteou...
...ller readablestream readablestreambyobreader readablestreambyobrequest readablestreamdefaultcontroller readablestreamdefaultreader relativeorientationsensor renderingcontext report reportingobserver reportingobserveroptions request requestdestination resizeobserver resizeobserverentry response rsahashedimportparams rsahashedkeygenparams rsaoaepparams rsapssparams s svgaelement svgaltglyphdefelement svgaltglyphelement svgaltglyphitemelement svgangle svganimatecolorelement svganimateelement svganimatemotionelement svganimatetransformelement svganimatedangle svganimatedboolean svganimatedenumeration svganimatedinteger svganimatedlength svganimatedlengthlist svganimatednumber svganimatednumberlist svganimatedpoints svganimatedpreserveaspectratio svganimatedrect svganimate...
...And 2 more matches
ARIA: img role - Accessibility
<div role="img" aria-label="description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> description any set of content that should be consumed as a single image (which could include images, video, audio, code snippets, emojis, or other content) can be identified using role="img".
... you shouldn't count on the alt text of individual elements images for conveying context to assistive technologies; most screenreaders will consider the element with role="img" set on it to be to be like a black box, and not access the individual elements inside it.
... therefore, provide a comprehensive overall descriptive alt text for image, either in the surrounding text, or by using an aria-label attribute, with optional alt attributes for search engines or sighted users to be written to the page should an image fail: <div role="img" aria-label="description of the overall image"> <img src="graphic1.png" alt=""> <img src="graphic2.png"> </div> if you wish to add a caption or label to your image that is visible on the page, you can do using: aria-labelledby when the text is a concise label.
...And 2 more matches
Cognitive accessibility - Accessibility
making your content capable of being understood by the software is a good way to help ensure it can be used by alternate presentational modes.
...solutions include providing users enough additional time to complete tasks or eliminate time constraints altogether.
...the user should be able to postpone or suppress interruptions, except situations involving altering a person to an emergency.
...And 2 more matches
Using CSS animations - CSS: Cascading Style Sheets
animation-direction configures whether or not the animation should alternate direction on each run through the sequence or reset to the start point and repeat itself.
...that’s easily accomplished by setting animation-direction to alternate: p { animation-duration: 3s; animation-name: slidein; animation-iteration-count: infinite; animation-direction: alternate; } and the rest of the code: @keyframes slidein { from { margin-left: 100%; width: 300%; } to { margin-left: 0%; width: 100%; } } <p>the caterpillar and alice looked at each other for some time in silence: at last the caterpillar to...
...as an example, the rule we’ve been using through this article: p { animation-duration: 3s; animation-name: slidein; animation-iteration-count: infinite; animation-direction: alternate; } could be replaced by p { animation: 3s infinite alternate slidein; } note: you can find more details out at the animation reference page: setting multiple animation property values the css animation longhand values can accept multiple values, separated by commas — this feature can be used when you want to apply multiple animations in a single rule, and set separate durations, iteration counts, etc.
...And 2 more matches
font-variant-ligatures - CSS: Cascading Style Sheets
ont-variant-ligatures: discretionary-ligatures; /* <discretionary-lig-values> */ font-variant-ligatures: no-discretionary-ligatures; /* <discretionary-lig-values> */ font-variant-ligatures: historical-ligatures; /* <historical-lig-values> */ font-variant-ligatures: no-historical-ligatures; /* <historical-lig-values> */ font-variant-ligatures: contextual; /* <contextual-alt-values> */ font-variant-ligatures: no-contextual; /* <contextual-alt-values> */ /* global values */ font-variant-ligatures: inherit; font-variant-ligatures: initial; font-variant-ligatures: unset; the font-variant-ligatures property is specified as one of the keyword values listed below.
... <contextual-alt-values> these values control whether letters adapt to their context—that is, whether they adapt to the surrounding letters.
... these values correspond to the opentype values calt.
...And 2 more matches
max-height - CSS: Cascading Style Sheets
css3 sizing.ie no support noopera full support 44safari full support 6.1prefixed full support 6.1prefixed prefixed implemented with the vendor prefix: -webkit- full support 2alternate name alternate name uses the non-standard name: intrinsicwebview android full support 46 full support 46 full support ≤37prefixed prefixed implemented with the vendor prefix: -webkit-chrome android full support ...
...so, the definition of fit-content is simpler than in css3 sizing.opera android full support 43safari ios full support 7prefixed full support 7prefixed prefixed implemented with the vendor prefix: -webkit- full support 1alternate name alternate name uses the non-standard name: intrinsicsamsung internet android full support 5.0 full support 5.0 full support 1.5prefixed prefixed implemented with the vendor prefix: -webkit-max-contentchrome full support ...
...full support 11 full support 11 full support 9prefixed prefixed implemented with the vendor prefix: -webkit-samsung internet android full support 5.0stretch experimentalchrome full support 28alternate name full support 28alternate name alternate name uses the non-standard name: -webkit-fill-availableedge full support 79alternate name full support 79alternate name alternate name uses the non-standard name: -webkit-fill-availablefirefox no...
...And 2 more matches
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
the html <picture> element contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios.
... offering alternative image formats, for cases where certain formats are not supported.
... <picture> <source srcset="mdn-logo-wide.png" media="(min-width: 600px)"> <img src="mdn-logo-narrow.png" alt="mdn"> </picture> the srcset attribute the srcset attribute is used to offer list of possible images based on size.
...And 2 more matches
Evolution of HTTP - HTTP
on august 6th 1991, tim berners-lee's post on the public alt.hypertext newsgroup is now considered as the official start of the world wide web as a public project.
... during the same time, the need for an encrypted transport layer raised: the web left the relative trustiness of a mostly academic network, to a jungle where advertisers, random individuals or criminals compete to get as much private information about people, try to impersonate them or even to replace data transmitted by altered ones.
... in the first half of the 2010s, google demonstrated an alternative way of exchanging data between client and server, by implementing an experimental protocol spdy.
...And 2 more matches
var - JavaScript
'use strict'; var x = 1; globalthis.hasownproperty('x'); // true delete globalthis.x; // typeerror in strict mode.
...this means that properties on the global object are conveniently visible from every scope, without having to qualify the names with globalthis.
... so you can just type: function foo() { string('s') // note the function `string` is implicitly visible } ...because globalthis.hasownproperty('string') // true so the global object will ultimately be searched for unqualified identifiers.
...And 2 more matches
Critical rendering path - Web Performance
the html may request javascript, which may, in turn, alter the dom.
...some requests are blocking, which means the parsing of the rest of the html is halted until the imported asset is handled.
...the more specific tag requires more work from the browser, but this penalty is not likely worth optimizing.
...And 2 more matches
dx - SVG: Scalable Vector Graphics
WebSVGAttributedx
seven elements are using this attribute: <altglyph>, <fedropshadow>, <feoffset>, <glyphref>, <text>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- lines materialized the position of the glyphs --> <line x1="0" x2="100%" y1="50%" y2="50%" /> <line x1="10%" x2="10%" y1="0" y2="100%" /> <line x1="60%" x2="60%" y1="0" y2="100%" /> <!-- some reference text --> <text x="10%" y="50%" fill="grey">svg</text> <!-- the same text with a shift along the x-axis --> <text dx="50%" x="10%" y="50%">svg</text> </svg> line { stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } altglyph warning: as ...
...of svg2 <altglyph> is deprecated and shouldn't be used.
... for <altglyph>, if it contains a single value, dx defines a shift along the x-axis for all alternate glyph.
...And 2 more matches
dy - SVG: Scalable Vector Graphics
WebSVGAttributedy
seven elements utilize this attribute: <altglyph>, <fedropshadow>, <feoffset>, <glyphref>, <text>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- lines materialized the position of the glyphs --> <line x1="10%" x2="10%" y1="0" y2="100%" /> <line x1="0" x2="100%" y1="30%" y2="30%" /> <line x1="0" x2="100%" y1="80%" y2="80%" /> <!-- some reference text --> <text x="10%" y="30%" fill="grey">svg</text> <!-- the same text with a shift along the y-axis --> <text dy="50%" x="10%" y="30%">svg</text> </svg> line { stroke: red; stroke-width: .5px; stroke-dasharray: 3px; } altglyph warning: a...
...s of svg2 <altglyph> is deprecated and shouldn't be used.
... for <altglyph>, if it contains a single value, dy defines a shift along the y-axis for all alternate glyph.
...And 2 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
the writing-mode attribute applies only to <text> elements; the attribute is ignored for <tspan>, <tref>, <altglyph> and <textpath> sub-elements.
... 295 <altglyph> deprecated, element, reference, svg, svg text content the <altglyph> svg element allows sophisticated selection of the glyphs used to render its child character data.
... 296 <altglyphdef> deprecated, element, needsexample, reference, svg, svg text content the <altglyphdef> svg element defines a substitution representation for glyphs.
...And 2 more matches
SDK and XUL Comparison - Archive of obsolete content
compatibility although we can't promise we'll never break a high-level api, maintaining compatibility across firefox versions is a top priority for us.
...although it's possible to write insecure add-ons using the sdk, it's not as easy, and the damage that a compromised add-on can do is usually more limited.
... although you can write traditional add-ons that are restartless, you can't use xul overlays in them, so most traditional add-ons would have to be substantially rewritten anyway.
... alternatively, you can load third-party modules, which extend the sdk's core apis.
hotkeys - Archive of obsolete content
var { hotkey } = require("sdk/hotkeys"); var showhotkey = hotkey({ combo: "accel-shift-o", onpress: function() { showmypanel(); } }); var hidehotkey = hotkey({ combo: "accel-alt-shift-o", onpress: function() { hidemypanel(); } }); choosing hotkeys hotkeys should be chosen with care.
... parameters options : object required options: name type combo string any function key: "f1, f2, ..., f24" or key combination in the format of 'modifier-key': "accel-s" "meta-shift-i" "control-alt-d" all hotkeys require at least one modifier as well as the key.
... alt: the alt key.
...on macintosh this can only be used in conjunction with another modifier, since alt-letter combinations are reserved for entering special characters in text.
HTML to DOM - Archive of obsolete content
although you can now natively parse html using domparser and xmlhttprequest, this is a new feature that is not yet supported by all browsers in use in the wild.
...navigation.allowauth = false; frame.webnavigation.allowimages = false; frame.webnavigation.allowjavascript = false; frame.webnavigation.allowmetaredirects = true; frame.webnavigation.allowplugins = false; frame.webnavigation.allowsubframes = false; // listen for load frame.addeventlistener("load", function (event) { // the document of the html in the dom var doc = event.originaltarget; // skip blank page or frame if (doc.location.href == "about:blank" || doc.defaultview.frameelement) return; // do something with the dom of doc alert(doc.location.href); // when done remove frame or set location "about:blank" settimeout(function (){ var frame = document.getelementbyid("sample-frame"); // remove frame // frame.destroy(); // if u...
... using a hidden xul iframe (alternate example) sometimes, a browser element is overkill, or does not meet your needs, or you can't fulfill its requirements.
...let's take a look at the donkeyfire.donkeybrowser_onpageload() handler: donkeybrowser_onpageload: function(aevent) { var doc = aevent.originaltarget; var url = doc.location.href; if (aevent.originaltarget.nodename == "#document") { // ok, it's a real page, let's do our magic dump("[df] url = "+url+"\n"); var text = doc.evaluate("/html/body/h1",doc,null,xpathresult.string_type,null).stringvalue; dump("[df] text in /html/body/h1 = "+text+"\n"); } }, as you can see, we obtain full access to the dom of the page we loaded in backgr...
On page load - Archive of obsolete content
content"); // browser if(appcontent){ appcontent.addeventlistener("domcontentloaded", myextension.onpageload, true); } var messagepane = document.getelementbyid("messagepane"); // mail if(messagepane){ messagepane.addeventlistener("load", function(event) { myextension.onpageload(event); }, true); } }, onpageload: function(aevent) { var doc = aevent.originaltarget; // doc is document that triggered "onload" event // do something with the loaded page.
... if(doc.location.href.search("forum") > -1) alert("a forum page is loaded"); // add event listener for page unload aevent.originaltarget.defaultview.addeventlistener("unload", function(event){ myextension.onpageunload(event); }, true); }, onpageunload: function(aevent) { // do something } }; current firefox trunk nightlies will fire the onpageload function for not only documents, but xul:images (favicons in tabbrowser).
... if you only want to handle documents, ensure aevent.originaltarget.nodename == "#document" .
... if(gbrowser) gbrowser.addeventlistener("domcontentloaded", this.onpageload, false); }, onpageload: function(aevent) { var doc = aevent.originaltarget; // doc is document that triggered the event var win = doc.defaultview; // win is the window for the doc // test desired conditions and do something // if (doc.nodename != "#document") return; // only documents // if (win != win.top) return; //only top window.
CSS3 - Archive of obsolete content
the choice of alternative font faces using the css font-stretch, font-variant-alternates, font-variant-caps, font-variant-east-asian, font-variant-ligatures, font-variant-numeric, and font-variant-position properties.
... the image() function as a more flexible alternative to url() to define an image from an url.
...alternative syntaxes are tested and often implemented.
...alternative syntaxes are tested and often implemented.
Namespaces - Archive of obsolete content
an uri is any string, although most people choose a url-based uri because urls are an easy way to hope for uniqueness.
... although there's nothing preventing someone else from using the namespace http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul, it's fairly unlikely anyone would choose that accidentally.
...that's why we can write the shorthand <textbox/> instead of <xul:textbox/> in xul (although the latter is just as correct when not using http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul as the default namespace) -- the xul namespace is defined as the default on the topmost element.
... <foo/> the answer is that it's in no namespace, or alternately, it's in the namespace denoted by the empty string: <foo xmlns=""/> this second example is semantically equivalent to the first.
Simple Menu Bars - Archive of obsolete content
although you can create custom menus, any special style rules or non-menu elements that you place on a menu may not be applied.
...although you can, there's rarely a need to disable an entire menu.
...for that reason, you should specify a character that exists in the text (although the key will still work if it doesn't).
... the menu element is normally placed on a menubar, although it does not have to be.
Templates - Archive of obsolete content
however, you can use other elements if you want although they are more useful for specialized cases.
...if you are using your own rdf file as a datasource, the value will usually correspond to the value of an about attribute on an rdf bag, seq or alt element.
...in javascript you can access the builder object with the builder property, although usually you would only need to do this to have the builder regenerate the content in situations where it is not done automatically.
...these elements get displayed, but the template itself is not displayed, although it still exists in the document tree.
key - Archive of obsolete content
ArchiveMozillaXULkey
alt: the alt key.
...on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text.
...on windows, this is the alt key, used in conjuction with an element's accesskey.
...for example: // modify some attributes let key = document.getelementbyid(key_id); key.setattribute("modifiers", "alt shift"); // apply the changes let keyset = document.getelementbyid(keyset_id); keyset.parentnode.appendchild(keyset); ...
What is RSS - Archive of obsolete content
(although rdf-based rss formats exist, namely the deprecated rss 0.90 and rss 1.0.) common uses of rss syndication are for the syndication of news web sites, of blogs, of internet radio, and of internet television.
...(although some were using rss 0.93 and rss 0.94 even though they weren't supposed to.) in september 2002 userland released rss 2.0.
...and although these are each different, they all label themselves as rss 2.0 on the <rss> element.
... so now, at this point, we still have netscape's rss 0.91 (since netscape never deprecated it) although most people don't use it anymore.
Introduction to SSL - Archive of obsolete content
in addition, all data sent over an encrypted ssl connection is protected with a mechanism for detecting tampering-that is, for automatically determining whether the data has been altered in transit.
...although the fourth question is not technically part of the ssl protocol, it is the client's responsibility to support this requirement, which provides some assurance of the server's identity and thus helps protect against a form of security attack known as "man in the middle." an ssl-enabled client goes through these steps to authenticate a server's identity: is today's date within the validit...
...although step 4 is not technically part of the ssl protocol, it provides the only protection against a form of security attack known as "man in the middle." clients must perform this step and must refuse to authenticate the server or establish a connection if the domain names don't match.
...although the fifth question is not part of the ssl protocol, red hat servers can be configured to support this requirement to take advantage of the user's entry in an ldap directory as part of the authentication process.
-ms-accelerator - Archive of obsolete content
when the option to "hide keyboard navigation indicators until i use the alt key" is enabled in the user's display properties, the "n" is not underlined until the user presses the alt key.
... when alt + n is pressed, the <input> element that defines an accesskey attribute value of "n" receives the focus.
...it enables users to hide navigation indicators for menu items and controls until the alt key is pressed.
...the user presses the alt key and holds it while pressing the character to move input focus to the object, and to invoke the default event associated with the object.
Building up a basic demo with A-Frame - Game development
add the <a-animation> element seen below to the <a-box> element as a child, as shown: <a-box color="#0095dd" rotation="20 40 0" position="0 1 0"> <a-animation attribute="rotation" from="20 0 0" to="20 360 0" direction="alternate" dur="4000" repeat="indefinite" easing="ease"> </a-animation> </a-box> as with any other entities, you can define key properties for the animation.
...the animation direction is set to alternate so the animation will be played forward, and then back.
...add the following <a-animation> element to your torus: <a-entity geometry=" primitive: torus; radius: 1; radiustubular: 0.1; segmentstubular: 12;" material=" color: #eaeff2; roughness: 0.1; metalness: 0.5;" rotation="10 0 0" position="-3 1 0"> <a-animation attribute="scale" to="1 0.5 1" direction="alternate" dur="2000" repeat="indefinite" easing="linear"> </a-animation> </a-entity> the attribute we want to animate for the torus is scale.
...by setting the direction to alternate the scale will be animated to 0.5, and then animated back to 1 during 2 seconds.
Desktop mouse and keyboard controls - Game development
e game we can support keyboard input in games built with phaser by enabling the basic cursor keys in the create() function using the createcursorkeys() function: this.cursors = this.input.keyboard.createcursorkeys(); this creates four directional arrow keys for us: this.cursors.left; this.cursors.right; this.cursors.up; this.cursors.down; you can also define the keys on your own and offer an alternative, w a s d control mechanism for example: this.keyleft = this.input.keyboard.addkey(phaser.keycode.a); this.keyright = this.input.keyboard.addkey(phaser.keycode.d); this.keyup = this.input.keyboard.addkey(phaser.keycode.w); this.keydown = this.input.keyboard.addkey(phaser.keycode.s); to support both the cursor and w a s d keys, we need to do this: if(this.cursors.left.isdown || this.keyl...
... we can also offer firing control alternatives.
... we can even define a secret cheat button: this.keycheat = this.input.keyboard.addkey(phaser.keycode.c); and then in the update() function whenever c is pressed we'll do this: if(this.keycheat.isdown) { this.player.health = this.player.maxhealth; } we can set the health of the player to maximum.
... summary ok, we've dealt with touch, keyboard and mouse controls.
2D maze game with device orientation - Game development
let’s define the variables in the create function first: this.timer = 0; // time elapsed in the current level this.totaltimer = 0; // time elapsed in the whole game then, right after that, we can initialize the necessary text objects to display this information to the user: this.timertext = this.game.add.text(15, 15, "time: "+this.timer, this.fontbig); this.totaltimetext = this.game.add.text(120, 30, "total time: "+this.totaltimer, this.fontsmall); we’re defining the top and left positions of the text, the cont...
...this is how the complete updatecounter function looks: updatecounter: function() { this.timer++; this.timertext.settext("time: "+this.timer); this.totaltimetext.settext("total time: "+(this.totaltimer+this.timer)); }, as you can see we’re incrementing the this.timer variable and updating the content of the text objects with the current values on each iteration, so the player sees the elapsed time.
...when the ball overlaps with the hole (instead of colliding), the finishlevel function is executed: finishlevel: function() { if(this.level >= this.maxlevels) { this.totaltimer += this.timer; alert('congratulations, game completed!\ntotal time of play: '+this.totaltimer+' seconds!'); this.game.state.start('mainmenu'); } else { alert('congratulations, level '+this.level+' completed!'); this.totaltimer += this.timer; this.timer = 0; this.level++; this.timertext.settext("time: "+this.timer); this.t...
...otaltimetext.settext("total time: "+this.totaltimer); this.leveltext.settext("level: "+this.level+" / "+this.maxlevels); this.ball.body.x = this.ballstartpos.x; this.ball.body.y = this.ballstartpos.y; this.ball.body.velocity.x = 0; this.ball.body.velocity.y = 0; this.showlevel(); } }, if the current level is equal to the maximum number of levels (in this case 5), then the game is finished — you'll get a congratulations message along with the number of seconds elapsed through the whole game, and a button to press that takes you to the main menu.
WAI-ARIA basics - Learn web development
as an example, you could use aria-labelledby to specify that a key description contained in a <div> is the label for multiple table cells, or you could use it as an alternative to image alt text — specify existing information on the page as an image's alt text, rather than having to repeat it inside the alt attribute.
... you can see an example of this at text alternatives.
...wai-aria doesn't affect webpage structure, the dom, etc., although the attributes can be useful for selecting elements by css.
... dynamic content updates content loaded into the dom can be easily accessed using a screenreader, from textual content to alternative text attached to images.
Responsive design - Learn web development
as more diverse screen sizes became available, the concept of responsive web design (rwd) appeared, a set of practices that allows web pages to alter their layout and appearance to suit different screen widths, resolutions, etc.
...sidebars could be repositioned for the smaller screen, or alternate navigation could be displayed.
...or, acknowledging the smaller size of an image on mobile you might want to show a different image altogether, one which is more easily understood at a small screen size.
...they can be used to tweak any element to make it more usable or attractive at alternate screen sizes.
HTML forms in legacy browsers - Learn web development
it's generally a good idea to not alter the default appearance of form control because altering one css property value may alter some input types but not others.
...if you alter a property, that may impact the appearance of the widget in unexpected ways.
...and, if you must alter the default styles of your form widgets, define a style guide to ensure consistency among all your form controls so user experience is not destroyed.
...the basic premise is to consider whether altering the default implemenation is worth the work before embarking on the challenge.
How to build custom form controls - Learn web development
this is achieved with alt + down on windows.
... an alternative approach: using radio buttons in the above example, we reinvented a <select> element using non-semantic html, css, and javascript.
...before creating your own customized control, consider whether html provides alternative elements that can be used to adequately support your requirements.
... here are a few libraries you should consider before coding your own: jquery ui axe accessible custom select dropdowns msdropdown nice forms if you do create alternative controls via radio buttons, your own javascript, or with a 3rd party library, ensure it is accessible and feature-proof; that is, it needs to be able to work better with a variety of browsers whose compatibility with the web standards they use vary.
Document and website structure - Learn web development
per consectetur sagittis, nisi diam iaculis velit, is fringille sem nunc vet mi.</p> </article> <!-- the aside content can also be nested within the main content --> <aside> <h2>related</h2> <ul> <li><a href="#">oh i do like to be beside the seaside</a></li> <li><a href="#">oh i do like to be beside the sea</a></li> <li><a href="#">although in the north of england</a></li> <li><a href="#">it never stops raining</a></li> <li><a href="#">oh well...</a></li> </ul> </aside> </main> <!-- and here is our main footer that is used across all the pages of our website --> <footer> <p>©copyright 2050 by nobody.
...for example, imagine a shopping cart widget that you could choose to pull up at any point during your time on an e-commerce site: <div class="shopping-cart"> <h2>shopping cart</h2> <ul> <li> <p><a href=""><strong>silver earrings</strong></a>: $99.95.</p> <img src="../products/3333-0985/thumb.png" alt="silver earrings"> </li> <li> ...
...scared, but determined to protect his friends, he raised his wand and prepared to do battle, hoping that his distress call had made it through.</p> <hr> <p>meanwhile, harry was sitting at home, staring at his royalty statement and pondering when the next spin off series would come out, when an enchanted distress letter flew through his window and landed in his lap.
...the homepage will probably be in the center, and link to most if not all of the others; most of the pages in a small site should be available from the main navigation, although there are exceptions.
Command line crash course - Learn web development
although there's a great wealth of tools available from the command line, if you're using tools like visual studio code there's also a mass of extensions that can be used as a proxy to using terminal commands without needing to use the terminal directly.
... three redirects happening before we reach the final page: curl /docs/web/api/fetch -l -i | grep location your output should look something like this (curl will first output some download counters and suchlike): location: /docs/web/api/fetch location: /docs/web/api/globalfetch/globalfetch.fetch() location: /docs/web/api/globalfetch/fetch location: /docs/web/api/windoworworkerglobalscope/fetch although contrived, we could take this result a little further and transform the location: line contents, adding the base origin to the start of each one so that we get complete urls printed out.
... although we'll look at a number of different tools in the next article onwards, we'll cut our teeth on prettier.
... always the same version feels like any other unix command although the cons list is shorter, the negative impact of global installing is potentially much larger than the benefits.
Accessibility Features in Firefox
tabbed browsing helps keyboard users by putting all of the browsed documents in one firefox application window rather than cluttering the alt+tab order which makes keyboard navigation within the entire windows os much simpler.
...custom searches can be added to this quick search bar and the user can switch between them by choosing from a drop down available via the standard alt+down arrow key combination.
... moving back and forward by web page (alt+left and alt+right) occurs near-instantaneously the download manager provides keyboard access to all of your recent downloads operating system "look and feel" support: mozilla's default skin will match the colors and sizes currently being used in your desktop.
... here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this information): adblock plus removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior.
CSUN Firefox Materials
tabbed browsing helps keyboard users by putting all of the browsed documents in one firefox application window rather than cluttering the alt+tab order which makes keyboard navigation within the entire windows os much simpler.
...custom searches can be added to this quick search bar and the user can switch between them by choosing from a drop down available via the standard alt+down arrow key combination.
...-- all with the keyboard moving back and forward by web page (alt+left and alt+right) occurs near-instantaneously the download manager provides keyboard access to all of your recent downloads customize your experience!
...here are some examples of accessible extensions, although there are hundreds more to try (thank you to the gw micro knowledge base for some of this information): adblock plus removes ads (and other objects, like banners) from web pages greasemonkey lets you add bits of javascript ("user scripts") to any web page to change its behavior.
Theme concepts
these theme options can be implemented as static themes (although the theme images themselves may be animated) or as dynamic themes created in a browser extension.
... multiple image themes as an alternative to creating a single image theme, you have the option to use multiple images.
... alternatively, you can use multiple images, say combining the original weta image with this one anchored to the left of the header to create this effect where the images are specified with: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta.png", "weta-left.png"] }, and their alignment by: "properties": { "additional_backgrounds_alignment": [ "right top" , "left ...
... if you are uploading a packaged file, the version number must be higher than the current version number dynamic themes as an alternative to defining a static theme, you can use the theme api to control the theme used in firefox from within a browser extension.
Eclipse CDT
system requirements eclipse will use a lot of memory to fully index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after indexing is complete).
...the alternative is to leave that option disabled and update the index manually as necessary.
...although eclipse doesn't do fuzzy matching when you type a file name, it does allow you to use wildcards.
...alternately, you can jump to the definition of the symbol under the cursor by pressing f3.
Obsolete Build Caveats and Tips
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...alternatively you can install the command-line compiler as part of the windows 7 sdk, but you are then expected to use the included windbg debugger.
... if you do not specify a moz_objdir it will be automatically set to @topsrcdir@/obj-@config_guess@ alternatively, you can run client.mk directly from your objdir, using make -f <path_to_srcdir>/client.mk.
Storage access policy: Block cookies from trackers
this policy is designed as an alternative to the older cookie policies, which have been available in firefox for many years.
...alternatively you can report broken sites directly in firefox by clicking "report a problem" in the content blocking section of the control center (this shortcut may not be available in all versions of firefox).
... browser caches: the http cache, the image cache, and the alternative services (alt-svc) cache are all partitioned for tracking resources, such that each top-level origin will have a separate partition and tracking resources on different top-level origins will be cached separate from each other.
...although both of these approaches provide the same level of storage access, we recommend third parties switch to using the storage access api in order to guarantee their access to storage.
Application Translation with Mercurial
a comparison of alternatives (e.g.
... you installed scrapbook earlier, now open it in firefox either by calling it from the firefox menu bar (press the alt key to show it if necessary) using "view" > "sidebar" > "scrapbook" or by clicking its toolbar button which you likely have to add by toolbar customization if you didn't do this before.
... proof-reading and altering the patch now proof-read the patch.
...if the person requests changes, follow the instructions under proof-reading and altering the patch.
Localization and Plurals
plural rule #0 (1 form) families: asian (chinese, japanese, korean), persian, turkic/altaic (turkish), thai, lao everything: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, … plural rule #1 (2 forms) families: germanic (danish, dutch, english, faroese, frisian, german, norwegian, swedish), finno-ugric (estonian, finnish, hungarian), langua...
..., 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, … plural rule #2 (2 forms) families: romanic (french, brazilian portuguese), lingala is 0 or 1: 0, 1 everything else: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, … plural rule #3 (3 forms) families: baltic (latvian, latgalian) ends in 0: 0 ends in 1, excluding 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, … everything else: 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, … plural rule #4 (4 fo...
... 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, … everything else: 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, … plural rule #6 (3 forms) families: baltic (lithuanian) ends in 1, excluding 11: 1, 21, 31, 41, 51, 61, 71, 81, 91, 101, 121, 131, 141, 151, 161, 171, 181, 191, 201, 221, 231, 241, 251, 261, 271, 281, 291, … ends in 0 or ends in 11-19: 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 211, 212, 213, 214, ...
...09, 210, … everything else but is 0 and ends in 00-02, excluding 0-2: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, … ends in 00-02, excluding 0-2: 100, 101, 102, 200, 201, 202, … is 0: 0 plural rule #13 (4 forms) families: semitic (maltese) is 1: 1 is 0 or ends in 01-10, excluding 1: 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, … ends in 11-19: 11, 12, 13, 14, 15, 16, 17, 18, 19, 111, 112, 113, 114, 115, 116, 117, 118, 119, 211, 212, 213, 214, 215, 216, 217, 218, 219, … everything else: 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32...
Mozilla Style System Documentation
see also the style techtalk for more complete although less detailed documentation.
... style context management a style context (class nsstylecontext, currently also interface nsistylecontext although the interface should go away when all of the style systems can be moved back into the layout dll) represents the style data for a css formatting object.
... in the layout system, these formatting objects are described as frames (interface nsiframe), although a pair of frames represents table formatting objects.
...i'm reluctant to write it both since i don't know much about it.] problems:a bunch the code needs to be rewritten to prevent stylesheets from blocking the parser and to reduce string copying (although that partly goes with parsing).] parsing stylesheet representation problems: the stylesheet representation uses way too much memory.
NSS 3.37 release notes
starting with nss version 3.31, an alternative implementation for rng seeding on the linux/unix platform was available (bug 1346735), which performed seeding exclusively based on /dev/urandom.
... this alternative implementation is selected at build time by defining the seed_only_dev_urandom symbol.
... (the classic implementation for rng seeding on the linux/unix platform, which may use additional sources for the default seeding, is still available and will be used if seed_only_dev_urandom is undefined.) with nss 3.37, this alternative implementation for linux/unix can be selected in "make" builds by defining the environment variable nss_seed_only_dev_urandom.
... with nss 3.37, this alternative implementation for linux has been enhanced to use the glibc function getentropy(), instead of reading from /dev/urandom directly, if the build and runtime linux platform supports it.
sslfnc.html
ssl_enable_fdx tells the ssl library whether the application will have two threads, one reading and one writing, or just one thread doing reads and writes alternately.
...however, most application protocols that use ssl are not two-way simultaneous, but two-way alternate, also known as "half dupled"; that is, each end takes turns sending, and each end is either sending, or receiving, but not both at the same time.
... the ssl_enable_fdx option tells the ssl library whether the application will have two threads, one reading and one writing, or just one thread doing reads and writes alternately.
... ssl_enable_fdx tells the ssl library whether the application will have two threads, one reading and one writing, or just one thread doing reads and writes alternately.
Index
188 js_aliaselement jsapi reference, obsolete, spidermonkey js_aliaselement assigns an alternate index number for an element or numeric property associated with a native object.
...name is the element's current index in the object, and alias is the alternate index to assign to the element.
... 189 js_aliasproperty jsapi reference, obsolete, spidermonkey js_aliasproperty assigns an alternate name for a property associated with a native object.
...name is the property's current name in the object, and alias is the alternate name to assign to the property.
A Web PKI x509 certificate primer
subject alternate name this extension defines what other names (such as dns names) are valid for this certificate.
...write extensions file by creating a new file with name openssl.ss.cnf with the following contents: basicconstraints = ca:false subjectaltname =dns:www.example.com extendedkeyusage =serverauth 4.
... write extensions file (make a new file with name openssl.ss.cnf with the following contents) basicconstraints = ca:false subjectaltname =dns:www.example.com extendedkeyusage =serverauth authorityinfoaccess = ocsp;uri:http://ocsp.example.com:80/ intermediate signs the csr (using sha256) and appends the extensions described in the file "openssl x509 -req -sha256 -days 1096 -in example.csr -cakey intkey.pem -ca int.pem -set_serial $some_large_integer -out www.example.com.pem -extfile openssl.int.cnf" sec...
...ertificate is improperly formatted or the certificate has been tampered with re-issue the certificate with the bad signature sec_error_cert_bad_access_location the ocsp uri in the authorityinformationaccess extension is improperly formed re-generate the certificate with a well-formed ocsp uri sec_error_cert_not_in_name_space a certificate has a common name or subject alternative name that is not in the namespace of an issuing certificate re-issue the certificate with names that are within the namespace of all certificates in the chain sec_error_cert_signature_algorithm_disabled a certificate has been signed with an obsolete algorithm re-sign the certificate using a modern algorithm sec_error_expired_certificate a certificate is too o...
nsIDBFolderInfo
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIDOMGeoPositionCoords
altitude double the user's current altitude, in meters.
... zero if the device doesn't support altitude detection.
... altitudeaccuracy double the accuracy of altitude information, in meters.
... zero if the device doesn't support altitude detection.
All keyboard shortcuts - Firefox Developer Tools
f7 * shift + f7 open profiler shift + f5 shift + f5 * shift + f5 open network monitor 2 ctrl + shift + e cmd + opt + e ctrl + shift + e toggle responsive design mode ctrl + shift + m cmd + opt + m ctrl + shift + m open browser console ctrl + shift + j cmd + shift + j ctrl + shift + j open browser toolbox ctrl + alt + shift + i cmd + opt + shift + i ctrl + alt + shift + i open scratchpad shift + f4 shift + f4 * shift + f4 open webide shift + f8 shift + f8 * shift + f8 storage inspector shift + f9 shift + f9 * shift + f9 open debugger 3 ctrl + shift + z cmd + opt + z ctrl + shift + z 1.
...md + x ctrl + x copy ctrl + c cmd + c ctrl + c paste ctrl + v cmd + v ctrl + v undo ctrl + z cmd + z ctrl + z redo ctrl + shift + z / ctrl + y cmd + shift + z / cmd + y ctrl + shift + z / ctrl + y indent tab tab tab unindent shift + tab shift + tab shift + tab move line(s) up alt + up alt + up alt + up move line(s) down alt + down alt + down alt + down comment/uncomment line(s) ctrl + / cmd + / ctrl + / page inspector command windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active.
...page up shift + page up shift + page up decrement selected value by 100 shift + page down shift + page down shift + page down increment selected value by 10 shift + up arrow shift + up arrow shift + up arrow decrement selected value by 10 shift + down arrow shift + down arrow shift + down arrow increment selected value by 0.1 alt + up arrow (ctrl + up arrow from firefox 60 onwards.) alt + up arrow alt + up arrow (ctrl + up arrow from firefox 60 onwards.) decrement selected value by 0.1 alt + down arrow (ctrl + down arrow from firefox 60 onwards).
... alt + down arrow alt + down arrow (ctrl + down arrow from firefox 60 onwards).
EffectTiming.direction - Web APIs
syntax var timingproperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; timingproperties.direction = "normal" | "reverse" | "alternate" | "alternate-reverse"; value a domstring which specifies the direction in which the animation should play as well as what to do when the playback reaches the end of the animation sequence in the current direction.
... "reverse" the animation runs backwards, or "rewinds." "alternate" the animation switches direction after each iteration, going forward through the animation sequence the first iteration, then backward through the sequence the second iteration, and so forth.
... "alternate-reverse" similar to "alternate", except the animation playback starts by going from the end of the animation sequence toward the beginning the first iteration, then goes forward during the second, and so forth.
... examples in the forgotten key example, alice waves her arm up and down by passing her an alternate value for her direction property: // get alice's arm, and wave it up and down document.getelementbyid("alice_arm").animate([ { transform: 'rotate(10deg)' }, { transform: 'rotate(-40deg)' } ], { easing: 'steps(2, end)', iterations: infinity, direction: 'alternate', duration: 600 }); specifications specification status comment web animationsthe definition of 'direction' in that specification.
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
see the alternatives to fill modes section below for approaches that are simpler and more performant.
...as defined above, the "none" fill mode means that the element will be rendered in its natural, unaltered condition anytime the animation isn't actively running.
...var rabbitdownkeyframes = new keyframeeffect( whiterabbit, [ { transform: 'translatey(0%)' }, { transform: 'translatey(100%)' } ], { duration: 3000, fill: 'forwards' } ); // set up the rabbit's animation to play on command by calling rabbitdownanimation.play() later var rabbitdownanimation = new animation(rabbitdownkeyframes, document.timeline); alternatives to fill modes fill modes are primarily provided as a means of representing the animation-fill-mode feature of css animations.
... rather than using fill modes to persist an animation, it is often simpler to set the final value of the animation effect directly in specified style: elem.animate({ transform: 'translatey(100px)' }, 200).finished.then(() => { elem.style.transform = 'translatey(100px)'; }); alternatively, it may be simpler still to set the final value in specified style before triggering the animation and then animate from the start value.
EventTarget.addEventListener() - Web APIs
the alternative, older way to register event listeners, is described below.
... const mybutton = document.getelementbyid('my-button-id'); const somestring = 'data'; mybutton.addeventlistener('click', function() { console.log(somestring); // expected value: 'data' somestring = 'data again'; }); console.log(somestring); // expected value: 'data' (will never output 'data again') note: although inner scopes have access to const, let variables from outer scopes, you cannot expect any changes to these variables to be accessible after the event listener definition, within the same outer scope.
... note: usecapture is not supported, as ie 8 does not have any alternative method.
... note: see the compatibility table below if you need to know which browsers (and/or which versions of those browsers) implement this altered behavior.
HkdfParams - Web APIs
this may be one of: sha-1 sha-256 sha-384 sha-512 salt a buffersource.
... the hkdf specification states that adding salt "adds significantly to the strength of hkdf".
... ideally, the salt is a random or pseudo-random value with the same length as the output of the digest function.
... unlike the input key material passed into derivekey(), salt does not need to be kept secret.
KeyboardEvent - Web APIs
keyboard events may not be fired if the user is using an alternate means of entering text, such as a handwriting system on a tablet or graphics tablet.
... examples include the right shift key and the right alt key (option on a mac keyboard).
... keyboardevent.altkey read only returns a boolean that is true if the alt ( option or ⌥ on os x) key was active when the key event was generated.
... keyboardevent.getmodifierstate() returns a boolean indicating if a modifier key such as alt, shift, ctrl, or meta, was pressed when the event was created.
Sensor APIs - Web APIs
sensor apis concepts and usage although the generic sensor api specification defines a sensor interface, as a web developer you will never use it.
...alternatively, the absoluteorientationsensor interface provides information that is algorithmically agregated from two or more device sensors.
...the latter type of sensor is also called a fusion sensor (alternatively, virtual or synthetic sensors).
...}); an alternative approach is to attempt to use the error and listen for the securityerror.
SpeechRecognitionResult.length - Web APIs
the length read-only property of the speechrecognitionresult interface returns the length of the "array" — the number of speechrecognitionalternative objects contained in the result (also referred to as "n-best alternatives".) the number of alternatives contained in the result depends on what the speechrecognition.maxalternatives property was set to when the speech recognition was first initiated.
... // each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log(event.results[0].length); } specifications specification status comment web speech apithe definition of 'length' in that specification.
USBEndpoint - Web APIs
constructor usbendpoint.usbendpoint creates a new usbendpoint object which will be populated with information about the endpoint on the provided usbaltenateinterface with the given endpoint number and transfer direction.
... let inendpoint = undefined; let outendpoint = undefined; for (const interface of device.configuration.interfaces) { // only support devices with out multiple alternate interfaces.
... const alternate = interface.alternates[0]; // identify the interface implementing the usb cdc class.
... const usb_cdc_class = 10; if (alternate.interfaceclass != usb_cdc_class) { continue; } for (const endpoint of alternate.endpoints) { // identify the bulk transfer endpoints.
USBInterface - Web APIs
usbinterface.alternateread only returns the currently selected alternative configuration of this interface.
... by default this is the usbalternateinterface from alternates with alternatesetting equal to 0.
... it can be changed by calling usbdevice.selectalternateinterface() with any other value found in alternates.
... usbinterface.alternatesread only returns an array containing instances of the usbalternateinterface interface describing each of the alternative configurations possible for this interface.
Basic concepts behind Web Audio API - Web APIs
although, you don't have to provide a destination if you, say, just want to visualize some audio data.
... here's a couple of simple examples: var context = new audiocontext(); var buffer = context.createbuffer(2, 22050, 44100); note: in digital audio, 44,100 hz (alternately represented as 44.1 khz) is a common sampling frequency.
... the alternative is to use an interleaved buffer format: lrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlr (for a buffer of 16 frames) this format is very common for storing and playing back audio without much processing, for example a decoded mp3 stream.
...the web audio api has an analysernode available that doesn't alter the audio signal passing through it.
WindowOrWorkerGlobalScope.setInterval() - Web APIs
console.log(a); console.log(b); } example 2: alternating two colors the following example calls the flashtext() function once a second until the stop button is pressed.
...function () { vcallback.apply(null, aargs); } : vcallback, ndelay); }; window.setinterval.ispolyfill = true; } another possibility is to use an anonymous function to call your callback, although this solution is a bit more expensive.
...it also offers an alternative way to pass the this object to the callback function (see the "this" problem for details).
... browsers may enforce even more stringent minimum values for the interval under some circumstances, although these should not be common.
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
and what are they recommending for an alternative, a proprietary solution?
...zoomtext and dragon can get by with your msaa support., and jaws can be scripted (even by external developers) to support alternative interfaces.
... get_acckeyboardshortcut: what is the keyboard shortcut for this iaccessible (underlined alt+combo mnemonic) get_accfocus: which child is focused?
... the msaa tree and the dom tree are parallel structures, although the msaa tree is a subset of the dom tree.
<color> - CSS: Cascading Style Sheets
note: although <color> values are precisely defined, their actual appearance may vary (sometimes significantly) from device to device.
...although the names more or less describes their respective colors, they are essentially artificial, without a strict rationale behind the names used.
... although various colors not in the specification (mostly adapted from the x11 colors list) were supported by early browsers, it wasn't until svg 1.0 and css colors level 3 that they were formally defined.
...or alpha */ hsla(240 100% 50% / 5%) /* 5% opaque blue */ specifications specification status comment css color module level 4 working draft adds rebeccapurple, four- (#rgba) and eight-digit (#rrggbbaa) hexadecimal notations, rgba() and hsla() as aliases of rgb() and hsl() (both with identical parameter syntax), space-separated function parameters as an alternative to commas, percentages for alpha values, and angles for the hue component in hsl() colors.
Cross-browser audio basics - Developer guides
alternatively, you can include the src attribute directly on the <audio> element to specify a single source file.
...</audio> fallbacks although the vast majority of browsers now support the <audio> element, you may want to cater for those that don't, such as ie<9.
...</audio> you can grab the <audio> element like this: var myaudio = document.getelementbyid('my-audio'); alternatively, you can create a new element.
... waiting the waiting event is triggered when playback has stopped due to lack of media data, although it is expected to resume once data becomes available.
Audio and Video Delivery - Developer guides
currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast.
... note: currently safari does not support dash although dash.js will work on newer versions of safari scheduled for release with osx yosemite.
...the media server is not delivering the correct mime types with the file although this is usually supported, you may need to add the following to your media server's .htaccess file.
...then you can replace the video with its fallback content: <video controls> <source src="dynamicsearch.mp4" type="video/mp4"></source> <a href="dynamicsearch.mp4"> <img src="dynamicsearch.jpg" alt="dynamic app search in firefox os"> </a> <p>click image to play a video demo of dynamic app search</p> </video> var v = document.queryselector('video'), sources = v.queryselectorall('source'), lastsource = sources[sources.length-1]; lastsource.addeventlistener('error', function(ev) { var d = document.createelement('div'); d.innerhtml = v.innerhtml; v.parentnode.replacechild(d...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
let's look at this from two sides: using color within a stylesheet, and adding and changing color using javascript code to alter the styles of elements.
...although historically it's been necessary to implement your own color picker, html now provides support for browsers to provide one for your use through the <input> element, by using "color" as the value of its type attribute.
... for more information about color blindness, see the following articles: medline plus: color blindness (united states national institute of health) american academy of ophthamology: what is color blindness?
... color blindness & web design (usability.gov: united states department of health and human services) palette design example let's consider a quick example of selecting an appropriate color palette for a site.
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
WebHTMLElementpre
example html <p>using css to change the font color is easy.</p> <pre> body { color: red; } </pre> result accessibility concerns it is important to provide an alternate description for any images or diagrams created using preformatted text.
... the alternate description should clearly and concisely describe the image or diagram's content.
... a combination of the <figure> and <figcaption> elements, supplemented by a combination of an id and the aria role and aria-labelledby attributes allow the preformatted text to be announced as an image, with the figcaption serving as the image's alternate description.
... </figcaption> </figure> mdn understanding wcag, guideline 1.1 explanations h86: providing text alternatives for ascii art, emoticons, and leetspeak | w3c techniques for wcag 2.0 specifications specification status comment html living standardthe definition of '<pre>' in that specification.
Index - HTTP
WebHTTPHeadersIndex
17 alt-svc draft, http, http header, needscompattable, needscontent, needsexample, reference the alt-svc header is used to list alternate ways to reach this website.
... 26 content-location http, reference, header the content-location header indicates an alternate location for the returned data.
... 74 forwarded http, http header, reference, request header, header the forwarded header contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request.
...although these protections are largely unnecessary in modern browsers when sites implement a strong content-security-policy that disables the use of inline javascript ('unsafe-inline'), they can still provide protections for users of older web browsers that don't yet support csp.
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
deprecated syntax var object = { a: 10, b: 20 }; for each (var x in object) { console.log(x); // 10 // 20 } alternative standard syntax you can now use the standard for...in loop to iterate over specified object keys, and get each value inside the loop: var object = { a: 10, b: 20 }; for (var key in object) { var x = object[key]; console.log(x); // 10 // 20 } or, using for...of (es2015) and object.values (es2017), you can get an array of the specified object values ...
... deprecated syntax var array = [10, 20, 30]; for each (var x in array) { console.log(x); // 10 // 20 // 30 } alternative standard syntax this is now possible with for...of (es2015) loops as well.
... deprecated syntax function func(array) { for each (var x in array) { console.log(x); } } func([10, 20]); // 10 // 20 func(null); // prints nothing func(undefined); // prints nothing alternative standard syntax to rewrite for each...in statements so that values can be null or undefined with for...of as well, you need to guard around for...of.
... var object = { a: 10, b: 20 }; for each (var [key, value] in iterator(object)) { console.log(key, value); // "a", 10 // "b", 20 } alternative standard syntax you can now use the standard for...in loop to iterate over specified object keys, and get each value inside the loop: var object = { a: 10, b: 20 }; for (var key in object) { var value = object[key]; console.log(key, value); // "a", 10 // "b", 20 } or, using for...of (es2015) and object.entries (es2017), you can get an array of the spe...
Arrow function expressions - JavaScript
an arrow function expression is a syntactically compact alternative to a regular function expression, although without its own bindings to the this, arguments, super, or new.target keywords.
... that.age++; }, 1000); } alternatively, a bound function could be created so that a preassigned this value would be passed to the bound target function (the growup() function in the example above).
...arguments[0] is n return f(); } foo(3); // 6 in most cases, using rest parameters is a good alternative to using an arguments object.
... var func = (a, b, c) => 1; var func = (a, b, c) => ( 1 ); var func = (a, b, c) => { return 1 }; var func = ( a, b, c ) => 1; // no syntaxerror thrown parsing order although the arrow in an arrow function is not an operator, arrow functions have special parsing rules that interact differently with operator precedence compared to regular functions.
Object - JavaScript
description nearly all objects in javascript are instances of object; a typical object inherits properties (including methods) from object.prototype, although these properties may be shadowed (a.k.a.
...by object.create(null)), or it may be altered so that this is no longer true (e.g.
...this provides a very powerful although potentially dangerous mechanism to override or extend object behavior.
...pes the following examples store an empty object object in o: let o = new object() let o = new object(undefined) let o = new object(null) using object to create boolean objects the following examples store boolean objects in o: // equivalent to o = new boolean(true) let o = new object(true) // equivalent to o = new boolean(false) let o = new object(boolean()) object prototypes when altering the behavior of existing object.prototype methods, consider injecting code by wrapping your extension before or after the existing logic.
Authoring MathML - MathML
ment (you may replace mspace with mpadded): function hasmathmlsupport() { var div = document.createelement("div"), box; div.innerhtml = "<math><mspace height='23px' width='77px'/></math>"; document.body.appendchild(div); box = div.firstchild.firstchild.getboundingclientrect(); document.body.removechild(div); return math.abs(box.height - 23) <= 1 && math.abs(box.width - 77) <= 1; } alternatively, the following ua string sniffing will allow to detect the rendering engines with native mathml support (gecko and webkit).
...alternatively, you can use the more traditional javascript parsing of expressions at load time as all the other tools in this section do.
... command-line programs an alternative way is to parse the simple syntax before publishing your web pages.
...alternatively, you can extract the odf file (which is actually a zip archive) and open an xml file called content.xml.
x - SVG: Scalable Vector Graphics
WebSVGAttributex
thirty seven elements are using this attribute: <altglyph>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fefunca>, <fefuncb>, <fefuncg>, <fefuncr>, <fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fepointlight>, <fespecularlighting>, <fespotlight>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <glyphref>, <image>, <mask>, <pattern>, <rect>, <svg>, <text>, <tref>, <tspan>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <rect x="20" y="20" width="60" height="60" /> <rect x="120" y="20" width="60" height=...
..."60" /> <rect x="220" y="20" width="60" height="60" /> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used.
... for <altglyph>, x defines the x-axis coordinate of the alternate glyph.
... recommendation initial definition for <altglyph> scalable vector graphics (svg) 1.1 (second edition)the definition of 'x' in that specification.
y - SVG: Scalable Vector Graphics
WebSVGAttributey
thirty seven elements are using this attribute: <altglyph>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fefunca>, <fefuncb>, <fefuncg>, <fefuncr>, <fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorphology>, <feoffset>, <fepointlight>, <fespecularlighting>, <fespotlight>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <glyphref>, <image>, <mask>, <pattern>, <rect>, <svg>, <text>, <tref>, <tspan>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <rect y="20" x="20" width="60" height="60" /> <rect y="120" x="20" width="60" height=...
..."60" /> <rect y="220" x="20" width="60" height="60" /> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used.
... for <altglyph>, y defines the y-axis coordinate of the alternate glyph.
... recommendation initial definition for <altglyph> scalable vector graphics (svg) 1.1 (second edition)the definition of 'y' in that specification.
platform/xpcom - Archive of obsolete content
this will typically return a descendant of unknown, although it may return a custom object that satisfies the nsisupports interface.
... initializes pending in initialize() adds our implementation of the nsirequest interface although request also implements nsisupports, there is no need to add it here, because the base class unknown declares support for nsisupports and this is accounted for when retrieving objects.
...to register a factory for a component, construct a factory, giving it: a constructor for the component a contract id and/or a class id // create and register the factory var factory = factory({ contract: '@me.org/mycomponent', component: mycomponent }); the component constructor typically returns a descendant of unknown, although it may return a custom object that satisfies the nsisupports interface.
jpm - Archive of obsolete content
add the following line to the end of the file $home/.profile to add it to your path permanently (as the file .profile is executed every time a new terminal is opened): export path="$home/node_modules/.bin/:$path" installing jpm from git alternatively, you can also get the latest version of jpm using git: git clone https://github.com/mozilla-jetpack/jpm.git cd jpm npm install npm link after installing jpm after installation, at the command prompt, type: jpm you should see a screen summarizing the available jpm commands.
... you can sign an xpi you've already generated by passing the xpi file in the --xpi argument, like this: jpm sign --api-key ${jwt_issuer} --api-secret ${jwt_secret} --xpi <xpi file> alternatively, you can omit the --xpi argument, in which case jpm sign will generate an xpi from the current directory (or --addon-dir).
...an alternative development model is to use the extension auto-installer add-on: this listens for new xpi files on a specified port and installs them automatically.
Miscellaneous - Archive of obsolete content
ipt type="text/javascript"> var elm = document.getelementbyid("scrollarea"); elm.addeventlistener("dommousescroll", function scroll(event){ //event.detail is positive for a downward scroll, negative for an upward scroll alert("scrolling " + event.detail + " lines"); }, false); </script> if you do not receive a dommousescroll event while holding any of the modifier keys (ctrl,shift,alt,meta) you should check the mousewheel.withcontrolkey.action and related preferences.
... addeventlistener("blur", function(e) {onblurinput(e);}, false); } } function onfocusinput(focusevent) { focusedcontrol = focusevent.originaltarget; } function onblurinput(blurevent) { focusedcontrol = null; } or var element = document.commanddispatcher.focusedelement; inserting text at the cursor function inserttext(element, snippet) { var selectionend = element.selectionstart + snippet.length; var currentvalue = element.value; var beforetext = currentvalue.substring(0, element.selectionstart); var aftertext = current...
...n = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: function(msg) { return this._bundle.getstringfromname(msg); } }; alert(common.getlocalizedmessage("invalid.url")) another similar alternative (using both getstringfromname and formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.prototype.slice.call(arguments,...
JavaScript Object Management - Archive of obsolete content
notice the way we send callback functions as parameters, and the use of an alternate reference for this which we always name that.
...as a alternative for this, a naming standard is frequently used to distinguish private and public members.
...in the following section we'll discuss xpcom, which is an older alternative to jsm and one of the foundations of mozilla applications.
Setting up an extension development environment - Archive of obsolete content
alternatively, you can set the moz_purge_caches environment variable.
...although the bug has been closed, it is believed that this pref is still relevant.
...(how to find your profile directory) alternatively, rather than using a guid, create a unique id using the format "name@yourdomain" (for example chromebug@mydomain.com) - then the proxy filename will be same as that id, with no curly brackets {}.
Supporting search suggestions in search plugins - Archive of obsolete content
query urls this optional element is an array of alternate urls for each of the suggestions in thecompletion list .
... for example, if the search term is "fir", and you don't need to return descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are specified, leaving out the optional elements.
... your completion list can include as many suggestions as you like, although it should be kept manageable, given that the display will be updating live while the user is typing their search string.
Tabbed browser - Archive of obsolete content
) where: "current" current tab (if there aren't any browser windows, then in a new window instead) "tab" new tab (if there aren't any browser windows, then in a new window instead) "tabshifted" same as "tab" but in background if default is to select new tabs, and vice versa "window" new window "save" save to disk (with no filename hint!) openuilink( url, e, ignorebutton, ignorealt, allowkeywordfixup, postdata, referrerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held.
... gbrowser.tabcontainer.advanceselectedtab(-1, true); detecting page load see also code snippets:on page load function examplepageload(event) { if (event.originaltarget instanceof components.interfaces.nsidomhtmldocument) { var win = event.originaltarget.defaultview; if (win.frameelement) { // frame within a tab was loaded.
...d do the loadcontext stuff below try { loadcontext = interfacerequestor.getinterface(ci.nsiloadcontext); } catch (ex) { try { loadcontext = subject.loadgroup.notificationcallbacks.getinterface(ci.nsiloadcontext); } catch (ex2) {} } } catch (ex0) {} if (!loadcontext) { //no load context so dont do anything although you can run this, which is your old code //this probably means that its loading an ajax call or like a google ad thing return null; } else { var contentwindow = loadcontext.associatedwindow; if (!contentwindow) { //this channel does not have a window, its probably loading a resource //this probably means that its loading an ajax cal...
Notes on HTML Reflow - Archive of obsolete content
other reflows are incremental and are dealt with asynchronously; for example, when content streams in from the network.
...incremental reflow although all of the reflow in gecko attempts to re-use as much existing state as possible (and is in therefore some sense "incremental") an incremental reflow corresponds to a reflow that is specifically targeted at an individual frame in the frame hierarchy.
...this makes me believe that we could probably eliminate this class altogether.
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
bird's eye view <map id="loaddiagrammap" name="loaddiagrammap"><area alt="(13) docontent()" coords="534,239,715,300" href="#nsiexternalhelperappservice::docontent"> <area alt="(10) getcategoryentry()" coords="575,418,821,418,821,455,629,455,629,484,575,484" href="#categorymanager" shape="poly"> <area alt="(12)" coords="539,133,583,163" href="#stream-converter"> <area alt="(11)" coords="485,133,537,163" href="#contenthandler"> <area alt="(9)" coords="445,132,484,165" h...
...ref="#nsdocumentopeninfo::dispatchcontent"> <area alt="(8)" coords="405,133,439,162" href="#onstartrequest-innards"> <area alt="(7) onstartrequest()" coords="639,129,703,129,703,165,833,165,833,204,639,204" href="#onstartrequest" shape="poly"> <area alt="(6) asyncopen()" coords="637,121,709,121,709,96,783,96,783,58,637,58" href="#asyncopen" shape="poly"> <area alt="(5) open()" coords="311,306,432,371" href="#open"> <area alt="(4)" coords="90,384,127,417" href="#openuri-innards"> <area alt="(0) registercontentlistener()" coords="37,474,346,474,346,505,88,505,88,535,37,535" href="#registercontentlistener" shape="poly"> <area alt="(3) openuri() (nsuriloader)" coords="5,207,312,269" href="#openuri"> <area alt="(2)" coords="102,114,139,148" href="#internalload"> <area alt="(1) loaduri/onlinkclick"...
... coords="77,5,449,59" href="#loaduri"> <area alt="nsiexternalhelperappservice" coords="527,305,839,339" href="#nsiexternalhelperappservice"> <area alt="category manager" coords="683,467,807,527" href="#nscategorymanager"> <area alt="nsdocumentopeninfo" coords="371,71,635,185" href="#nsdocumentopeninfo"> <area alt="necko" coords="721,113,821,157" href="#necko"> <area alt="nsuriloader" coords="23,335,215,455" href="#nsuriloader"> <area coords="227,515,485,575" href="#nsiuricontentlistener"> <area alt="nsdocshell" coords="47,83,203,153" href="#nsdocshell"></map> this block diagram is out of date as of january 2012 with regard to some minor control flow shuffling in nsuriloader.
The new nsString class implementation (1999) - Archive of obsolete content
as an alternative, programmers can pass nsistrings between modules.
...the i18n folks will tell you it's better to use a wide string and convert to 1-byte forms for this purpose even though there is a performance penalty for doing so.
...to wit: they want to ensure that the underlying buffers cannot be corrupted or altered erroneously they want to ensure that the appropriate set of conversion functions get applied they want some control over the usage pattern of strings, such that the 2-byte (ucs2) form is used whenever possible, and some restrictions are applied to the use of 1-byte (ascii) nscstrings.
modifiers - Archive of obsolete content
alt: the alt key.
...on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text.
...on windows, this is the alt key, used in conjuction with an element's accesskey.
List of commands - Archive of obsolete content
d_selectpagedown other commands the following list other commands (prefixed by cmd_ or browser:) which have not been categorized here yet (though they are in the alphabetical list below): http://lxr.mozilla.org/seamonkey/sou...baroverlay.xul http://lxr.mozilla.org/seamonkey/sou...t/navigator.js http://lxr.mozilla.org/seamonkey/sou...toroverlay.xul http://lxr.mozilla.org/seamonkey/sou...onaltoolbar.js http://lxr.mozilla.org/seamonkey/sou...rceoverlay.xul http://lxr.mozilla.org/seamonkey/sou...extoverlay.xul http://lxr.mozilla.org/seamonkey/sou...lityoverlay.js http://lxr.mozilla.org/seamonkey/sou...oomoverlay.xul http://lxr.mozilla.org/seamonkey/sou...toroverlay.xul http://lxr.mozilla.org/seamonkey/sou...ark.properties http://lxr.mozilla.org/seamonkey/sou...kmarks-temp.js http...
...md_bm_copy cmd_bm_cut cmd_bm_delete cmd_bm_expandfolder cmd_bm_export cmd_bm_find cmd_bm_import cmd_bm_managefolder cmd_bm_movebookmark cmd_bm_newbookmark cmd_bm_newfolder cmd_bm_newseparator cmd_bm_open cmd_bm_openinnewtab cmd_bm_openinnewwindow cmd_bm_paste cmd_bm_properties cmd_bm_rename cmd_bm_selectall cmd_bm_setnewbookmarkfolder cmd_bm_setnewsearchfolder cmd_bm_setpersonaltoolbarfolder cmd_bm_sortfolder cmd_bm_sortfolderbyname cmd_close cmd_closeothertabs cmd_closewindow cmd_copy cmd_copyimage cmd_copylink cmd_cut cmd_delete cmd_editpage cmd_findtypelinks cmd_findtypetext cmd_gotoline cmd_handlebackspace cmd_handleshiftbackspace cmd_minimizewindow cmd_neweditor cmd_neweditordraft cmd_neweditortemplate cmd_newnavigator cmd_newnavigatortab cmd_n...
...from the clipboard cmd_printsetup cmd_quit cmd_redo cmd_savepage cmd_scrollpagedown cmd_scrollpageup cmd_selectall cmd_switchdocumentdirection cmd_switchtextdirection cmd_textzoomenlarge cmd_textzoomreduce cmd_textzoomreset cmd_undo cmd_viewcomponentbar cmd_viewlinktoolbar cmd_viewlinktoolbar_false cmd_viewlinktoolbar_maybe cmd_viewlinktoolbar_true cmd_viewnavbar cmd_viewpersonaltoolbar cmd_viewtaskbar cmd_zoomwindow thanks for help of joe.user0 in compiling: http://readlist.com/lists/mozilla.or...l/3/15261.html .
Additional Template Attributes - Archive of obsolete content
the listbox here does not have any children, although it may do.
...this isn't particularly useful although there is a very slight optimization since the builder does not need to scan the action body looking for the member variable when compiling the queries and rules.
... <hbox datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template container="?start" member="?photo"> <rule> <image uri="?photo" src="?photo"/> </rule> </template> </hbox> in this example, the ?photo variable can be used instead of 'rdf:*' (although you can use either even if you specify the member variable).
Multiple Rule Example - Archive of obsolete content
although the canal photo has a date, the second rule doesn't use it, so you cannot refer to the ?date variable in this rule.
...you can use different variables if it makes sense in the context of the template or the data, although in this example it would seem more reasonable to use the same variable name.
...although the builder actually generates mutliple matches for one resource, in many cases it isn't necessary to be aware of this detail when creating templates.
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
alternatively, you can put content inside the columns, and use the rows to specify the appearance.
... if you put content in both the columns and the rows, the content will overlap each other, although they will align in a grid properly.
...in addition, every cell will be flexible vertically because both rows are flexible, although the first row is more so.
XUL element attributes - Archive of obsolete content
contextmenu type: id alternate name for the context attribute, but also has a corresponding script property contextmenu.
...the datasources attribute may be placed on most elements, although it will usually be found on trees and menu related elements.
... menu type: id alternate name for the popup attribute, but also has a corresponding script property 'menu'.
toolbox - Archive of obsolete content
the external toolbars associated with a toolbox are listed in the array of elements provided by the toolbox's externaltoolbars property.
... properties accessible, customtoolbarcount, externaltoolbars, palette, toolbarset methods appendcustomtoolbar, collapsetoolbar, expandtoolbar examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="toolbox example" width="300"> <toolbox> <toolbar> <toolbarbutton label="back"/> <toolbarbutton label="forward"/> <toolbarbutton label="home"/> </toolbar> <toolbar> <toolbarbutton label="stop"/> <toolbarbutton label="reload"/> </toolbar> </toolbox> ...
... externaltoolbars type: array of elements an array of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
Archived Mozilla and build documentation - Archive of obsolete content
liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions.").
...although it was possible to do so in previous versions of firefox, it was previously only possible for one observer to do so at a time.
...although for win2003, it should install into winxp fine (win2000 compatibility is unknown).
Gecko Compatibility Handbook - Archive of obsolete content
for standards-based alternatives, see updating dhtml web pages for next generation browsers.
... for example, it is ok to code <br> as <br /> although there is no benefit to do so in html documents.
... wrong doctype problem: an incorrect doctype can completely alter a page's presentation.
Syndicating content with RSS - Archive of obsolete content
when this is the case, the html web page can let people and machines know about the feed by using the <link> element, like this: <link rel="alternate" type="application/rss+xml" href="http://example.com/feed" /> adding the <a> while use of the html <link> element is powerful, it is mostly hidden.
... linking from the the html web page where the data in an rss feed is also contained makes the rss feed available for use: <a rel="alternate" type="application/rss+xml" href="http://example.com/feed">...</a> feed icons rss (and other) feeds use a special icon.
...(other sizes and colors, along with their source files, are available too.) advanced syndication techniques although this advanced technique for syndication is not required, support of this is recommended, especially for web sites and applications with high performance needs.
Confidentiality, Integrity, and Availability - Archive of obsolete content
integrity integrity refers to ensuring the authenticity of information—that information is not altered, and that the source of the information is genuine.
...now imagine that an attacker can shop on your web site and maliciously alter the prices of your products, so that they can buy anything for whatever price they choose.
... that would be a failure of integrity, because your information—in this case, the price of a product—has been altered and you didn't authorize this alteration.
TCP/IP Security - Archive of obsolete content
although using tls may require modifying some applications, tls is a well-tested protocol that has several implementations that have been added to many applications, so it is a relatively low-risk option compared to adding protection at the application layer.
... transport layer protocols such as ssl are most commonly used to provide security for communications with individual http-based applications, although they are also used to provide protection for communication sessions of other types of applications such as smtp, point of presence (pop), internet message access protocol (imap), and file transfer protocol (ftp).
... if the data is altered and the mac is recalculated, the old and new macs will differ.
-ms-filter - Archive of obsolete content
code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_h.htm <img style="filter:progid:dximagetransform.microsoft.motionblur(strength=50) progid:dximagetransform.microsoft.basicimage(mirror=1)" src="/workshop/samples/author/dhtml/graphics/cone.jpg" height="80px" width="80px" alt="cone"> the following example shows how to use scripting to set the filter on an image.
... <div id="filterfrom" style="position: absolute; width: 200px; height: 250px; background-color: white; filter: revealtrans()"> <img id="imagefrom" style="position: absolute; top: 20px; left: 20px;" src="sphere.jpg" alt="sphere"> <div id="filterto" style="position: absolute; width: 200px; height: 250px; top: 20px; left: 20px; background: white; visibility: hidden;"> </div> </div...
... initial value"" (the empty string)applies toall elementsinheritednocomputed valueas specifiedanimation typediscrete remarks the following table lists the most popular dx filters and their standards-based alternatives: dx filter standards-based alternative alpha opacity alphaimageloader <img> or background-image and related properties gradient background-image: linear-gradient() dropshadow text-shadow or box-shadow matrix transform, transform-origin in windows internet explorer 8, the -ms-filter attribute is an extensi...
E4X - Archive of obsolete content
ArchiveWebE4X
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces.
... a valid alternative to e4x is a non-native jxon algorithm.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
if you don't specify a codebase attribute, and the plugin is not installed,the browser will display only the alternate innermost text.
...at a minimum, web authors will have to nest some alternate text inside their object elements telling users where to obtain the missing component.
... get it from <a href="http://java.sun.com/products/plugin/index.html">here.</a></p> </object> the above code mentions a version specific mime type, and if the mozilla-based browser such as netscape 7 doesn't have jre 1.4.1_01 installed, the alternate text is displayed.
Anatomy of a video game - Game development
you can think about developing realtime applications as having a budget of time to do work.
... the mandatory interpolation has a performance penalty.
... mygame.ticklength = 50; // this sets your simulation to run at 20hz (50ms) setinitialstate(); main(performance.now()); // start the cycle })(); another alternative is to simply do certain things less often.
Index - Game development
32 desktop mouse and keyboard controls controls, desktop, games, javascript, keyboard, mouse ok, we've dealt with touch, keyboard and mouse controls.
...this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) 36 square tilemaps implementation: scrolling maps canvas, games, javascript, atlas, scrolling, spritesheet, tilemap, tiles this article covers how to implement scrolling square tilemaps using the canvas api.
... 45 build the brick field 2d, beginner, canvas, games, javascript, phaser, tutorial building the brick field is a little bit more complicated than adding a single object to the screen, although it's still easier with phaser than in pure javascript.
Audio for Web games - Game development
although the situation is soon going to get better with the adoption of the web audio api, the current most widely-supported method — using the vanilla <audio> element — leads to patchy results on mobile devices.
... mobile workarounds although mobile browsers can present problems, there are ways to work around the issues detailed above.
... background music with the web audio api although we can use the <audio> element to deliver linear background music that doesn't change in reaction to the game environment, the web audio api is ideal for implementing a more dynamic musical experience.
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
all primitives are immutable, i.e., they cannot be altered.
...the variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.
...r); // baz bar.touppercase(); console.log(bar); // baz // using an array method mutates the array var foo = []; console.log(foo); // [] foo.push("plugh"); console.log(foo); // ["plugh"] // assignment gives the primitive a new (not a mutated) value bar = bar.touppercase(); // baz a primitive can be replaced, but it can't be directly altered.
Safe - MDN Web Docs Glossary: Definitions of Web-related terms
an http method is safe if it doesn't alter the state of the server.
... even if safe methods have a read-only semantic, servers can alter their state: e.g.
...in particular, an application should not allow get requests to alter its state.
Positioning - Learn web development
what if you want to slightly alter the position of some boxes inside a layout from their default layout flow position, to give a slightly quirky, distressed feel?
...the markup for such an example might look like so: <h1>sticky positioning</h1> <dl> <dt>a</dt> <dd>apple</dd> <dd>ant</dd> <dd>altimeter</dd> <dd>airplane</dd> <dt>b</dt> <dd>bird</dd> <dd>buzzard</dd> <dd>bee</dd> <dd>banana</dd> <dd>beanstalk</dd> <dt>c</dt> <dd>calculator</dd> <dd>cane</dd> <dd>camera</dd> <dd>camel</dd> <dt>d</dt> <dd>duck</dd> <dd>dime</dd> <dd>dipstick</dd> <dd>drone</dd> <dt>e</dt> <dd>egg</dd> <dd>elephant</dd> <dd>eg...
...ground-color: black; color: white; padding: 10px; position: sticky; top: 0; left: 0; margin: 1em 0; } body { width: 500px; height: 1400px; margin: 0 auto; } dt { background-color: black; color: white; padding: 10px; position: sticky; top: 0; left: 0; margin: 1em 0; } <h1>sticky positioning</h1> <dl> <dt>a</dt> <dd>apple</dd> <dd>ant</dd> <dd>altimeter</dd> <dd>airplane</dd> <dt>b</dt> <dd>bird</dd> <dd>buzzard</dd> <dd>bee</dd> <dd>banana</dd> <dd>beanstalk</dd> <dt>c</dt> <dd>calculator</dd> <dd>cane</dd> <dd>camera</dd> <dd>camel</dd> <dt>d</dt> <dd>duck</dd> <dd>dime</dd> <dd>dipstick</dd> <dd>drone</dd> <dt>e</dt> <dd>egg</dd> <dd>elephant</dd> <dd>eg...
Supporting older browsers - Learn web development
once you know the browsers that come to your site, you can assess any technology that you want to use against how well it is supported and how easily you can provide an alternative for visitors who do not have that technology available.
... flexbox as a fallback for grid flexbox has greater browser support than grid due to being supported by ie10 and 11, although do check out the information later in this lesson explaining the rather patchy and confusing support for flexbox in older browsers.
... the ie10 and 11 prefixed version of grid the css grid specification was initially prototyped in internet explorer 10; this means that while ie10 and ie11 do not have modern grid support, they do have a version of grid layout that is very usable, although different to the modern specification documented on this site.
How CSS is structured - Learn web development
the efficiency penalty carries over to site maintenance too.
... as an altenative, you can also use the interactive editor below.
...although the two examples work the same, the one below is more difficult to read.
What is CSS? - Learn web development
alternatively, you should get used to searching for "mdn css-feature-name" in your favourite search engine whenever you need to find out more information about a css feature.
...droid full support 1.0system-uichrome full support 56edge full support 79firefox no support no no support no full support 43notes alternate name notes supported on macos only.alternate name uses the non-standard name: -apple-systemie no support noopera full support 43safari full support 9notes alternate name full support 9notes alternate name notes s...
...upported since macos 10.11.alternate name uses the non-standard name: -apple-systemwebview android full support 56chrome android full support 56firefox android no support noopera android full support 43safari ios full support 9alternate name full support 9alternate name alternate name uses the non-standard name: -apple-systemsamsung internet android full support 6.0legend full support full support ...
JavaScript basics - Learn web development
to learn more about alternative approaches, see script loading strategies.
...this is a good alternative to repeatedly writing the same code.
... adding an image changer in this section, you will learn how to use javascript and dom api features to alternate the display of one of two images.
Define terms with HTML - Learn web development
however, this is not an acceptable alternative for providing an inline expansion.
... </span> you can download it at <a href="http://www.mozilla.org">mozilla.org</a> </p> assistive technology can often use this attribute to find a text alternative to a given term.
... a simple example here's a simple example describing kinds of food and drink: <dl> <dt>jambalaya</dt> <dd> rice-based entree typically containing chicken, sausage, seafood, and spices </dd> <dt>sukiyaki</dt> <dd> japanese specialty consisting of thinly sliced meat, vegetables, and noodles, cooked in sake and soy sauce </dd> <dt>chianti</dt> <dd> dry italian red wine originating in tuscany </dd> </dl> the basic pattern, as you can see, is to alternate <dt> terms with <dd> descriptions.
HTML text fundamentals - Learn web development
in this context the <h1> element is also a semantic element, which gives the text it wraps around the role (or meaning) of "a top level heading on your page." <h1>this is a top level heading</h1> by default, the browser will give it a large font size to make it look like a heading (although you could style it to look like anything you wanted using css).
... emphasis and importance in human language, we often emphasise certain words to alter the meaning of a sentence, and we often want to mark certain words as important or different in some way.
... emphasis when we want to add emphasis in spoken language, we stress certain words, subtly altering the meaning of what we are saying.
Adding vector graphics to the Web - Learn web development
<img src="equilateral.svg" alt="triangle with all three sides equal" height="87" width="100" /> pros quick, familiar image syntax with built-in text equivalent available in the alt attribute.
...this being the case, only supporting browsers will load the svg — older browsers will load the png instead: <img src="equilateral.png" alt="triangle with equal sides" srcset="equilateral.svg"> you can also use svgs as css background images, as shown below.
... here's a quick review: <iframe src="triangle.svg" width="500" height="500" sandbox> <img src="triangle.png" alt="triangle with three unequal sides" /> </iframe> this is definitely not the best method to choose: cons iframes do have a fallback mechanism, as you can see, but browsers only display the fallback if they lack support for iframes altogether.
From object to iframe — other embedding technologies - Learn web development
penalties for copyright infringement are severe.
... using https requires a security certificate, which can be expensive (although let's encrypt makes things easier) — if you can't get one, you may serve your parent document with http.
...one important note is that you should never add both allow-scripts and allow-same-origin to your sandbox attribute — in that case, the embedded content could bypass the same-origin policy that stops sites from executing scripts, and use javascript to turn off sandboxing altogether.
Third-party APIs - Learn web development
for the google maps api in particular, you need to provide a credit card for billing purposes (although basic usage is free), which we didn't think was acceptable for a basic tutorial.
... we wanted to show that there are other alternatives available.
... = current.snippet; para2.textcontent = 'keywords: '; for(let j = 0; j < current.keywords.length; j++) { const span = document.createelement('span'); span.textcontent += current.keywords[j].value + ' '; para2.appendchild(span); } if(current.multimedia.length > 0) { img.src = 'http://www.nytimes.com/' + current.multimedia[0].url; img.alt = current.headline.main; } clearfix.setattribute('class','clearfix'); article.appendchild(heading); heading.appendchild(link); article.appendchild(img); article.appendchild(para1); article.appendchild(para2); article.appendchild(clearfix); section.appendchild(article); } } } there's a lot of code here; let's explain it step by step: ...
Aprender y obtener ayuda - Learn web development
many mdn web docs reference pages provide interactive examples too, where you can alter the code and see how the live result changes.
...eat healthily, get regular exercise, and make sure you get enough sleep.
... using mdn the site you are already on has a wealth of information available to you — both reference material for looking up code syntax, and guides/tutorials for learning techniques.
Framework main features - Learn web development
a react representation of this authorcredit component might look something like this: function authorcredit(props) { return ( <figure> <img src={props.src} alt={props.alt} /> <figcaption>{props.byline}</figcaption> </figure> ); } {props.src}, {props.alt}, and {props.byline} represent where our props will be inserted into the component.
... to render this component, we would write code like this in the place where we want it rendered (which will probably be inside another component): <authorcredit src="./assets/zelda.png" alt="portrait of zelda schiff" byline="zelda schiff is editor-in-chief of the library times." /> this will ultimately render the following <figure> element in the browser, with its structure as defined in the authorcredit component, and its content as defined in the props included on the authorcredit component call: <figure> <img src="assets/zelda.png" alt="portrait of zelda schiff" > <figcaption> zelda schiff is editor-in-chief of the library times.
...although each framework’s approach to defining the styles of a component is slightly different, all of them give you multiple ways to do so.
Implementing feature detection - Learn web development
for browsers that don't, we could use a floated layout that works ok, although it is slightly more brittle and hacky, and not as cool-looking.
... let's implement something that demonstrates this, although we'll keep it simple for now.
...the problem here is browser support — @supports is not supported at all in ie, and only supported in very recent versions of safari/ios webkit (9+/9.2+), whereas the javascript version should work in much older browsers (probably back to ie8 or 9, although older versions of ie will have additional problems, such as not supporting document.queryselector, and having a messed up box model).
Deploying our app - Learn web development
although netlify offers a drag and drop deployment service, we are intending to trigger a new deployment to netlify each time we push to a github repo.
... now all the code is staged, we can commit; run the following command: git commit -m ’committing initial code’ note: although you're free to write whatever you wish in the commit message, there's some useful tips around the web on good commit messages.
... although the test for this project does not include a test framework, as with all things in the front-end development world, there are a slew of framework options.
Introducing a complete toolchain - Learn web development
note that, although we're using github in this chapter, there are several alternatives including gitlab and bitbucket, and you could even host your own git repositories.
...although git hooks can be a bit overly complicated (in this author's opinion), once they're in place they can be very powerful.
... although this stage of our toolchain can be quite painful, because we've chosen a tool that purposely tries to reduce configuration and complexity, there's really nothing more we need to do during the development phase.
Accessibility API cross-reference
the ipc mechanisms used by current generation api's are also not cross-platform, although communication for some cross-platform accessibility api of the future could be done through sockets.
... n/a n/a canvas n/a <canvas> (accessible alternative richtext content may be nested inside, but the canvas itself is presentational) a dialog for picking a color n/a color_chooser color_chooser n/a <input type=color> a dialog for picking a file n/a file_chooser file_chooser n/a invoked with <input type=file> no explanation given n/a n/a invalid...
... n/a expandable expandable implied by the presence of the aria-expanded attribute, regardless of value can extend selection extselectable n/a n/a not clipped to boundary of parent, does not auto-move with parent floating n/a n/a identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
Mozilla accessibility architecture
each platform's accessibility api has made different assumptions, although there are a number of common characteristics.
...examples of accessible role constants are role_button, role_checkbox and role_list, although they can have slightly different names and values in each api.
...for example, tables support nsiaccessibletable, text supports nsiaccessibletext and edit boxes support nsieditabletext., although this code has been moved into the atk specific directories because it is not currently used in windows.
How Mozilla's build system works
altogether, 1,276 data structures describing the build configuration were derived from them.
... although we call the base class buildbackend, the class doesn't need to be focused with building at all.
...although the common practice is to have a resources directory that contains the jar.mn and chrome files, you may also put a jar.mn file in a directory that creates a library, in which case it will be processed.
Eclipse CDT Manual Setup
setup time some points in the rest of this document below are old and taken care of by the mach commands described above (although some of the project configuration is not done automatically yet).
...eclipse cdt doesn't currently understand objective-c files (although there is a project that promises to add objective-c support), so for now, this is the best we can do to give eclipse a chance of expanding its understanding of the source into the objective-c files.
...this script will complete in about 30 seconds on a warm tree (files cached in ram) if your object directory is up to date, although eclipse will take several minutes to process the "build output" that it produces.
mach
$ mozconfig=/path/to/mozconfig ./mach build # alternatively (for persistent mozconfig usage): $ export mozconfig=/path/to/mozconfig $ ./mach build # let's pretend the mozconfig environment variable isn't set.
...some larger known issues include: mintty (alternative terminal emulator on windows) doesn't work.
... when the alternative is a make target.
Cross Process Object Wrappers
however, although cpows are convenient, they have serious limitations and can cause responsiveness problems, so should only be used when necessary and only as a migration aid.
... limitations of cpows although cpows can be convenient they have several major limitations, which are listed below.
... performance although the wrapper looks just like an object completely contained in the chrome script scope, it's really just a reference to an object in the content process.
Embedding Tips
alternatively, implement a nsiuricontentlistener as described below.
... alternatively, create a standalone webbrowser persist object and call the nsiwebbrowserpersist interface on that to save uris and documents.
... how do i specify alternate locations for profiles?
How to get a stacktrace for a bug report
this article describes how to use the mozilla crash reporter (breakpad) to get a crash id, which our engineers can use to get a stacktrace, and alternative ways to get a stacktrace if you can't get a crash id.
...in these cases you will need to use one of the alternative methods listed below.
... alternative ways to get a stacktrace if the mozilla crash reporter doesn't come up or isn't available you will need to obtain a stacktrace manually: windows see the article create a stacktrace with windbg for information on how to do this.
source-editor.jsm
constant value sourceeditor.defaults.contextmenu "sourceeditorcontextmenu" sourceeditor.defaults.expandtab true sourceeditor.defaults.highlightcurrentline true sourceeditor.defaults.initialtext "" sourceeditor.defaults.keys null sourceeditor.defaults.mode sourceeditor.modes.text sourceeditor.defaults.readonly false sourceeditor.defaults.showannotationruler false sourceeditor.defaults.showlinenumbers false sourceeditor.defaults.showoverviewruler false sourceeditor.defaults.tabsize 4 sourc...
... initialtext string the default initial text to be in the editor when it's created.
...this is deprecated starting in firefox 13; use initialtext instead.
Creating localizable web content
depending on context, find alternate strings or document an explanation of the string for localizers check that we don't link in new pages to sub-pages with anchors.
... per-locale customizations check if there are alternative links for localized pages (e.g., links to mdn, addons.mozilla.org, or other external resources, are there translated equivalents we can use).
... if there are alternatives, use them by adding the $lang; parameter in the urls evaluate the impact of new pages on all our web properties, especially links to community sites and redirects.
mozilla::CondVar
wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on this condvar until it is notifyed.
...does not incur a runtime penalty in optimized builds.
...does not incur a runtime penalty in optimized builds.
mozilla::Monitor
wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on this monitor until it is notifyed.
...does not incur a runtime penalty in optimized builds.
...does not incur a runtime penalty in optimized builds.
Memory reporting
although nsimemoryreporter uses int64_t, this is because (a) you can't use size_t in idl, and (b) not every "amount" is a bytes measurement.
... alternatively, if d does have fields that point to other objects but you don't want to measure them because they're insignificant, then d::sizeofexcludingthis is again not necessary.
...for example: void foobar::addsizeofexcludingthis(nsmallocsizeoffun amallocsizeof, size_t *afoosizeout, size_t* abarsizeout) const { *afoosizeout += ...; *abarsizeout += ...; } alternatively, you could create a struct: struct foobarsizes { size_t mfoo; size_t mbar; foobarsizes() { mozilla::podzero(this); } } void foobar::addsizeofexcludingthis(nsmallocsizeoffun amallocsizeof, foobarsizes* asizes) const { asizes->mfoo += ...; asizes->mbar += ...; } note the add prefix that makes this incrementing behaviour clear.
PRLinger
structure used with the pr_sockopt_linger socket option to specify the time interval (in printervaltime units) to linger on closing a socket if any data remain in the socket send buffer.
... syntax #include <prio.h> typedef struct prlinger { prbool polarity; printervaltime linger; } prlinger; fields the structure has the following fields: polarity polarity of the option's setting: pr_false means the option is off, in which case the value of linger is ignored.
...linger time (in printervaltime units) to linger before closing if any data remain in the socket send buffer.
PR_TicksPerSecond
returns the number of ticks per second currently used to determine the value of printervaltime.
... syntax #include <prinrval.h> pruint32 pr_tickspersecond(void); returns an integer between 1000 and 100000 indicating the number of ticks per second counted by printervaltime on the current platform.
... the relationship between a printervaltime tick and standard clock units is platform-dependent.
An overview of NSS Internals
alternatively, should you decide that you don't want to work with any persistent recording of certificates, you may initialize nss in a no-database mode.
...it was originally developed for telecommunication systems at times where it was critical to minimize data as much as possible (although it still makes sense to use that principle today for good performance).
...as a consequence, it will be necessary to try multiple different alternative routes while searching for (z), in a recursive manner.
NSPR functions
pr_now interval time the nspr socket i/o functions pr_recv and pr_send (used by the nss ssl functions) take a printervaltime timeout parameter.
... printervaltime has an abstract, platform-dependent time unit.
... call pr_secondstointerval or pr_millisecondstointerval to convert a time interval in seconds or milliseconds to printervaltime.
NSS tools : pk12util
id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key triple des-cbc parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate: data: version: 3 (0x2) serial number: 13 (0xd) signature algorithm: pkcs #1 sha-1 with rsa encryption issuer: "e=personal-freemail@thawte.com,cn=thawte personal freemail c a,ou=certification services division,o=thawte consultin...
... alternatively, the -r prints the certificates and then exports them into separate der binary files.
...id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key triple des-cbc parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate friendly name: thawte personal freemail issuing ca - thawte consulting certificate friendly name: thawte freemail member's thawte consulting (pty) ltd.
Bytecode Descriptions
format: jof_ic other expressions globalthis stack: ⇒ this push the global this value.
... not to be confused with the globalthis property on the global.
...this allows alternate faster implementations to be used that avoid unnecesary allocations.
JS_AliasElement
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
... description js_aliaselement assigns an alternate index number for an element or numeric property associated with a native object.
...name is the element's current index in the object, and alias is the alternate index to assign to the element.
JS_AliasProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
... description js_aliasproperty assigns an alternate name for a property associated with a native object.
...name is the property's current name in the object, and alias is the alternate name to assign to the property.
JS_DumpHeap
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
... enum jsgctracekind { // these trace kinds have a publicly exposed, although opaque, c++ type.
... although this map is public, the details are completely hidden.
Detailed XPCOM hashtable guide
note: because of the double-hashing implementation, entries may move in memory when the hashtable is altered.
...at this point, use the functions putentry/getentry/removeentry to alter the hashtable.
...use the put(), get(), and remove() methods to alter the table.
nsACString_internal
<map id="classes" name="classes"> <area alt="" coords="456,5,605,53" href="http://developer.mozilla.org/en/nsacstring_internal" shape="rect" title="nsacstring_internal"> <area alt="" coords="415,101,497,149" href="http://developer.mozilla.org/en/nscstring" shape="rect" title="nscstring"> <area alt="" coords="521,101,689,149" href="http://developer.mozilla.org/en/nsdependentcsubstring" shape="rect" title="nsdependentcsubstring"> <area alt="...
..." coords="172,197,289,245" href="http://developer.mozilla.org/en/nsfixedcstring" shape="rect" title="nsfixedcstring"> <area alt="" coords="315,197,437,245" href="http://developer.mozilla.org/en/nsxpidlcstring" shape="rect" title="nsxpidlcstring"> <area alt="" coords="461,197,611,245" href="http://developer.mozilla.org/en/nsdependentcstring" shape="rect" title="nsdependentcstring"> <area alt="" coords="635,197,787,245" href="http://developer.mozilla.org/en/nspromiseflatcstring" shape="rect" title="nspromiseflatcstring"> <area alt="" coords="173,293,285,341" href="http://developer.mozilla.org/en/nscautostring" shape="rect" title="nscautostring"> <area alt="" coords="5,389,227,437" href="http://developer.mozilla.org/en/ns_lossyconvertutf16toascii" shape="rect" title="ns_lossyconvertutf16toascii"...
...> <area alt="" coords="251,389,435,437" href="http://developer.mozilla.org/en/ns_convertutf16toutf8" shape="rect" title="ns_convertutf16toutf8"> <area alt="" coords="309,293,445,341" href="http://developer.mozilla.org/en/nsadoptingcstring" shape="rect" title="nsadoptingcstring"> </map> method overview constructors beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replac...
nsAString_internal
<map id="classes" name="classes"> <area alt="" coords="415,5,553,53" href="http://developer.mozilla.org/en/nsastring_internal" shape="rect" title="nsastring_internal"> <area alt="" coords="379,101,451,149" href="http://developer.mozilla.org/en/nsstring" shape="rect" title="nsstring"> <area alt="" coords="475,101,635,149" href="http://developer.mozilla.org/en/nsdependentsubstring" shape="rect" title="nsdependentsubstring"> <area alt="" coor...
...ds="151,197,257,245" href="http://developer.mozilla.org/en/nsfixedstring" shape="rect" title="nsfixedstring"> <area alt="" coords="284,197,396,245" href="http://developer.mozilla.org/en/nsxpidlstring" shape="rect" title="nsxpidlstring"> <area alt="" coords="420,197,559,245" href="http://developer.mozilla.org/en/nsdependentstring" shape="rect" title="nsdependentstring"> <area alt="" coords="583,197,727,245" href="http://developer.mozilla.org/en/nspromiseflatstring" shape="rect" title="nspromiseflatstring"> <area alt="" coords="152,293,253,341" href="http://developer.mozilla.org/en/nsautostring" shape="rect" title="nsautostring"> <area alt="" coords="5,389,192,437" href="http://developer.mozilla.org/en/ns_convertasciitoutf16" shape="rect" title="ns_convertasciitoutf16"> <area alt="" coords="216...
...,389,400,437" href="http://developer.mozilla.org/en/ns_convertutf8toutf16" shape="rect" title="ns_convertutf8toutf16"> <area alt="" coords="277,293,405,341" href="http://developer.mozilla.org/en/nsadoptingstring" shape="rect" title="nsadoptingstring"> </map> method overview constructors beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii appen...
nsIDOMMouseScrollEvent
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description axis long indicates which mouse wheel axis changed; this will be either horizontal_axis or vertical_axis.
...void initmousescrollevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis ); parameters typearg the type of event.
... altkeyarg true if the alt key was down when the event occurred, otherwise false.
nsIDOMWindowUtils
constants constant value description modifier_alt 0x0001 getmodifierstate("alt") of the send event will return true if this is specified for amodifiers of send*event() except sendnative*event().
... modifier_altgraph 0x0010 getmodifierstate("altgraph") of the send event will return true if this is specified for amodifiers of send*event() except sendnative*event().
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsINavHistoryResultViewer
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although this attribute is read-write, you should not alter it directly; instead, use the nsinavhistoryresult.viewer attribute to set the viewer.
...for trees, this would update the column headers to reflect the altered sorting.
nsIPluginHost
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIWebBrowserChrome3
1.0 66 introduced gecko 2.0 inherits from: nsiwebbrowserchrome2 last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); methods onbeforelinktraversal() determines the appropriate target for a link.
... astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the original link target.
...otherwise returns originaltarget.
nsIXULBrowserWindow
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the xulbrowserwindow attribute exists on the nsixulwindow interface although both firefox and seamonkey also store their nsixulbrowserwindow reference in the global xulbrowserwindow object accessible from javascript code.
...method overview astring onbeforelinktraversal(in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab); void setjsdefaultstatus(in astring status); void setjsstatus(in astring status); void setoverlink(in astring link, in nsidomelement element); methods onbeforelinktraversal() called before traversing a link to determine the appropriate target into which to load the link.
...astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the specified target for the link.
nsIZipWriter
note: although it is not necessary to add directory entries in order to add file entries within them, some zip utilities may have problems with that, so it may be best to add the directory entries explicitly first.
... note: although it is not necessary to add directory entries in order to add file entries within them, some zip utilities may have problems with that, so it may be best to add the directory entries explicitly first.
... the zip writer will be busy until the queue is complete or an error halts processing of the queue early.
Mozilla
or, alternatively, the conditions can be reversed (a != test rather than an == test).
...this article describes how to use the mozilla crash reporter (breakpad) to get a crash id, which our engineers can use to get a stacktrace, and alternative ways to get a stacktrace if you can't get a crash id.
... mozilla style system documentation see also the style techtalk for more complete although less detailed documentation.
Edit fonts - Firefox Developer Tools
for example, font-weight can be set to any value between 1 and 1000 in variable fonts (although it is not guaranteed that a variable font will support this entire range).
...although it isn't required that these axes be defined for every font, if the font designer does implement a registered axis, its behavior must follow the defined behavior.
... working with variable fonts in the font editor if the inspected element uses a variable font, the fonts tab shows the axes that have been implemented for that particular font, providing control to alter the value of each one.
Examine and edit HTML - Firefox Developer Tools
if you hold the alt key while clicking the arrow, it expands the node and all the nodes underneath it.
...the shadow root is signified by a node named #shadow-root — you can click its expansion arrow to see the full contents of the shadow dom, and then manipulate the contained nodes in a similar way to other part of the page's dom (although with a limited featureset — you can't, for example, drag and drop or delete shadow dom nodes).
...this is equivalent to holding the alt key and clicking the disclosure triangle next to an element.
Using the CSS Painting API - Web APIs
while you can't play with the worklet's script, you can alter the background-size and background-position to change the size and location of the background image.
... css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/02parttwo/header-highlight.js'); .fancy { background-image: paint(headerhighlight); } .half { width: 50%; } <h1 class="fancy">largest header</h1> <h6 class="fancy">smallest header</h6> <h3 class="fancy half">50% width header</h3> while you can't play with the worklet's script, you can alter the element's font-size and width to change the size of the background image.
... in our <script> we register the worklet: css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/worklet/boxbg.js'); while you can't play with the worklet's script, you can alter the custom property values to change the colors and width of the background image.
Basic usage of canvas - Web APIs
the <canvas> element <canvas id="tutorial" width="150" height="150"></canvas> at first sight a <canvas> looks like the <img> element, with the only clear difference being that it doesn't have the src and alt attributes.
... providing fallback content is very straightforward: just insert the alternate content inside the <canvas> element.
...this can look something like this: <canvas id="stockgraph" width="150" height="150"> current stock price: $3.15 + 0.15 </canvas> <canvas id="clock" width="150" height="150"> <img src="images/clock.png" width="150" height="150" alt=""/> </canvas> telling the user to use a different browser that supports canvas does not help users who can't read the canvas at all, for example.
Examples of web and XML development using the DOM - Web APIs
output"> </div> </body> </html> example 2: image attributes <!doctype html> <html lang="en"> <head> <title>modifying an image border</title> <script> function setborderwidth(width) { document.getelementbyid("img1").style.borderwidth = width + "px"; } </script> </head> <body> <p> <img id="img1" src="image1.gif" style="border: 5px solid green;" width="100" height="100" alt="border test"> </p> <form name="formname"> <input type="button" value="make border 20px-wide" onclick="setborderwidth(20);" /> <input type="button" value="make border 5px-wide" onclick="setborderwidth(5);" /> </form> </body> </html> example 3: manipulating styles in this simple example, some basic style properties of an html paragraph element are accessed using the style object on the e...
... ev.stoppropagation(); alert("event propagation halted."); } function load() { elem = document.getelementbyid("tbl1"); elem.addeventlistener("click", stopevent, false); } </script> </head> <body onload="load();"> <table id="t-daddy" onclick="alert('hi');"> <tr id="tbl1"> <td id="c1">one</td> </tr> <tr> <td id="c2">two</td> </tr> </table> </body> </html> example 6: getcomputedstyle this example demonstrates how the window.
...> <td>row 0 cell 1</td> </tr> </table> <script> var table = document.getelementbyid('table0'); var row = table.insertrow(-1); var cell, text; for (var i = 0; i < 2; i++) { cell = row.insertcell(-1); text = 'row ' + row.rowindex + ' cell ' + i; cell.appendchild(document.createtextnode(text)); } </script> notes a table's innerhtml property should never be used to modify a table, although you can use it to write an entire table or the content of a cell.
EffectTiming - Web APIs
these properties are all optional, although without setting a duration the animation will not play.
... direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
...although this is technically optional, keep in mind that your animation will not run if this value is 0.
GeolocationCoordinates - Web APIs
the geolocationcoordinates interface represents the position and altitude of the device on earth, as well as the accuracy with which these properties are calculated.
... geolocationcoordinates.altitude read only secure context returns a double representing the position's altitude in meters, relative to sea level.
... geolocationcoordinates.altitudeaccuracy read only secure context returns a double representing the accuracy of the altitude expressed in meters.
HTMLMarqueeElement - Web APIs
possible values are scroll, slide and alternate.
...it can only fire when the behavior attribute is set to alternate.
... examples <marquee>this text will scroll from right to left</marquee> <marquee direction="up">this text will scroll from bottom to top</marquee> <marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid"> <marquee behavior="alternate"> this text will bounce </marquee> </marquee> specifications specification status comment html living standardthe definition of 'htmlmarqueeelement' in that specification.
Recommended Drag Types - Web APIs
it is recommended to always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative.
... you should always include a text/plain alternative for the node.
...strive to always include a text/plain alternative, unless the dragged object is specific to a particular site or application.
Working with the History API - Web APIs
here too, going back doesn't change the document's contents from what they were in the previous step, although the document might update its contents manually upon receiving the popstate event.
... title all browsers but safari currently ignore this parameter, although they may use it in the future.
...alternatively, you could pass a short title for the state to which you're moving.
Timing element visibility with the Intersection Observer API - Web APIs
although many aspects of this example will not match real world usage (in particular, the articles all have the same text and aren't loaded from a database, and there are just a handful of simple text-only ads that are selected from an array), this should provide enough understanding of the api to quickly learn how to apply the intersection observer api to your own site.
...if you change this to -1, it will appear on the right (although some other elements will need some adjustments made to their margins to get the spacing just right).
...the values are strings, but we can convert those to numbers easily enough—in fact, javascript generally does it automatically, although we'll have one instance where we have to do it ourselves.
KeyboardEvent.initKeyEvent() - Web APIs
syntax event.initkeyevent (type, bubbles, cancelable, viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event.
... altkeyarg is a boolean that is true if the virtual key to be generated is a combination of keys containing the alt key.
... false, // ctrlkeyarg, false, // altkeyarg, false, // shiftkeyarg, false, // metakeyarg, 9, // keycodearg, 0); // charcodearg); document.getelementbyid('blah').dispatchevent(event); specification this implementation of keyboard events is based on the key events spec in the early versions of dom 2 events,...
KeyframeEffectOptions - Web APIs
these properties are all optional, although without setting a duration the animation will not play.
... direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
...although this is technically optional, keep in mind that your animation will not run if this value is 0.
MouseEvent.initMouseEvent() - Web APIs
syntax event.initmouseevent(type, canbubble, cancelable, view, detail, screenx, screeny, clientx, clienty, ctrlkey, altkey, shiftkey, metakey, button, relatedtarget); parameters type the string to set the event's type to.
... altkey whether or not alt key was depressed during the event.
... sets the value of mouseevent.altkey.
Navigator.vibrate() - Web APIs
WebAPINavigatorvibrate
if a vibration pattern is already in progress when this method is called, the previous pattern is halted and the new one begins instead.
...each value indicates a number of milliseconds to vibrate or pause, in alternation.
... you may provide either a single value (to vibrate once for that many milliseconds) or an array of values to alternately vibrate, pause, then vibrate again.
NodeList - Web APIs
WebAPINodeList
although nodelist is not an array, it is possible to iterate over it with foreach().
...static nodelists although they are both considered nodelists, there are 2 varieties of nodelist: live and static.
... an alternative to accessing nodelist[i] (which instead returns undefined when i is out-of-bounds).
RsaPssParams - Web APIs
saltlength a long integer representing the length of the random salt to use, in bytes.
... rfc 3447 says that "typical salt lengths" are either 0 or the length of the output of the digest algorithm that was selected when this key was generated.
... the maximum size of saltlength is given by: math.ceil((keysizeinbits - 1)/8) - digestsizeinbytes - 2 so for a key length of 2048 bits and a digest output size of 32 bytes, the maximum size would be 222.
SpeechRecognition.onresult - Web APIs
// each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'onresult' in that specification.
SpeechRecognitionEvent.results - Web APIs
// each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'results' in that specification.
SpeechRecognitionEvent - Web APIs
// each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'speechrecognitionevent' in that specification.
SpeechRecognitionResult.isFinal - Web APIs
// each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log(event.results[0].isfinal); } specifications specification status comment web speech apithe definition of 'isfinal' in that specification.
SpeechRecognitionResultList.item() - Web APIs
// each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'item()' in that specification.
SpeechRecognitionResultList.length - Web APIs
// each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log(event.results.length); } specifications specification status comment web speech apithe definition of 'length' in that specification.
SpeechRecognitionResultList - Web APIs
// each speechrecognitionresult object contains speechrecognitionalternative objects that contain individual results.
... // the second [0] returns the speechrecognitionalternative at position 0.
... // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'speechrecognitionresultlist' in that specification.
StorageManager.persist() - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpersistchrome full support 52 full support 52 no support 48 — 52alternate name alternate name uses the non-standard name: requestpersistentedge full support ≤79firefox full support 55ie ?
... webview android full support 52 full support 52 no support 48 — 52alternate name alternate name uses the non-standard name: requestpersistentchrome android full support 52 full support 52 no support 48 — 52alternate name alternate name uses the non-standard name: requestpersistentfirefox android full support 55opera android full support yessafari ios ...
... samsung internet android full support 6.0 full support 6.0 no support 5.0 — 6.0alternate name alternate name uses the non-standard name: requestpersistentlegend full support full support compatibility unknown compatibility unknownuses a non-standard name.uses a non-standard name.
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
it's different from rsassa-pkcs1-v1_5 in that it incorporates a random salt in the signature operation, so the same message signed with the same key will not result in the same signature each time.
... an extra property, defining the salt length, is passed into the sign() and verify() functions when they are invoked.
...*/ function getmessageencoding() { const messagebox = document.queryselector(".rsa-pss #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } let encoded = getmessageencoding(); let signature = await window.crypto.subtle.sign( { name: "rsa-pss", saltlength: 32, }, privatekey, encoded ); ecdsa this code fetches the contents of a text box, encodes it for signing, and signs it with a private key.
TextEncoder.prototype.encodeInto() - Web APIs
(function(window){ "use strict"; var log = math.log; var ln2 = math.ln2; var clz32 = math.clz32 || function(x) {return 31 - log(x >>> 0) / ln2 | 0}; var fromcharcode = string.fromcharcode; var patchedu8array = window.uint8array || array; var textencoderprototype = textencoder["prototype"]; var globaltextencoder = window["textencoder"]; var globaltextencoderprototype; var globaltextencoderinstance; ////////////////////////////////////////////////////////////////////////////////////// function encoderreplacer(nonasciichars){ // make the utf string into a binary utf-8 encoded string var point = nonasciichars.charcodeat(0)|0; if (0xd800 <= point && point <= ...
...inputlength : read}; }; textencoderprototype["encodeinto"] = polyfill_encodeinto; if (!globaltextencoder) { window["textencoder"] = textencoder; } else if (!(globaltextencoderprototype = globaltextencoder["prototype"])["encodeinto"]) { globaltextencoderinstance = new globaltextencoder; globaltextencoderprototype["encodeinto"] = function(string, u8arr) { // unfortunately, there's no way i can think of to quickly extract the number of bits written and ...
...there are still edge-cases which are possible // in many circumstances, we can use the faster native textencoder var res8 = globaltextencoderinstance["encode"](string); var res8len = res8.length|0; if (res8len < u8len) { // if we dont have to worry about read/written u8arr.set( res8 ); return { "read": strlen, "written": res8.length|0 }; } } return polyfill_encodeinto(string, u8arr); ...
Signaling and video calling - Web APIs
although it's sdp, even this doesn't matter so much: the content of the message going through the signaling server is, in effect, a black box.
... if conditions change—for example the network connection deteriorates—one or both peers might suggest switching to a lower-bandwidth media resolution, or to an alternative codec.
...open the web console on both devices and look at the logged output—although you don't see it in the code as shown above, the code on the server (and on github) has a lot of console output so you can see the signaling and connection processes at work.
Writing WebSocket servers - Web APIs
browsers generally require a secure connection for websockets, although they may offer an exception for local devices.
...in many common setups, a reverse proxy has already dealt with them.
...although all frames follow the same specific format, data going from the client to the server is masked using xor encryption (with a 32-bit key).
Fundamentals of WebXR - Web APIs
assuming a person has two healthy eyes, their total field of view is about 200° to 220° wide.
...the rotational degrees of freedom are: pitch: looking up and down yaw: looking left and right roll: tilting left and right in all of these cases, the viewer remains in the same location in space while pivoting on one or more of the three axes to alter the direction in which they're looking.
... important health and safety reminders because the entire act of creating a virtual 3d world is, in essence, a trick which takes advantage of our understanding of how eyes collect light and how the brain interprets the collected data, it is important to keep in mind that as such, software designers and developers have a responsibility to be even more careful than usual to ensure that the results are correct.
Inputs and input sources - Web APIs
a full webxr experience isn't just about showing the user a wholly virtual scene or augmenting reality by adding to or altering the world around them.
... if the controller were instead positioned to the left of and closer to the user than the world space origin (or possibly behind the user, if the user is located at the origin, although that's an uncomfortable way to hold a controller), the coordinates would have a negative value for x, but a positive value for z.
... this gamepad object is not only used to obtain access to specialty buttons, trackpads, and so forth, but also provides a way to more directly access and monitor the controls that serve as the primary select and squeeze inputs, since these are included in its buttons list.
Using XMLHttpRequest - Web APIs
handling binary data although xmlhttprequest is most commonly used to send and receive textual data, it can be used to send and receive binary content.
... one can also detect all three load-ending conditions (abort, load, or error) using the loadend event: req.addeventlistener("loadend", loadend); function loadend(e) { console.log("the transfer finished (although we don't know if it succeeded or not)."); } note there is no way to be certain, from the information received by the loadend event, as to which condition caused the operation to terminate; however, you can use this to handle tasks that need to be performed in all end-of-transfer scenarios.
...note also that, although in this example there are some file <input> fields, when you submit a form through the formdata api you do not need to use the filereader api also: files are automatically loaded and uploaded.
ARIA: figure role - Accessibility
<div role="figure" aria-labelledby="caption"> <img src="image.png" alt="full alternative image description"> <p id="caption">figure 1: the caption</p> </div> in the above example, we have a figure that consists of two separate content items — an image and a caption.
... examples we could extend the initial example on the page to also identify a paragraph that provides a descriptive label for the figure by referencing its id in aria-labelledby: <div role="figure" aria-labelledby="figure-1"> <img src="diagram.png" alt="diagram showing the four layers of awesome and their relative priority order — music, cats, nature, and ice cream"> <pre><code> let awesome = ['music', 'cats', 'nature', 'ice cream']; </code></pre> <p id="figure-1">figure 1: the four layers of awesome.</p> </div> best practices only use role="figure" if you have to — for example if you don't have control over your htm...
...for example, our above example should be rewritten as follows: <figure> <img src="diagram.png" alt="diagram showing the four layers of awesome and their relative priority order — music, cats, nature, and ice cream"> <pre><code> let awesome = ['music', 'cats', 'nature', 'ice cream']; </code></pre> <figcaption>figure 1: the four layers of awesome.</figcaption> </figure> specifications specification status accessible rich internet applications (wai-aria) 1.1the definition of 'figure' in that specification.
Accessibility documentation index - Accessibility
29 using the aria-valuetext attribute aria, accessibility, attribute the aria-valuetext attribute is used to define the human readable text alternative of aria-valuenow for a range widget such as progressbar, spinbutton or slider.
... 40 x-ms-aria-flowfrom aria, microsoft, non-standard the x-ms-aria-flowfrom property specifies the id of the previous element in an alternative reading order, allowing assistive technology to override the general default of reading in document source order.
... 98 perceivable accessibility, principle 1, wcag, web content accessibility guidelines, contrast, different presentation, text alternatives, time-based media this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the perceivable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1.
Understandable - Accessibility
3.1.5 reading level (aaa) if text is provided that requires a higher reading level that lower secondary education level (typically children around 11-14 years old), provide supplementary explainer material to help people who can't read it, or provide an alternative version that is written at lower secondary level.
...an alternative style for poetic effect), or they have to be written in a strict style (e.g.
...suggesting alternatives when the user is choosing a user name and has selected one that is already taken), unless doing so would cause a security issue (e.g.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
the first is an anonymous item as it has no enclosing markup, this item will always be dealt with via the auto-placement rules.
... grid-auto-flow: dense; list-style: none; margin: 1em auto; padding: 0; max-width: 800px; } .wrapper li { border: 1px solid #ccc; } .wrapper li.landscape { grid-column-end: span 2; } .wrapper li img { display: block; object-fit: cover; width: 100%; height: 100%; } <ul class="wrapper"> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li class="landscape"><img src="https://udn.realityripple.com/samples/62/643f590dbc.png" alt="placeholder"></li> <li class="landscape"><img src="https://udn.realityripple.com/samples/62/643f590dbc.png" alt="placeholder"></li> <li class="landscape"><img src="https://udn.realityripple.com/samples/62/643f590dbc.png" alt="placeholder"></li> <li><img src="https://udn.re...
...alityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li class="landscape"><img src="https://udn.realityripple.com/samples/62/643f590dbc.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> </ul> auto-placement can also help you lay out interface items which do have logical order.
Consistent list indentation - CSS: Cascading Style Sheets
in order to understand why this is the case, and more importantly how to avoid the problem altogether, it's necessary to examine the details of list construction.
...we can ignore <li> altogether for these purposes.
... recommendations when altering the indentation of lists, make sure to set both the padding and margin.
Introducing the CSS Cascade - CSS: Cascading Style Sheets
WebCSSCascade
although some constraints on user-agent stylesheets are set by the html specification, browsers still have a lot of latitude: that means that significant differences exist from one browser to another.
... to simplify the development process, web developers often use a css reset style sheet, forcing common properties values to a known state before beginning to make alterations to suit their specific needs.
... resetting styles after your content has finished altering styles, it may find itself in a situation where it needs to restore them to a known state.
Card - CSS: Cascading Style Sheets
useful fallbacks or alternative methods flexbox could be used to lay out the card, in which case you should make the content area grow, and other items not grow.
... this would be a reasonable way to lay out the card, although i have a slight preference for being able to control the tracks from the container rather than needing to add rules to the items.
...alternatively you could use css multi-col — this would cause the cards to lay out down the columns, which may or may not be a problem.
contain - CSS: Cascading Style Sheets
WebCSScontain
omputed valueas specifiedanimation typediscrete formal syntax none | strict | content | [ size | layout | style | paint ] examples simple layout the markup below consists of a number of articles, each with content: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> each <article> and <img> is given a border, and the images are floated: img { float: left; border: 3px solid black; } article { border: 1px solid black; } float interference if we were to insert another image at the bottom of the first article, a large portion of the dom tree may be re-laid out or repainted, and this would also interfer...
...e with the layout of the second article: <h1>my blog</h1> <article> <h2>heading of a nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" alt="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; } as you can see, because of the way floats work, the first image ends up inside the area of the second article: fixing with contain if we give each article the contain property with a value of content, when new elements are inserted the browser understands it only needs to recalculate the containing element's subtree, and not anything outside it: <h1>my blog</h1> <article> <h2>h...
...eading of a nice article</h2> <p>content here.</p> <img src="i-just-showed-up.jpg" alt="social"> </article> <article> <h2>another heading of another article</h2> <img src="graphic.jpg" alt="photo"> <p>more content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; contain: content; } this also means that the first image no longer floats down to the second article, and instead stays inside it's containing element's bounds: specifications specification status comment css containment module level 1the definition of 'contain' in that specification.
content - CSS: Cascading Style Sheets
WebCSScontent
/* keywords that cannot be combined with other values */ content: normal; content: none; /* <image> values */ content: url("http://www.example.com/test.png"); content: linear-gradient(#e66465, #9198e5); /* alt text for generated content, added in the level 3 specification */ content: url("http://www.example.com/test.png") / "this is the alt text"; /* values below can only be applied to generated content using ::before and ::after */ /* <string> value */ content: "prefix"; /* <counter> values */ content: counter(chapter_counter); content: counters(section_counter, "."); /* attr() value linked to the html attribute value */ content: attr(value...
... <string> specifies the "alt text" for the element.
... working draft adds support for alt-text css level 2 (revision 1)the definition of 'content' in that specification.
font-feature-settings - CSS: Cascading Style Sheets
font-feature-settings: "swsh" 2; font-feature-settings: "smcp", "swsh" 2; /* global values */ font-feature-settings: inherit; font-feature-settings: initial; font-feature-settings: unset; whenever possible, web authors should instead use the font-variant shorthand property or an associated longhand property such as font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric or font-variant-position.
...stylistic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch.
... examples enabling various font features /* use small-cap alternate glyphs */ .smallcaps { font-feature-settings: "smcp" on; } /* convert both upper and lowercase to small caps (affects punctuation also) */ .allsmallcaps { font-feature-settings: "c2sc", "smcp"; } /* use zeros with a slash through them to differentiate from "o" */ .nicezero { font-feature-settings: "zero"; } /* enable historical forms */ .hist { font-feature-settings: "hist"; } /* disable common ligatures, usually on by default */ .noligs {...
object-fit - CSS: Cascading Style Sheets
you can alter the alignment of the replaced element's content object within the element's box using the object-position property.
... formal definition initial valuefillapplies toreplaced elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax fill | contain | cover | none | scale-down examples setting object-fit for an image html <section> <h2>object-fit: fill</h2> <img class="fill" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="fill narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <h2>object-fit: contain</h2> <img class="contain" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="contain narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <h2>object-fit: cover</h2> <img cl...
...ass="cover" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="cover narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <h2>object-fit: none</h2> <img class="none" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="none narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <h2>object-fit: scale-down</h2> <img class="scale-down" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="scale-down narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> </section> css h2 { font-family: courier new, monospace; font-size: 1em; margin: 1em 0 0.3em; } div { display: ...
scrollbar-width - CSS: Cascading Style Sheets
accessibility concerns use this property with caution — setting scrollbar-width to thin or none can make content hard or impossible to scroll if the author does not provide an alternative scrolling mechanism.
... while swiping gestures or mouse wheels can enable scrolling on such content, some devices have no scroll alternative.
...and introduced in wcag 2.1, criterion 2.5.5 (target size) advises that touch targets should be at least 44px in width and height (although the problem is compounded on high-resolution screens; thorough testing is advised).
<time> - CSS: Cascading Style Sheets
WebCSStime
note: although the number 0 is always the same regardless of unit, the unit may not be omitted.
... examples valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital letters are not recommended.
... +0s zero with a leading + and a unit -0ms zero with a leading - and a unit invalid times 0 although unitless zero is allowed for <length>s, it's invalid for <time>s.
Live streaming web audio and video - Developer guides
important: although the <audio> and <video> tags are protocol agnostic, no browser currently supports anything other than http without requiring plugins, although this looks set to change.
... opus opus is a royalty-free and open format that manages to optimize quality at various bit-rates for different types of audio.
... streaming services although you can install software like gstreamer, shoutcast and icecast you will also find a lot of third-party streaming services that will do much of the work for you.
Creating a cross-browser video player - Developer guides
76"> <param name="movie" value="flash-player.swf?videourl=video/tears-of-steel-battle-clip-medium.mp4" /> <param name="allowfullscreen" value="true" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="controlbar=over&amp;image=img/poster.jpg&amp;file=flash-player.swf?videourl=video/tears-of-steel-battle-clip-medium.mp4" /> <img alt="tears of steel poster image" src="img/poster.jpg" width="1024" height="428" title="no video playback possible, please download the video from the link below" /> </object> <!-- offer download --> <a href="video/tears-of-steel-battle-clip-medium.mp4">download mp4</a> </video> <figcaption>&copy; blender foundation | <a href="http://mango.blender.org">mango.blender.org</a></f...
... volume volinc.addeventlistener('click', function(e) { altervolume('+'); }); voldec.addeventlistener('click', function(e) { altervolume('-'); }); two volume control buttons have been defined, one for increasing the volume and another for decreasing it.
... a user defined function, altervolume(direction) has been created that deals with this: var altervolume = function(dir) { var currentvolume = math.floor(video.volume * 10) / 10; if (dir === '+') { if (currentvolume < 1) video.volume += 0.1; } else if (dir === '-') { if (currentvolume > 0) video.volume -= 0.1; } } this function makes use of the media api's volume attribute, which holds the current volume value of the video.
Overview of events and handlers - Developer guides
: " + objkind ); }; and second register our function with the the button object, either on the scripting side using the dom (document object model) representation of the html page: var buttondomelement = document.queryselector('#buttonone'); buttondomelement.addeventlistener('click', example_click_handler); or within the html page by adding the function as the value of the 'onclick' attribute, although this second approach is usually only used in very simple web pages.
... as a second example, much modern javascript integrated into web pages is wrapped into an event function call to ensure that the code is only executed when the html has been processed and is available for alteration or decoration.
... although this list is currently incomplete.
A hybrid approach - Developer guides
however, it can be a pain to use client-side techniques to alter site content to fit the user’s context.
...this keeps the complexity of altering content on the server side, but still allows our layouts to benefit from the flexibility and future-readiness of responsive design.
...if you need to slightly alter the site’s message for mobile users, but want to reap the benefits of a responsive design, a hybrid approach may be your best bet.
HTML attribute reference - HTML: Hypertext Markup Language
alt <applet>, <area>, <img>, <input> alternative text in case an image can't be displayed.
... note: although browsers and email clients may still support this attribute, it is obsolete.
...to represent a false value, the attribute has to be omitted altogether.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
alt a text string alternative to display on browsers that do not display images.
... the text should be phrased so that it presents the user with the same kind of choice as the image would offer when displayed without the alternative text.
...(the w3c 5.3 fork of the html specification defines it as valid, but the canonical html specification doesn’t, and it has no effect in any user agents.) examples <map name="primary"> <area shape="circle" coords="75,75,75" href="left.html" alt="click to go left"> <area shape="circle" coords="275,75,75" href="right.html" alt="click to go right"> </map> <img usemap="#primary" src="https://udn.realityripple.com/samples/6a/7e559101b3.png" alt="350 x 150 pic"> result specifications specification status comment referrer policythe definition of 'referrerpolicy attribute' in that specification.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
usage notes alternative content you may (and should) provide alternate content inside the <canvas> block.
... <canvas width="300" height="300"> an alternative text describing what your canvas displays.
... </canvas> javascript then in the javascript code, call htmlcanvaselement.getcontext() to get a drawing context and start drawing onto the canvas: const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); result accessibility concerns alternative content the <canvas> element on its own is just a bitmap and does not provide information about any drawn objects.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
when used on a <link rel="stylesheet"> it defines a preferred or an alternate stylesheet.
... examples including a stylesheet to include a stylesheet in a page, use the following syntax: <link href="style.css" rel="stylesheet"> providing alternative stylesheets you can also specify alternative style sheets.
... <link href="default.css" rel="stylesheet" title="default style"> <link href="fancy.css" rel="alternate stylesheet" title="fancy"> <link href="basic.css" rel="alternate stylesheet" title="basic"> providing icons for different usage contexts you can include links to several different icons on the same page, and the browser will choose which one works best for its particular context using the rel and sizes values as hints.
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmarquee
possible values are scroll, slide and alternate.
...it can only fire when the behavior attribute is set to alternate.
... examples <marquee>this text will scroll from right to left</marquee> <marquee direction="up">this text will scroll from bottom to top</marquee> <marquee direction="down" width="250" height="200" behavior="alternate" style="border:solid"> <marquee behavior="alternate"> this text will bounce </marquee> </marquee> specifications specification status comment html living standardthe definition of '<marquee>' in that specification.
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<picture> the html <picture> element contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios.
... demarcating edits these elements let you provide indications that specific parts of the text have been altered.
... <noembed> the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use.
Identifying resources on the Web - HTTP
there are sometimes reasons identity and location are not given by the same uri: http uses a specific http header, alt-svc when the resource requested wants the client to access it at another location.
...alternatively, it is possible to directly use an ip address, but because it is less convenient, it is not often used on the web.
... ftp is still acceptable at the top level (such as typed directly into the browser's url bar, or the target of a link), although some browsers may delegate loading ftp content to another application.
Content negotiation - HTTP
html5 provides alternatives to content negotiation via, for example, the <source> element.
... over the years, other content negotiation proposals, like transparent content negotiation and the alternates header, have been proposed.
...in this negotiation, when facing an ambiguous request, the server sends back a page containing links to the available alternative resources.
Forwarded - HTTP
the forwarded header contains information from the reverse proxy servers that is altered or lost when a proxy is involved in the path of the request.
... the alternative and de-facto standard versions of this header are the x-forwarded-for, x-forwarded-host and x-forwarded-proto headers.
... header type request header forbidden header name no syntax forwarded: by=<identifier>;for=<identifier>;host=<host>;proto=<http|https> directives <identifier> an identifier disclosing the information that is altered or lost when using a proxy.
X-Frame-Options - HTTP
the spec leaves it up to browser vendors to decide whether this option applies to the top level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin (see bug 725490).
... configuring haproxy to configure haproxy to send the x-frame-options header, add this to your front-end, listen, or backend configuration: rspadd x-frame-options:\ sameorigin alternatively, in newer versions: http-response set-header x-frame-options sameorigin configuring express to configure express to send the x-frame-options header, you can use helmet which uses frameguard to set the header.
... add this to your server configuration: const helmet = require('helmet'); const app = express(); app.use(helmet.frameguard({ action: 'sameorigin' })); alternatively, you can use frameguard directly: const frameguard = require('frameguard') app.use(frameguard({ action: 'sameorigin' })) specifications specification title rfc 7034 http header field x-frame-options ...
HTTP headers - HTTP
WebHTTPHeaders
content-location indicates an alternate location for the returned data.
... proxies forwarded contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request.
... alt-svc used to list alternate ways to reach this service.
Redirections in HTTP - HTTP
machine-readable choices are encouraged to be sent as link headers with rel=alternate.
... alternative way of specifying redirections http redirects aren't the only way to define redirections.
...but there are reasons for alternative names for a resource: expanding the reach of your site a common case is when a site resides at www.example.com, but accessing it from example.com should also work.
Grammar and types - JavaScript
and object although these data types are relatively few, they enable you to perform useful functions with your applications.
... parseint('101', 2) // 5 an alternative method of retrieving a number from a string is with the + (unary plus) operator: '1.1' + '1.1' // '1.11.1' (+'1.1') + (+'1.1') // 2.2 // note: the parentheses are added for clarity, not required.
... although javascript does not have "heredoc" syntax, you can get close by adding a line break escape and an escaped line break at the end of each line: var poem = 'roses are red,\n\ violets are blue.\n\ sugar is sweet,\n\ and so is foo.' ecmascript 2015 introduces a new type of literal, namely template literals.
Introduction - JavaScript
there are also more advanced server side versions of javascript such as node.js, which allow you to add more functionality to a website than simply downloading files (such as realtime collaboration between multiple computers).
...although the description of the language may differ in ecmascript, the language itself remains the same.
...for the sake of simplicity, it can be imagined that every time something is entered into the console, it is actually surrounded by console.log around eval, like so: function greetme(yourname) { alert("hello " + yourname) } console.log(eval('3 + 5')) multi-line input in the web console the single-line input mode of the web console is great for quick testing of javascript expressions, but although you can execute multiple lines, it's not very convenient for that.
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
javascript execution won't be halted.
...märz 2017" alternative standard syntax using the ecmascript intl api the ecma-402 (ecmascript intl api) standard specifies standard objects and methods that enable language sensitive date and time formatting (available in chrome 24+, firefox 29+, ie11+, safari10+).
...mai 2014" alternative standard syntax using date methods the date object offers several methods to build a custom date string.
TypeError: invalid assignment to const "x" - JavaScript
the javascript exception "invalid assignment to const" occurs when it was attempted to alter a constant value.
... a constant is a value that cannot be altered by the program during normal execution.
...for instance, in case the content is an object, this means the object itself can still be altered.
Object.prototype.__proto__ - JavaScript
the effects on the performance of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in obj.__proto__ = ...
... statements, but may extend to any code that has access to any object whose [[prototype]] has been altered.
... the __proto__ property can also be used in an object literal definition to set the object [[prototype]] on creation, as an alternative to object.create().
encodeURIComponent() - JavaScript
// note that although rfc3986 reserves "!", rfc5987 does not, // so we do not need to escape it replace(/['()]/g, escape).
... // the following are not required for percent-encoding per rfc5987, // so we can allow for a little better readability over the wire: |`^ replace(/%(?:7c|60|5e)/g, unescape); } // here is an alternative to the above function function encoderfc5987valuechars2(str) { return encodeuricomponent(str).
... // note that although rfc3986 reserves "!", rfc5987 does not, // so we do not need to escape it replace(/['()*]/g, c => "%" + c.charcodeat(0).tostring(16)).
eval() - JavaScript
eval() is also slower than the alternatives, since it has to invoke the javascript interpreter, while many other constructs are optimized by modern js engines.
... fortunately, there's a very good alternative to eval(): simply using window.function().
... console.log(function('"use strict";return(function(a){return a(5)})')()(function(a){ return"monday tuesday wednesday thursday friday saturday sunday".split(" ")[a%7||0]})); there are also additional safer (and faster!) alternatives to eval() or function() for common use-cases.
undefined - JavaScript
typeof operator and undefined alternatively, typeof can be used: var x; if (typeof x === 'undefined') { // these statements execute } one reason to use typeof is that it does not throw an error if the variable has not been declared.
... // x has not been declared before if (typeof x === 'undefined') { // evaluates to true without errors // these statements execute } if (x === undefined) { // throws a referenceerror } however, there is another alternative.
... the global scope is bound to the global object, so checking the existence of a variable in the global context can be done by checking the existence of a property on the global object, using the in operator, for instance: if ('x' in window) { // these statements execute only if x is defined globally } void operator and undefined the void operator is a third alternative.
Strict mode - JavaScript
in normal javascript mistyping a variable in an assignment creates a new property on the global object and continues to "work" (although future failure is possible: likely, in modern javascript).
... x; } the simple alternative of assigning the object to a short name variable, then accessing the corresponding property on that variable, stands ready to replace with.
...strict mode makes great strides toward treating eval and arguments as keywords, although full fixes will not come until a future edition of ecmascript.
Media container formats (file types) - Web media technologies
on mac os, the quicktime framework not only supported quicktime format movie files and codecs, but supported a vast array of popular and specialty audio and video codecs, as well as still image formats.
...it's based entirely on free and open technologies and primarily uses codecs that are in turn free and open, although some products support other codecs in webm containers as well.
...it's no longer necessary to choose between mp3's broad compatibility and the need to pay royalties when using it.
fill - SVG: Scalable Vector Graphics
WebSVGAttributefill
as a presentation attribute, it can be applied to any element but it only has an effect on the following eleven elements: <altglyph>, <circle>, <ellipse>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan>.
... --> <circle cx="250" cy="50" r="20"> <animate attributetype="xml" attributename="r" from="0" to="40" dur="5s" fill="freeze" /> </circle> </svg> altglyph warning: as of svg2 <altglyph> is deprecated and shouldn't be used.
... for <altglyph>, fill is a presentation attribute that defines the color of the glyph.
format - SVG: Scalable Vector Graphics
WebSVGAttributeformat
two elements are using this attribute: <altglyph> and <glyphref> context notes value <string> default value none animatable no <string> this value specifies the format of the given font.
... recommendation initial definition for <glyphref> scalable vector graphics (svg) 1.1 (second edition)the definition of 'format for <altglyph>' in that specification.
... recommendation initial definition for <altglyph> ...
glyphRef - SVG: Scalable Vector Graphics
two elements are using this attribute: <altglyph> and <glyphref> usage notes value <string> default value none animatable yes <string> this value represents the glyph identifier.
... recommendation initial definition for <glyphref> scalable vector graphics (svg) 1.1 (second edition)the definition of 'altglyph for <altglyph>' in that specification.
... recommendation initial definition for <altglyph> ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
recently implemented bindings: selectsubstring altglyph implemented as tspans, no font features as of gecko 2.0 (bug 456286, bug 571808).
... altglyphdef not implemented.
... altglyphitem not implemented.
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
it is often placed at the end of a path node, although not always.
...there is no real performance penalty or bonus for using one or the other.
... <svg width="190" height="160" xmlns="http://www.w3.org/2000/svg"> <path d="m 10 80 q 52.5 10, 95 80 t 180 80" stroke="black" fill="transparent"/> </svg> both curves produce similar results, although the cubic one allows greater freedom in exactly what the curve looks like.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
the example allows sorting the content multiple times, alternating between ascending and descending order.
...the sorting would have to alternate between ascending and descending sorting.
... 25 <xsl:choose> element, reference, xslt, choose the <xsl:choose> element defines a choice among a number of alternatives.
Communicating using "postMessage" - Archive of obsolete content
as an alternative to port, content modules support the built-in message event.
...to simplify this most content modules provide an onmessage property as an argument to the constructor: panel = require("sdk/panel").panel({ onmessage: function(contentscriptmessage) { // handle message from the content script } }); message events versus user-defined events you can use message events as an alternative to user-defined events: var pagemodscript = "window.addeventlistener('mouseover', function(event) {" + " self.postmessage(event.target.tostring());" + "}, false);"; var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.on('message', function(message) { con...
core/promise - Archive of obsolete content
another simple example may be a delay function that returns a promise which is fulfilled with a given value after a given time ms -- kind of promise based alternative to settimeout: function delay(ms, value) { let { promise, resolve } = defer(); settimeout(resolve, ms, value); return promise; } delay(10, 'hello world').then(console.log); // after 10ms => 'helo world' advanced usage if general defer and promised should be enough to doing almost anything you may think of with promises, but once you start using promises extensively you may disco...
...ases it's useful to put a timer on such tasks: function timeout(promise, ms) { let deferred = defer(); promise.then(deferred.resolve, deferred.reject); delay(ms, 'timeout').then(deferred.reject); return deferred.promise; } var tweets = readasync(url); timeout(tweets, 20).then(function(data) { ui.display(data); }, function() { alert('network is being too slow, try again later'); }); alternative promise apis there may be cases where you will want to provide more than just then method on your promises.
ui/button/toggle - Archive of obsolete content
for example, here's a button that makes click events update checked globally, and not just for the current window: var { togglebutton } = require('sdk/ui/button/toggle'); var globaltoggle = togglebutton({ id: 'my-global-toggle', label: 'global', icon: './foo.png', onchange: function() { // delete the window state for the current window, // automatically set when the user click on the button this.state('window', null); // now that the state hierarchy is clean, set the global state this.checked = !this.checked; } }); here's a button that makes cl...
...this is an alternative way to set or get the global state.
Localization - Archive of obsolete content
hello_id= <blink>hello!</blink> localizing element attributes this feature is new in firefox 39 you can localize certain attributes of elements with an l10n-id by setting its value with l10n-id.attributename in the properties file like: hello_id.accesskey= h the following attributes are supported: accesskey alt label title placeholder further the localization of the aria attributes aria-label, aria-valuetext and aria-moz-hint are supported with the same aliases as on firefox os: arialabel ariavaluetext ariamozhint using localized strings in javascript to reference localized strings from your main add-on code, you do this: var _ = require("sdk/l10n").get; console.log(_("hello_id")); assign...
...other": one → n is 1; other → everything else russian uses four forms, that can be described as follows: one → n mod 10 is 1 and n mod 100 is not 11; few → n mod 10 in 2..4 and n mod 100 not in 12..14; many → n mod 10 is 0 or n mod 10 in 5..9 or n mod 100 in 11..14; other → everything else plural rules for all languages can be found in the cldr language plural rules page (although this table is out of date compared to the cldr xml source).
Finding window handles - Archive of obsolete content
typically the top level browser window hwnd has no children, although if there are windowed plugins (such as flash) visible in the window, they will have hwnds whose parent is the top level browser window hwnd.
...hod above, by using this method, you don't have to compile your component with nsiwidget.h and other bunchs of h files that should not be exposed to outside, and could change every time firefox updates, all you need is nsibasewindow.idl(it's not in gecko_sdk, get this from the latest firefox source, or http://mxr.mozilla.org/mozilla/sourc...basewindow.idl), and use xpidl to compile it to .h file, although that's stll a unfrozen interface, but it should be a lot better.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
there is a wealth of material on creating extensions for firefox.
...the main directory and each subdirectory must contain a makefile.in (from now on i'll just refer to this file as a makefile although we know that it is actually used to generate the real makefile).
Extension Versioning, Update and Compatibility - Archive of obsolete content
--> <em:signature>migtma0gcsqgsib3dqebbquaa4gbamo1o2gwsccth1gwymgscfanakpn40pjfowt ub2hvdg8+oxmcif8d/9evwm8eh/ixuxyzlmrzts3o5tv9eway5ubctqdf1wgtsgk jrgzow1fitkzi7w0//c8ekdmlatguegfns2iltd5p/0kh/hf1rpc1wuqeqkcd4+l bcvq13ad</em:signature> </rdf:description> </rdf:rdf> some people prefer this alternate format (note that much of the information has been trimmed from this example for brevity in order to show the basic structure): <?xml version="1.0" encoding="utf-8"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <!-- this description resource includes all the update and compatibility information for a s...
...you may also use the other substitution strings supported by updateurl, although those may be less useful.
Appendix: What you should know about open-source software licenses - Archive of obsolete content
the software that microsoft sells, such as windows, comes with a license that permits only limited duplication in exchange for a fee, so, although customers can install it on their computers, they cannot modify it.
...thanks to the internet, published source code can be used all over the world, so the language that the most people will be able to understand is chosen as the language for the license (although this may reflect a western bias).
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
this should halt the program at the spot where you inserted the breakpoint with venkman, and start the debugger.
... once you’ve finished your inspection, you can continue and let the halted program resume execution.
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
<window id="main-window"> <toolbox id="navigator-toolbox"> <toolbar id="xulschoolhello-toolbar" toolbarname="&xulschoolhello.toolbarname.label;" accesskey="&xulschoolhello.toolbar.accesskey;" customizable="true" mode="icons" context="toolbar-context-menu" defaultset="xulschoolhello-hello-world-button" insertbefore="personaltoolbar" /> </toolbox> </window> (note for mac os x: <window id="main-window"> and </window> are not required) our toolbar is added as a child of the toolbox element in the main browser window.
...keep in mind that you shouldn't assume anything about the location (or presence!) of any specific buttons; remember users could have moved them or removed them altogether.
Adding sidebars - Archive of obsolete content
there are ways to limit the size boundaries of your sidebar with css or even disable resizing altogether, but none of those are good practices.
...the alternative is to use a deck with the two labels, and change the selected index depending on the purpose of the window.
Appendix D: Loading Scripts - Archive of obsolete content
although wary authors can choose to cache instances of their modules so that modules are loaded only once globally, this method can be easily misused to re-load scripts for each new window where they would be better loaded only once globally per session.
...although wary authors can choose to cache instances of their modules so that modules are loaded only once globally, this method can be easily misused to re-load scripts for each new window where they would be better loaded only once globally per session.
Handling Preferences - Archive of obsolete content
incorrect values can make firefox behave oddly or break altogether.
... to add preferences to your extension you should first create a js preferences file that describes the preferences and their default values, although setting defaults is not required.
Setting Up a Development Environment - Archive of obsolete content
you may need to alter the profile location in your makefile.
...you can even change styles, attributes and execute javascript code in it, although that's not completely reliable.
The Essentials of an Extension - Archive of obsolete content
it is somewhat inflexible so it can't be used for dynamically generated text, hence the need for an alternate way of getting localized strings.
...you cannot dynamically change an attribute value with a new dtd key, you have to set the new value directly: let helloitem = document.getelementbyid("xulschoolhello-hello-menu-item"); // the alert will say "hello world!" alert(helloitem.getattribute("label")); // wrong helloitem.setattribute("label", "&xulschoolhello.hello2.label;"); // better helloitem.setattribute("label", "alternate message"); // right!
User Notifications and Alerts - Archive of obsolete content
this section lists a few alternatives that give you the possibility of notifying the user and requesting action without being too annoying.
...you should use the 2 alternatives mentioned above whenever possible.
XPCOM Objects - Archive of obsolete content
const cc = components.classes; const ci = components.interfaces; const cr = components.results; const ce = components.exception; you should be familiar with this already, although there are a couple of additions, components.results and components.exception.
...the ";1" at the end of the string is supposed to indicate the version of the component, although it shouldn't change much.
Session store API - Archive of obsolete content
if your extension wants to be able to restore data when tabs are restored, you can install a listener like this: function myextensionhandlerestore(aevent) { var tab = event.originaltarget; /* the tab being restored */ var uri = tab.linkedbrowser.contentdocument.location; /* the tab's uri */ components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage("restoring tab: " + uri); }; document.addeventlistener("sstabrestoring", myextensionhandlerestore, false); simply replace the co...
...you can determine which tab is being restored by looking at the event's originaltarget field.
Signing an XPI - Archive of obsolete content
an alternative is to use winrar.
... alternatives to nss/signtool there are several alternatives to using signtool that might suit your needs better, however please note that these alternatives are unofficial third party products.
Adding preferences to an extension - Archive of obsolete content
when events occur, such as a preference being altered, our observe() method will be called automatically.
... alternative method: inline options requires gecko 7(firefox 7 / thunderbird 7 / seamonkey 2.4) you could use inline options for this preference.
Images, Tables, and Mysterious Gaps - Archive of obsolete content
alternatively, you could class table cells instead of rows, if that's a better choice for you.
... using vertical alignment the other main choice is leave the image inline and alter the vertical alignment of the image with respect to the line box.
Source code directories overview - Archive of obsolete content
although not required, these common names are typically used for a common purpose.
...xpcom is compatible and very similar to microsoft com (although xpcom is cross-platform).
Making a Mozilla installation modifiable - Archive of obsolete content
although jar archives are binary files, mozilla's ui is not compiled into machine code; mozilla instead builds its ui from the non-compiled files in the archive each time it starts up.
...although mozilla stores the ui files in jar archives, it can also access them in their original, unarchived form, which is useful for the extensions developer because it makes it unnecessary to extract the files from the archive before changing the code and then re-add them to the archive afterwards.
Installing Dehydra - Archive of obsolete content
(alternately, build from source) a modern linux distribution.
...cd $home # obtain gcc 4.5.3 (see http://gcc.gnu.org/mirrors.html for alternate mirrors) wget http://www.netgull.com/gcc/releases/gcc-4.5.3/gcc-4.5.3.tar.bz2 tar -jxvf gcc-4.5.3.tar.bz2 # apply plugin_finish_decl patch wget https://bug559964.bugzilla.mozilla.o....cgi?id=457606 -o finish_decl.diff cd gcc-4.5.3 patch -p0 < ../finish_decl.diff # build gcc cd ..
Microsummary XML grammar reference - Archive of obsolete content
note: although the <template> element must be in the microsummaries namespace (http://www.mozilla.org/microsummaries/0.1), its <stylesheet>/<transform> child element must be in the xslt namespace (http://www.w3.org/1999/xsl/transform).
...5.5 minutes) are permitted, although they probably aren't useful.
Modularization techniques - Archive of obsolete content
/* * the nsisupports interface */ class nsisupports { public: ns_imethod queryinterface(const nsiid &aiid, void **aresult) = 0; ns_imethod_(nsrefcnt) addref(void) = 0; ns_imethod_(nsrefcnt) release(void) = 0; }; the ns_imethod and ns_imethod_(type) macros are basically shorthand for virtual nsresult and virtualtype.
...a static object would chose to ignore reference counts altogether.
Monitoring downloads - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it was possible to do so in previous versions of firefox, it was previously only possible for one observer to do so at a time.
New Security Model for Web Services - Archive of obsolete content
securing resources from untrusted scripts behind firewalls introduction this page describes an alternative mechanism which can be used to protect all internal resources against requests from sandboxed scripts.
...where a server spans multiple owners, the alternative would be to scan all directories in the path looking for a web scripts access file, which seems undesirable.
New Skin Notes - Archive of obsolete content
see for example the venkman tutorials (although the clears are down the page) or mdc:frequently asked questions.
... skin designed with simplicity in mind -- minimal header, nav, footer -- plausibly good for alternate or small screen display, or people who prefer more straight-up formatting for on-screen docs.
RDF Datasource How-To - Archive of obsolete content
although this is more work, it is really the only way to create a "live" datasource that may be changed by some outside agent.
...you'll probably need to choose this implementation if your datasource is "live", and may be modified or altered by some outside agent (e.g., new mail arriving).
Frequently Asked Questions - Archive of obsolete content
alternatively, if you're an svg user you can help by testing the svg enabled nightlies and filing bugs with minimal testcases whenever you encounter a problem.
...alternatively you can email any of us directly of course (see the preceeding question for our email addresses).
Using cross commit - Archive of obsolete content
(although it works without specifying -m on the command line if you are using x-enabled emacs on linux.) also note that if you don't specify any branches to commit on, cross-commit will commit to the trunk and the mozilla_1_8_branch by default.
... details cross-commit accepts the following options: all cvs options (those to the left of the specific cvs command) and cvs commit options (those to the right of a commit command), although the -r and -f cvs options need to be specified as --cvs-r and --cvs-f to avoid conflict with the similarly named (but different in meaning) cvs commit options.
Venkman Introduction - Archive of obsolete content
alternately, you can select animator-0.03.js from the loaded scripts view, locate the pause function at line 119, and click in the left margin.
... debugging extensions although at first glance it might seem that venkman cannot debug extensions, doing so is in fact fully supported; it's just disabled by default.
Writing textual data - Archive of obsolete content
os.close(); you can also write character arrays using the write function, although using writestring is simpler from javascript code.
... alternative ways usable from javascript do not support character encodings that use embedded nulls (such as utf-16 and utf-32).
Anonymous Content - Archive of obsolete content
the original anonymous content responsible for the event can be obtained from a new field of the event object: originaltarget.
...style rules using the child, descendant, or sibling selectors transparently cross bind scopes and operate on the altered and original content models.
Binding Attachment and Detachment - Archive of obsolete content
methods and properties with getters/setters are no longer accessible from the binding, although properties with raw values remain.
...therefore new binding definitions can be generated dynamically or the anonymous content templates for bindings can be altered and used by the bound document.
Binding Implementations - Archive of obsolete content
it can be assumed that the anonymous content of the binding has been fully constructed, although the bindingattached event will not have fired.
...when set to true, the property's value cannot be altered.
XUL Events - Archive of obsolete content
this is an alternative to checking the detail property in the click event.
...see mutation events for more details and mutation observers for a more efficient alternative.
Reading from Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
...while(stream.available()) output += stream.readstring(20); although this can be a suitable means of reading binary data, usually you will want to retrieve the data with some additional methods that are more useful.
Introduction to XUL - Archive of obsolete content
you can load as many style sheets as you wish using repeated processing directives, although you should always make sure to load the xul.css file initially.
... internationalization for practical reasons, the locale-specific attributes of a ui description would be most happily developed (and possibly distributed) in separate files, where localization can be performed by altering only a subset of the ui description devoted expressly to localization issues.
ContextMenus - Archive of obsolete content
although there are several ways to open a context menu, a single event may be used to listen for any of these situations; the 'contextmenu' event is fired in any case.
... another alternative is to disable the menuitem instead of hiding it, by setting the item's disabled property.
MenuItems - Archive of obsolete content
although there isn't usually a need to do so, you can also set a custom label for the keyboard shortcut on the menu using the acceltext attribute.
...although the exact size will vary depending on the theme being used, the size of menu item images should generally be around 16 by 16 pixels.
Menus - Archive of obsolete content
<menu label="file" accesskey="f"/> this menu can then be opened by pressing the access key (typically in combination with the alt key).
...although the access keys are not case sensitive, the underlined letter will always be the one with matching case if available.
OpenClose - Archive of obsolete content
there isn't a means of replicating this action with the keyboard, so you should always provide an alternate means of accessing the functionality of the menu.
... this can be done by either placing alternate commands elsewhere in the user interface, or by providing a keyboard shortcut to open the menu.
Introduction - Archive of obsolete content
if the datasource is already loaded, the builder can construct content all in one step, although even this isn't completely true as we'll see later.
...although we'll look at the details of this later, the simple result here is that a listitem will be generated for each child node in the xml data, setting the label to the name attribute for each xml node.
Simple Query Syntax - Archive of obsolete content
simple rdf graph navigation such as this is common, so the simpler syntax is usually used in this situation since it avoids extra tags, although the simple syntax is not more or less efficient, at least when a single query is involved.
...in the simple syntax, the builder will use the default query shown above, although the variable names are randomly generated.
Template Builder Interface - Archive of obsolete content
the builder property is a property of the nsidomxulelement interface, so all xul elements will have this property, although, as mentioned earlier, is will be set to null for most elements.
...due to the nature of the way templates are updated, you don't usually need to rebuild a template after a refresh call, although there may situtations where this will be necessary.
Tree Widget Changes - Archive of obsolete content
that means that the ids can be left out, although it's probably a good idea to use them anyway.
... currently, only checkbox columns support editing, although the content-based tree handles the nsitreeview.setcellvalue() and nsitreeview.setcelltext() functions to change the tree content with a script for other types of cells.
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
this should be set to one of the values set below: alt the user must press the alt key.
...the following alternate syntax can be used when the code in a handler is more complex: <binding id="binding-name"> <handlers> <handler event="event-name"> -- handler code goes here -- </handler> </handlers> </binding> handlers example the following example adds some key handlers to create a very primitive local clipboard: example 1 : source <binding id="clipbox"> <content> <xul:textbox/> ...
Advanced Rules - Archive of obsolete content
full rules contain three child tags, a conditions tag, a bindings tag and an action tag, although the bindings tag is not always needed.
...in rdf terms, that means a container such a seq, bag or alt.
Anonymous Content - Archive of obsolete content
presumably this binding would be bound to a scroll bar, although it doesn't have to be.
...although anonymous content is displayed on screen, you cannot get to it through a script in the normal way.
Broadcasters and Observers - Archive of obsolete content
we would need to disable the back command on the menu, the back button on the toolbar, the keyboard shortcut (alt+left for example) and any back commands on popup menus.
... although we could write a script to do this, it is quite tedious.
Content Panels - Archive of obsolete content
first, each window could appear in a different location (although there are ways around this).
...this url may point to any kind of file, although it will usually point to an html file or another xul file.
Document Object Model - Archive of obsolete content
although there is only ever one document associated with a window at a time, you may load additional documents using various methods.
... the window is often referred to using the window property, although this is optional.
Groupboxes - Archive of obsolete content
the groupbox is displayed in a special way—usually with a beveled border and a caption, although you can change the appearance using css.
...although any content can be used, usually you would use a checkbox or dropdown menu.
Introduction to RDF - Archive of obsolete content
alternatively, data in other formats can be used and code written that will read the file and create rdf data from it.
...instead of the seq element, you can also use bag to indicate unordered data, and alt to indicate data where each record specifies alternative values (such as mirror urls).
RDF Datasources - Archive of obsolete content
they work very similarly to the bookmarks, although the fields will be different in each case.
... nc:personaltoolbarfolder the bookmark folder that corresponds to the personal toolbar folder.
Styling a Tree - Archive of obsolete content
you can think of the properties as functioning much like style classes, although they require a somewhat more complex syntax to use in a style sheet.
...this property, along with the even property allow you to set, for example, alternating colors for each row.
Tabboxes - Archive of obsolete content
this alters the appearance of the currently selected tab to make it look selected.
...alternatively, you could set the dir attribute to reverse on the tabbox.
Trees and Templates - Archive of obsolete content
although the tree builder doesn't build these elements, it does require this structure in order to determine what to generate correctly.
...this sorting feature is not available for trees with static content, although you can write a script to sort the data.
XUL Accesskey FAQ and Policies - Archive of obsolete content
on windows and unix, pressing alt+a is a convenient way to push that button.
... on macintosh, accesskeys are available only in html not in xul, and they are activated using ctrl+letter instead of alt.
XUL Questions and Answers - Archive of obsolete content
(server can just send the xul code to use for popup - alternatively it can send generic xml describing the attributes of the items in the menu and you generate the xul on client by applying an xslt transform.) can i change a xul tree cell/row/item background color with javascript?
... you should be able to use a xul template to display feeds, although you may have to write the feed data to an rdf datasource first.
Accessibility/XUL Accessibility Reference - Archive of obsolete content
although tutorials claim label and description have the same underlying implementation, description elements appear to not associate correctly with controls whereas labels do.
... grid although text in the grid can be read, jaws does not recognize grids as tables for table reading mode.
XUL accessibility tool - Archive of obsolete content
use to launch the tool after installation, look for an entry in the tools menu of the host application, or hit ctrl+alt+shift+f12.
...ready have this for menus) (aaronlev) error: form control without accesskey (aaronlev) warning: accesskey as lowercase letter with descender (underlined g,j,y,q,p are hard to read, not recommended) (aaronandy) list of things to check manually, such as a list oftrees in the document (make sure they have accessible column picker equivs) or a list of toolbarbuttons (make sure they have accessible alternatives).
The Implementation of the Application Object Model - Archive of obsolete content
rdf (pronounced r-d-f) has never been a ravening demon intent upon taking over the earth, although that does depend on who you ask.
...the resultant file, although still relatively easy to manipulate, is bloated needlessly with extra syntax that is not strictly necessary.
tabpanels - Archive of obsolete content
the tabpanels element should be placed in a tabbox although it does not have to be a direct child.
...in most cases you would use a vbox, but they can be any element, although some people like to use tabpanel elements.
tree - Archive of obsolete content
ArchiveMozillaXULtree
relevant accessbility guidelines provide alternative access (for example, via menus) to column picker and for header behaviors like sorting (these have no default keyboard access).
... interfaces nsiaccessibleprovider, nsidomxultreeelement, nsidomxulmultiselectcontrolelement script examples to have alternating colors for each row, use the style rules like the following: treechildren::-moz-tree-row(selected) { background-color: #ffffaa; } treechildren::-moz-tree-row(odd) { background-color: #eeeeee; } treechildren::-moz-tree-row(odd, selected) { background-color: #ffffaa; } treechildren::-moz-tree-cell-text(selected) { color: #000000; } treechildren::-moz-tree-cell-text(odd, selected) { color: ...
treecol - Archive of obsolete content
in the case, clicking on a cell in the column will alternate its state between on and off.
...if no column has the primary attribute set to true, the tree may still contain nested rows, although no indication will be given to the user.
Building XULRunner with Python - Archive of obsolete content
you should also read the the developer documentation on source code and building as wells as pyxpcom xulrunner with python promises to be a good platform for accessibility projects and both jambu alternative input and the iaccessible2 test tool are using it.
...the alternative is to build python with msvc8 as well asmozilla, but that may be problematic.
Mozilla release FAQ - Archive of obsolete content
the 'classic' branch of the current cvs tree is as close to the 4.x source as the public will ever see, although that branch has been abandoned in the move to the modern codebase.
...alternatively, post a bug on the faq to bugzilla.
2006-11-10 - Archive of obsolete content
access keys in firefox 2 previous versions of firefox used the <alt> key as a modifier.
... this has been changed to alt+shift for content accesskeys due to the "conflicts with ui mnemonics" according to aaron leventhal.
NPN_SetValue - Archive of obsolete content
the alternative is windowless where no window messages are sent to the plugin as there is no window associated with it.
...although the function prototype has type of value void *, the actual boolean should be placed there, not a pointer to a boolean.
Getting Started - Archive of obsolete content
how to use this tutorial although each page in this tutorial has been written so that it can act as a "standalone" tutorial, it does assume you already possess the knowledge of the information taught in previous pages of this tutorial.
... although you may jump to any point in the tutorial that you wish, we suggest that rss beginners read this tutorial in order.
Digital Signatures - Archive of obsolete content
any change in the data, even deleting or altering a single character, results in a different value.
...(information about the hashing algorithm used is sent with the digital signature, although this isn't shown in the figure.) finally, the receiving software compares the new hash against the original hash.
Vulnerabilities - Archive of obsolete content
a security configuration setting is an element of a software’s security that can be altered through the software itself.
...the key difference is that for a misuse vulnerability, the configuration setting enables or disables the entire feature and does not specifically alter just its security; for a security configuration issue vulnerability, the configuration setting alters only the software’s security.
Theme changes in Firefox 4 - Archive of obsolete content
bookmarks toolbar #personaltoolbar small tab bar #tabstoolbar small add-on bar #addon-bar small custom toolbars some other value small or large depending on user preference.
...thus, it includes this rule in browser.css: #nav-bar { counter-reset: smallicons; } to use large icons for add-on buttons in the bookmarks toolbar when the related user preference is set: #navigator-toolbox[iconsize="large"] > #personaltoolbar { counter-reset: largeicons; } to use large icons everywhere, including the menu bar, regardless of the user preference: #navigator-toolbox > toolbar, #addon-bar { counter-reset: largeicons; } creating a theme that works for firefox 4 on mac os x create a new directory (for example, my_theme).
Scratchpad - Archive of obsolete content
as an alternative, starting in firefox 71, you can use the multi-line mode of the javascript console input.
...md + x ctrl + x copy ctrl + c cmd + c ctrl + c paste ctrl + v cmd + v ctrl + v undo ctrl + z cmd + z ctrl + z redo ctrl + shift + z / ctrl + y cmd + shift + z / cmd + y ctrl + shift + z / ctrl + y indent tab tab tab unindent shift + tab shift + tab shift + tab move line(s) up alt + up alt + up alt + up move line(s) down alt + down alt + down alt + down comment/uncomment line(s) ctrl + / cmd + / ctrl + / ...
CSS - Archive of obsolete content
ArchiveWebCSS
a slider control is one possible representation of <input type="range">.::-ms-revealthe ::-ms-reveal css pseudo-element is a microsoft extension that is used to display a password reveal button for use with a password field created by <input type="password">.
... the user presses the button to reveal the actual field value rather than asterisks.::-ms-thumbthe ::-ms-thumb css pseudo-element is a microsoft extension that represents the thumb that the user moves within the track of a slider control to alter its numerical value.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
<div class="card"> <img src="thumb_clown_trigger.jpg" alt="clown trigger" border="0" width="150" height="115"> <h3>clown trigger</h3> <p> our clown trigger is a bold little fish, though for a few weeks he slept a lot and didn't look well in general.
...although this design approach was abandoned fairly quickly, the class name stuck, kind of like a barnacle.
Writing JavaScript for XHTML - Archive of obsolete content
alternatively, the cdata section can be couched within comments so as to be able to work in either application/xhtml+xml or text/html: <script type="text/javascript"> //<![cdata[ ...
...although this feature is not free of critics, you can use it to bypass the non-existing cookie, if your document is of type xml.
XForms Repeat Element - Archive of obsolete content
the most useful actions for altering the contents of a repeat are the insert (see the spec), delete (see the spec) and setindex (see the spec) elements.
...to accommodate this, xforms 1.0 defines an alternative syntax that is functionally equivalent to the repeat element, using the following attributes: repeat-model repeat-bind repeat-nodeset repeat-startindex repeat-number additionally, when using xforms action setindex, its repeat attribute (which contains an idref) can point to any element carrying these repeat attributes.
Archived open Web documentation - Archive of obsolete content
the goal is to provide an alternative, simpler syntax for accessing xml documents than via dom interfaces.
... a valid alternative to e4x is a non-native jxon algorithm.
Issues Arising From Arbitrary-Element hover - Archive of obsolete content
thus, although authors are used to thinking of these states as applying exclusively to hyperlinks, they are not so restricted by css2.
...although authors may intend the selector a:hover to apply only to hyperlinks, it will also apply to named anchors, since the selector merely states that any a element which is in a hover state will be styled.
The Business Benefits of Web Standards - Archive of obsolete content
that has been the real impact of the zen garden, in helping to demonstrate the stunning results which are possible without altering the markup, and indeed keeping the amount of presentational markup to an acceptable minimum.
...although in some ways a controversial move - the announcement has attracted widespread support from leading developers and standards advocates, led by jeffrey zeldman.
Windows Media in Netscape - Archive of obsolete content
for example: mozilla/5.0 (windows; u; windows nt 5.1; en-us; rv:1.4) gecko/20030624 netscape/7.1 (ax; promostring) although geckoactivexobject is currently available only in netscape 7.1 on windows, it may be the case in the future that it will be available in other gecko-based browsers on other operating systems.
...examples in this article all assume that the user is running windows media player 7 and later, although netscape 7.1 supports the clsids of windows media player 6x and later.
Bounding volume collision detection with THREE.js - Game development
a more simple alternative that fixes the previous issue is to set those boundaries later on with box3.setfromobject, which will compute the dimensions taking into account a 3d entity's transformations and any child meshes as well.
...box and sphere using boxhelper as an alternative to using raw box3 and sphere objects, three.js has a useful object to make handling bounding boxes easier: boxhelper (previously boundingboxhelper, which has been deprecated).
Desktop gamepad controls - Game development
api status, browser and hardware support the gamepad api is still in working draft status, although browser support is already quite good — around 63% global coverage, according to caniuse.com.
... gameplay controls we can offer even more flexibility to the player by giving him main and alternative gamepad movement controls: if(gamepadapi.buttons.pressed('dpad-up','hold')) { // move player up } else if(gamepadapi.buttons.pressed('dpad-down','hold')) { // move player down } if(gamepadapi.buttons.pressed('dpad-left','hold')) { // move player left } if(gamepadapi.buttons.pressed('dpad-right','hold')) { // move player right } if(gamepadapi.axes.status && gamepadapi.axes...
Tiles and tilemaps overview - Game development
this set of articles covers the basics of creating tile maps using javascript and canvas (although the same high level techniques could be used in any programming language.) besides the performance gains, tilemaps can also be mapped to a logical grid, which can be used in other ways inside the game logic (for example creating a path-finding graph, or handling collisions) or to create a level editor.
... an alternative method would be to split the tilemap into big sections (like a full map split into 10 x 10 chunks of tiles), pre-render each one off-canvas and then treat each rendered section as a "big tile" in combination with one of the algorithms discussed above.
Plug-in Development Overview - Gecko Plugin API Reference
'str#' 128 should contain a list of mime types and file extensions in alternating strings.
... to determine whether plug-in and the browser versions are compatible and possibly provide alternative processing for different versions: use the npn_version method to check for changes in major and minor version numbers.
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
although not a strict subset, json closely resembles a subset of javascript syntax.
... many tools provide translation between these formats such as this online json to csv converter or this alternative json to csv converter.
Assessment: Accessibility troubleshooting - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
... the audio player the <audio> player isn't accessible to hearing impaired (deaf) people — can you add some kind of accessible alternative for these users?
Mobile accessibility - Learn web development
long gone are the days when mobile devices ran completely different web technologies to desktop browsers, forcing developers to use browser sniffing and serve them completely separate sites (although quite a few companies still detect usage of mobile devices and serve them a separate mobile domain).
... alternatively, mouse-specific events such as mousedown and mouseup create problems — their event handlers cannot be invoked using non-mouse controls.
Cascade and inheritance - Learn web development
something to note here is that although we are thinking about selectors, and the rules that are applied to the thing they select, it isn't the entire rule which is overwritten, only the properties which are the same.
... the third and fourth selectors are competing over the styling of the link's text color — the second one wins and makes the text white because although it has one less element selector, the missing selector is swapped out for a class selector, which is worth ten rather than one.
Fundamental CSS comprehension - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
...this could affect the values you need, although in this simple example this is not an issue.) other things to think about: you'll get bonus marks if you write your css for maximum readability, with a separate declaration on each line.
Test your skills: The Box Model - Learn web development
the box model one with the two boxes below, one is using the standard box model, the other the alternate box model.
... change the width of the second box by adding rules to the .alternate class, so that it matches the visual width of the first box.
Pseudo-classes and pseudo-elements - Learn web development
:read-only matches an element if it is not user-alterable.
... :read-write matches an element if it is user-alterable.
Floats - Learn web development
the clearfix hack the way that this situation has traditionally been dealt with is to use something known as a "clearfix hack".
...900px; margin: 0 auto; font: .9em/1.2 arial, helvetica, sans-serif } .wrapper { background-color: rgb(79,185,227); padding: 10px; color: #fff; } .box { float: left; margin: 15px; width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .wrapper::after { content: ""; clear: both; display: block; } using overflow an alternative method is to set the overflow property of the wrapper to a value other than visible.
Introduction to CSS layout - Learn web development
for many of the elements on your page the normal flow will create exactly the layout you need, however for more complex layouts you will need to alter this default behavior using some of the tools available to you in css.
...we also have entire layout methods that are switched on via specific display values, for example css grid and flexbox, which alter how elements inside the element they are set on are laid out.
Web fonts - Learn web development
you can use the font stack to specify preferable fonts, followed by web-safe alternatives, followed by the default system font, but this adds overhead in terms of testing to make sure that your designs look ok with each font, etc.
... web fonts but there is an alternative, which works very well, right back to ie version 6.
Learn to style HTML using CSS - Learn web development
for example, you can use css to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
... css first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
What is a Domain Name? - Learn web development
a tld's maximum length is 63 characters, although most are around 2–3.
... alternatively, if you use a system with a built-in shell, type a whois command into it, as shown here for mozilla.org: $ whois mozilla.org domain name:mozilla.org domain id: d1409563-lror creation date: 1998-01-24t05:00:00z updated date: 2013-12-08t01:16:57z registry expiry date: 2015-01-23t05:00:00z sponsoring registrar:markmonitor inc.
How do you set up a local testing server? - Learn web development
note: if you already have something running on port 8000, you can choose another port by running the server command followed by an alternative port number, e.g.
...flask is also a good (slightly less heavyweight) alternative to django.
Advanced form styling - Learn web development
rowser rendering firefox 71 (macos) firefox 57 (windows 10) chrome 77 (macos), safari 13, opera chrome 63 (windows 10) internet explorer 11 (windows 10) edge 16 (windows 10) using appearence: none on radios/checkboxes as we showed before, you can remove the default appearance of a checkbox or radio button altogether with appearance:none; let's take this example html: <form> <fieldset> <legend>fruit preferences</legend> <p> <label> <input type="checkbox" name="fruit-1" value="cherry"> i like cherry </label> </p> <p> <label> <input type="checkbox" name="fruit-2" value="banana" disabled> i can't like banana </label> </p> ...
...to fix this in our example we first used our old friend appearance: none to get rid of the icon altogether: select { -webkit-appearance: none; appearance: none; } we then created our own icon using generated content.
Basic native form controls - Learn web development
single line text fields a single line text field is created using an <input> element whose type attribute value is set to text, or by omitting the type attribute altogether (text is the default value).
... <input type="image" alt="click me!" src="my-img.png" width="80" height="30"> if the image button is used to submit the form, this control doesn't submit its value — instead, the x and y coordinates of the click on the image are submitted (the coordinates are relative to the image, meaning that the upper-left corner of the image represents the coordinate (0, 0)).
Client-side form validation - Learn web development
our applications won't work properly if our users' data is stored in the wrong format, is incorrect, or is omitted altogether.
...even if your form is validating correctly and preventing malformed input on the client-side, a malicious user can still alter the network request.
UI pseudo-classes - Learn web development
back to our required/optional example from before, this time we'll not alter the appearance of the input itself — we'll use generated content to add an indicating label (see it live here, and see the source code here).
...we style the indeterminate radio buttons with the following css: input[type="radio"]:indeterminate { border: 2px solid red; animation: 0.4s linear infinite alternate border-pulse; } @keyframes border-pulse { from { border: 2px solid red; } to { border: 6px solid red; } } this creates a fun little animated border on the radio buttons, which hopefully indicates that you need to select one of them!
The web and web standards - Learn web development
simple html looks like this: <h1>this is a top-level heading</h1> <p>this is a paragraph of text.</p> <img src="cat.jpg" alt="a picture of my cat"> if we adopted a house-building analogy, html would be like the foundations and walls of the house, which give it structure and hold it together.
...there are technical considerations here (such as altering your layout so that it still works ok for right-to-left, or even vertical languages), and human ones (such as using simple, non-slang language so that people who have your language as their second or third language are more likely to understand your text).
Mozilla splash page - Learn web development
alternatively, you could use an online tool such as glitch to create your example.
...to complete this section you'll need to insert an <img> element inside each one containing appropriate src, alt, srcset and sizes attributes.
Build your own function - Learn web development
previous overview: building blocks next with most of the essential theory dealt with in the previous article, this article provides practical experience.
... the alert function is limited: you can alter the message, but you can't easily vary anything else, such as the color, icon, or anything else.
Image gallery - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
... alternatively, you can add one event listener to the thumb bar.
Function return values - Learn web development
you've already met return values a number of times, although you may not have thought about them explicitly.
... conclusion so there we have it — functions are fun, very useful, and although there's a lot to talk about in regards to their syntax and functionality, they are fairly understandable.
Client-side storage - Learn web development
cache is usually used in combination with the service worker api, although it doesn't have to be.
... use of cache and service workers is an advanced topic, and we won't be covering it in great detail in this article, although we will show a simple example in the offline asset storage section below.
Introduction to web APIs - Learn web development
for example, the web audio api provides javascript constructs for manipulating audio in the browser — taking an audio track, altering its volume, applying effects to it, etc.
...ml element that you want to affect in some way, for example: const em = document.createelement('em'); // create a new em element const para = document.queryselector('p'); // reference an existing p element em.textcontent = 'hello there!'; // give em some text content para.appendchild(em); // embed em inside para the canvas api also relies on getting a context object to use to manipulate things, although in this case, it's a graphical context rather than an audio context.
Inheritance in JavaScript - Learn web development
in addition, we present some advice on when and where you might use oojs, and look at how classes are dealt with in modern ecmascript syntax.
... alternatives for extending the prototype chain in javascript, there are several different ways to extend the prototype of an object aside from what we've shown above.
React resources - Learn web development
component-level styles although this tutorial doesn't use this approach, many react applications define their styles on a per-component basis, rather than in a single, monolithic stylesheet.
... class components although this tutorial doesn’t mention them, it is possible to build react components using es6 classes – these are called class components.
Client-side tooling overview - Learn web development
although it is still entirely reasonable to write html, css, and javascript "by hand" there is now a wealth of tools that developers can use to speed up the process of building a web site, or app.
... how to choose and get help with a particular tool most tools tend to get written and released in isolation, so although there’s almost certainly help available it’s never in the same place or format.
Chrome Worker Modules
you only need to do it once for each worker, from within the chrome worker itself: importscripts("resource://gre/modules/workers/require.js"); note: although you only need to do this once for each worker, it doesn't hurt if you do it more than once.
...to make the value public, you just have to add it to either global value exports, as follows: /* file mymodule.js */ let secretkey = "this is a secret"; let publickey = "this is public"; exports.key = publickey; // secretkey is not exported // publickey is exported with name "key" alternatively, if you prefer that style, you may write // variable |module| is a special global introduced by require() module.exports = { key: publickey }; once this is done, we may load the module and use the values that have been exported // assuming that mymodule.js is installed to resource://gre/modules/mymodule.js let module = require("resource://gre/modules/mymodule.js") foo(module.k...
Embedding API for Accessibility
fonts setcharpref("font.name.monospace.x-western", newfontname); setcharpref("font.name.serif.x-western", newfontname); setcharpref("font.name.sans-serif.x-western", newfontname); /* for other i18n charsets, change x-western to x-central-euro, x-cyrillic, x-unicode, x-user-def, x-baltic, el, tr, he, ar, th, ja, zh-cn or zh-tw */ setintpref("font.size.fixed.x-western", newfontsize); setintpref("font.size.variable.x-western", newfontsize); /* for other i18n charsets, change the name as explained above for font face*/ setcharpref("font.defa...
...this is a much better alternative than having the user go through a long series of confirm boxes for each new page, for each type of content.
Mozilla's Section 508 Compliance
caveats: 1) although sidebar cannot be customized without a mouse, all sidebar functions that come with the browser are available through other means 2) java and in-page plugins cannot be used with the keyboard, so they must not be installed for keyboard-only users additional features for the keyboard: 1) find as you type allows for quick navigation to links and convenient text searching 2) ...
...however, the visited link appearance can be altered via a user style sheet.
Creating a Firefox sidebar
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Debugging on Windows
alternatively, if you have generated the visual studio solution, via ./mach build-backend -b visualstudio, opening this solution allows you to run firefox.exe directly in the debugger.
....* ...add common functions to this list should probably make a .reg file for easy importing obtaining stdout and other file handles running the following command in the command window in visual studio returns the value of stdout, which can be used with various debugging methods (such as nsgenericelement::list) that take a file* param: debug.evaluatestatement {,,msvcr80d}(&__iob_func()[1]) (alternatively you can evaluate {,,msvcr80d}(&__iob_func()[1]) in the quickwatch window) similarly, you can open a file on the disk using fopen: >debug.evaluatestatement {,,msvcr80d}fopen("c:\\123", "w") 0x10311dc0 { ..snip..
Configuring Build Options
you can either create multiple mozconfig files, or alternatively, use the moz_build_projects make option.
... using multiple mozconfig files alternatively, you may want to create separate mozconfig files.
SVG Guidelines
although this kind of data is supported by the browser, it can only be displayed when the svg is opened in a new tab.
...however, there are some utilities that cover parts of this document: mostly complete command line tool: https://github.com/svg/svgo alternatives to svgo: https://github.com/razrfalcon/svgcleaner https://github.com/scour-project/scour gui for command line tool (use with "prettify code" and "remove <title>" options on): https://jakearchibald.github.io/svgomg/ good alternative to svgo/svgomg: https://petercollingridge.appspot.com/svg-editor fixes the excessive number precision: https://simon.html5.org/tools/js/svg-o...
Multiple Firefox profiles
launching firefox into a desired profile although it is possible in some cases to have multiple instances of firefox running in different profiles, to avoid confusion, you might want to first exit/quit/terminate all running instances of firefox, firefox developer edition or nightly.
... linux if firefox is already included in your linux distribution, or if you have installed firefox with the package manager of your linux distribution: open a terminal emulator or your shell’s command prompt: alt-f2 if you use gnome shell or kde plasma, consult your desktop environment documentation for other environments.
Performance
this highlights some performance pitfalls related to frame scripts/message manager usage and alternative approaches to avoid them.
...alternatively the frame's unload event or weak maps can be used to ensure that frames can be cleaned up when their respective tab is closed.
IME handling guide
although, this can be disabled with "dom.compositionevent.allow_control_characters" pref.
... in this case, although, we should not commit the placeholder character because it's not a character which the user wanted to input but we commit it as is.
Implementing QueryInterface
some alternatives the ns_impl_query_interface[012] macros the sample above implements two xpcom interfaces in addition to nsisupports.
...in this case the macro is for convenience only, so i don't recommend it, but i do offer it up as an alternative.
Localizing with Mozilla Translator
most of the strings will be automatically filled, although if you do this you should review them, because for en-us strings with several possible translations, mt will choose one of them, which could not be the one you want.
...with mercurial, partial checkouts are not possible, so you have your own mozilla repository full copy (there are alternate solutions; read on).
Localization sign-off reviews
does not need to be approved before revision merge between release channels, although it is recommended.
... encoding some tools add bom to utf-8 encoded files, and some change the encoding altogether.
Fonts for Mozilla's MathML engine
a better alternative on unix systems is to install the otf files for latin modern math and stix into some local font folder and (if necessary) to run fc-cache on it.
...alternatively, you can try the mathml-fontsettings add-on.
Fonts for Mozilla 2.0's MathML engine
furthermore, in accordance with the w3c css2 recommendation on fonts, authors can specify an ordered list of particular fonts which they prefer (using the font-family property of css), with the assurance that mozilla's font engine will hunt for alternate fonts whenever their specified fonts are not found on a particular user's system.
...alternatively, follow dafont's "how to install a font".
Mozilla Development Strategies
maybe the problem can be turned into an assert, or fixed altogether.
... if you are blocked, but have something worth checking in, check in using #ifdef, prefs, or "alternative" files sometimes you'll work on something, but you can't land it because something else is blocking you.
mozilla::Mutex
does not incur a runtime penalty in optimized builds.
...does not incur a runtime penalty in optimized builds.
Leak-hunting strategies and tips
this can mean there will be xpconnect wrapper objects showing up as owning the leaked objects, but it doesn't mean it's xpconnect's fault (although that has been known to happen, it's rare).
...fix_stacks.py uses this debugging information (although it does not verify that they match the library versions on the system).
Power profiling overview
although power is an instantaneous concept, in practice measurements of it are determined in a non-instantaneous fashion, i.e.
...alternatively, here is an explanation of how one developer diagnosed two animation-related problems the hard way (which required genuine platform expertise).
Profiling with the Firefox Profiler
alternatively, expand an entire tree segment by holding alt and clicking on the arrow to the left of the collapsed tree segment.
... alternatively, native leaf stack ("leaf") only records the top-most frame.
NSPR build instructions
although nsprpub is a subdirectory under mozilla, nspr is independent of the mozilla client source tree.
... configure options although nspr uses autoconf, its configure script has two default values that are different from most open source projects.
PR_Accept
syntax #include <prio.h> prfiledesc* pr_accept( prfiledesc *fd, prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing the rendezvous socket on which the caller is willing to accept new connections.
... timeout a value of type printervaltime specifying the time limit for completion of the accept operation.
PR_CWait
syntax #include <prcmon.h> prstatus pr_cwait( void *address, printervaltime timeout); parameters the function has the following parameters: address the address of the protected object--the same address previously passed to pr_centermonitor.
... timeout the amount of time (in printervaltime units) that the thread is willing to wait for an explicit notification before being rescheduled.
PR_Connect
syntax #include <prio.h> prstatus pr_connect( prfiledesc *fd, const prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket.
... timeout a value of type printervaltime specifying the time limit for completion of the connect operation.
PR_IntervalNow
syntax #include <prinrval.h> printervaltime pr_intervalnow(void); returns a printervaltime object.
... prstatus rv; printervaltime epoch = pr_intervalnow(); pr_lock(data->mutex); while (!evaluatedata(data)) /* wait until condition is met */ { pruint32 delta = pr_intervaltomilliseconds(pr_intervalnow() - epoch); if (delta > interval) break; /* timeout */ rv = pr_wait(data->condition, pr_millisecondstointerval(interval - delta)); if (pr_failure == rv) break; /* likely an interrupt */ } pr_unlock(...
PR_QueueJob_Timer
syntax #include <prtpool.h> nspr_api(prjob *) pr_queuejob_timer( prthreadpool *tpool, printervaltime timeout, prjobfn fn, void * arg, prbool joinable ); parameters the function has the following parameters: tpool a pointer to a prthreadpool structure previously created by a call to pr_createthreadpool.
... timeout a value, expressed as a printervaltime, to wait before queuing the job.
PR_Recv
syntax #include <prio.h> print32 pr_recv( prfiledesc *fd, void *buf, print32 amount, printn flags, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket.
... timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_RecvFrom
syntax #include <prio.h> print32 pr_recvfrom( prfiledesc *fd, void *buf, print32 amount, printn flags, prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket.
... timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_Send
syntax #include <prio.h> print32 pr_send( prfiledesc *fd, const void *buf, print32 amount, printn flags, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket.
... timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_SendTo
syntax #include <prio.h> print32 pr_sendto( prfiledesc *fd, const void *buf, print32 amount, printn flags, const prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket.
... timeout a value of type printervaltime specifying the time limit for completion of the receive operation.
PR_Wait
syntax #include <prmon.h> prstatus pr_wait( prmonitor *mon, printervaltime ticks); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor.
... ticks the amount of time (in printervaltime units) that the thread is willing to wait for an explicit notification before being rescheduled.
PR_Writev
syntax #include <prio.h> print32 pr_writev( prfiledesc *fd, priovec *iov, print32 size, printervaltime timeout); #define pr_max_iovector_size 16 parameters the function has the following parameters: fd a pointer to a prfiledesc object for a socket.
... timeout a value of type printervaltime describing the time limit for completion of the entire write operation.
Building NSS
build with make alternatively, there is a make target called "nss_build_all", which produces a similar result.
... this supports some alternative options, but can be a lot slower.
Certificate functions
cert_createname mxr 3.2.1 and later cert_createocspcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoaccessextension mxr 3.10 and later cert_decodeauthkeyid mxr 3.10 and later cert_decodeavavalue mxr 3.4 and later cert_decodebasicconstraintvalue mxr 3.2 and later cert_decodecertfrompackage mxr 3.4 and later cert_decodecertificatepoliciesextension mxr ...
... cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_dupcertificate mxr 3.2 and later cert_dupcertlist mxr 3.2 and later cert_enableocspchecking mxr 3.2 and later cert_encodealtnameextension mxr 3.7 and later cert_encodeandaddbitstrextension mxr 3.5 and later cert_encodeauthkeyid mxr 3.5 and later cert_encodebasicconstraintvalue mxr 3.5 and later cert_encodecertpoliciesextension mxr 3.12 and later cert_encodecrldistributionpoints mxr 3.5 and later cert_encodegeneralname mxr 3.
NSS FAQ
MozillaProjectsNSSFAQ
no license fees, no royalty fees, no subscription fees.
...(in recent nspr releases, the nspr threading model is compatible with the native threading model if the os has native threads.) alternatively, you can adapt the open-source nspr implementation to be compatible with your existing application's threading models.
NSS Developer Tutorial
when a block of code consists of a single statement, nss doesn’t require curly braces, so both of these examples are fine: if (condition) { action(); } or: if (condition) action(); although the use of curly braces is more common.
...the most common style is foobarbaz, although foobarbaz and foo_bar_baz are also used.
NSS Sample Code Sample1
as an alternative to token symmetric keys as a way to store large numbers of symmetric keys wrapping symmetric keys using an rsa key from another server unwrapping keys using your own rsa key pair the main part of the program shows a typical sequence of events for two servers that are trying to extablish a shared key pair.
...as an alternative, new keys may be sent to the // current set of secondary hosts when they are generated by the // primary.
nss tech note8
however since nss was delivered as archive libraries, client programs merely declared these two variables for themselves, and then were able to alter those variables directly.
...the server cache initialization function was intended to no longer alter the variables ssl3_sid_timeout and ssl_sid_timeout, but rather to set the server cache's variables.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
if the subject dn does not include an email address, the certificate extension subjectaltname must include an email address.
... the subjectaltname extension is part of the x.509 v3 and pkix specifications.
Python binding for NSS
nss is an alternative to openssl and used extensively by major software projects.
..._general_name_type_from_name() nss.nss.cert_general_name_type_name() nss.nss.cert_usage_flags() nss.nss.decode_der_crl() nss.nss.der_universal_secitem_fmt_lines() nss.nss.import_crl() nss.nss.make_line_pairs() nss.nss.oid_dotted_decimal() nss.nss.oid_str() nss.nss.oid_tag() nss.nss.oid_tag_name() nss.nss.read_der_from_file() nss.nss.x509_alt_name() nss.nss.x509_ext_key_usage() nss.nss.x509_key_usage() the following class methods and properties were added: note: it's a method if the name is suffixed with (), a propety otherwise socket.next() socket.readlines() socket.sendall() sslsocket.next() sslsocket.readlines() sslsocket.sendall() authkeyid.key_id authkeyid.seri...
NSS functions
cert_createname mxr 3.2.1 and later cert_createocspcertid mxr 3.6 and later cert_createocsprequest mxr 3.6 and later cert_createrdn mxr 3.2.1 and later cert_createsubjectcertlist mxr 3.4 and later cert_createvalidity mxr 3.5 and later cert_crlcacherefreshissuer mxr 3.7 and later cert_decodealtnameextension mxr 3.10 and later cert_decodeauthinfoaccessextension mxr 3.10 and later cert_decodeauthkeyid mxr 3.10 and later cert_decodeavavalue mxr 3.4 and later cert_decodebasicconstraintvalue mxr 3.2 and later cert_decodecertfrompackage mxr 3.4 and later cert_decodecertificatepoliciesextension mxr ...
... cert_destroyocspresponse mxr 3.7 and later cert_destroyoidsequence mxr 3.9 and later cert_destroyusernotice mxr 3.10 and later cert_destroyvalidity mxr 3.5 and later cert_dupcertificate mxr 3.2 and later cert_dupcertlist mxr 3.2 and later cert_enableocspchecking mxr 3.2 and later cert_encodealtnameextension mxr 3.7 and later cert_encodeandaddbitstrextension mxr 3.5 and later cert_encodeauthkeyid mxr 3.5 and later cert_encodebasicconstraintvalue mxr 3.5 and later cert_encodecertpoliciesextension mxr 3.12 and later cert_encodecrldistributionpoints mxr 3.5 and later cert_encodegeneralname mxr 3.
NSS tools : crlutil
* add issuer alternative name extension: the issuer alternative names extension allows additional identities to be associated with the issuer of the crl.
... issueraltnames non-critical name-list where: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names * add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl scope and crl issuer.
NSS tools : pk12util
id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key triple des-cbc parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate: data: version: 3 (0x2) serial number: 13 (0xd) signature algorithm: pkcs #1 sha-1 with rsa encryption issuer: "e=personal-freemail@thawte.com,cn=thawte personal freemail c a,ou=certification services division,o=thawte consulting,l=cape t own,st=western cape,c=za" alternatively, the -r prints the cert...
...id encryption algorithm: pkcs #12 v2 pbe with sha-1 and 3key triple des-cbc parameters: salt: 45:2e:6a:a0:03:4d:7b:a1:63:3c:15:ea:67:37:62:1f iteration count: 1 (0x1) certificate friendly name: thawte personal freemail issuing ca - thawte consulting certificate friendly name: thawte freemail member's thawte consulting (pty) ltd.
sslintro.html
an ssl application typically includes five parts: initialization configuration communication functions used by callbacks cleanup although the details differ somewhat for client and server applications, the concepts and many of the functions are the same for both.
... functions that can be used by both clients and servers during communication include the following: pr_send or pr_write pr_read or pr_recv pr_geterror pr_getpeername pr_sleep pr_malloc pr_free pr_poll pr_now pr_intervaltomilliseconds pr_millisecondstointerval pr_shutdown pr_close ssl_invalidatesession after establishing a connection, an application first calls pr_send, pr_recv, pr_read, pr_write, or ssl_forcehandshake to initiate the handshake.
ssltyp.html
never alter the contents of a certificate structure.
... never alter the contents of a key structure.
NSS Tools crlutil
add issuer alternative name extension: the issuer alternative names extension allows additional identities to be associated with the issuer of the crl.
... issueraltnames non-critical name-list where: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl scope and crl issuer.
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
* add issuer alternative name extension: the issuer alternative names extension allows additional identities to be associated with the issuer of the crl.
... issueraltnames non-critical name-list where: subjaltnames: identifies the name of an extension should be set to 0 since this is non-critical extension name-list: comma separated list of names * add crl number extension: the crl number is a non-critical crl extension which conveys a monotonically increasing sequence number for a given crl scope and crl issuer.
Rhino scopes and contexts
in addition if a script alters some of the standard objects, the library may not work properly for other scripts.
...then after a custom initialization is done, one can seal the shared scope by callingscriptableobject.sealobject(): sealedsharedscope.sealobject(); note that currently one needs to explicitly seal any additional properties he adds to the sealed shared scope since although after calling sealedsharedscope.sealobject(); it would no be possible to set the additional properties to different values, one still would be able to alter the objects themselves.
Scripting Java
using a fully qualified name, the above example would look as follows: $ java org.mozilla.javascript.tools.shell.main js> jspackage = packages.org.mozilla.javascript; [javapackage org.mozilla.javascript] js> jspackage.context.currentcontext; org.mozilla.javascript.context@bb6ab6 alternatively, if you want to import just one class from a package you can do so using the importclass() method.
... although this has the benefit of selecting a method that may be a better match for each call, it does have an impact on performance since more work is done at each call.
SpiderMonkey Internals
interpreter like many portable interpreters, spidermonkey's interpreter is mainly a single, tremendously long function that steps through the bytecode one instruction at a time, using a switch statement (or faster alternative, depending on the compiler) to jump to the appropriate chunk of code for the current instruction.
... the representation is 64 bits and uses nan-boxing on all platforms, although the exact nan-boxing format depends on the platform.
JIT Optimization Strategies
alternatively, if the property access is polymorphic, but only has a few different shapes observed at the access site, this optimization may be used.
... alternatively, if the property write is polymorphic, but only has a few different shapes observed at the access site, this optimization may be used.
JSAPI User Guide
when your application is done with spidermonkey altogether, use js_shutdown to free any remaining cached resources.
...(of course, if the error is that the system is out of memory, that problem remains to be dealt with.) here is some example code that throws an uncatchable error.
JSVAL_IS_GCTHING
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...see jsval for alternatives.
JSVAL_TO_GCTHING
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...another possible alternative is to avoid casting altogether by using an api that operates on jsvals rather than raw pointers (for example, js_call_value_tracer rather than js_call_tracer).
JSVAL_TO_INT
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...note that although jsval is an integer type, it must be treated as opaque.
JS_Add*Root
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
... a jsval is not a gc-thing (it has tag bits and may be a different size altogether) and thus the address of a jsval variable must not be passed to js_addgcthingroot.
JS_ConstructObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
... the preferred alternative is to save a copy of the constructor function for the class, then to call it using js_new.
SpiderMonkey 1.8.5
build 5574) to work around this issue, either upgrade your xcode or use an alternate version of gcc, such as the one that shipped with leopard.
... to select an alternate c++ compiler, invoke configure thus: cxx=/usr/bin/g++-4.0 /path/configure --my-configuration-options js-config the new configure-based build system does not correctly generate the js-config script on many platforms, nor when js-ctypes are enabled.
SpiderMonkey 1.8.7
build 5574) to work around this issue, either upgrade your xcode or use an alternate version of gcc, such as the one that shipped with leopard.
... to select an alternate c++ compiler, invoke configure thus: cxx=/usr/bin/g++-4.0 /path/configure --my-configuration-options js-config the new configure-based build system does not correctly generate the js-config script on many platforms, nor when js-ctypes are enabled.
Secure Development Guidelines
ter being executed; can’t be modified directly introduction: gaining control (2) eip is modified using call or jump instructions attacks usually rely on obtaining control over the eip otherwise the attacker can try to control memory pointed to by an existing function pointer a vulnerability is required to modify the eip or sensitive memory saved return addr or function pointer get altered introduction: gaining control (3) common issues used to gain control buffer overflows format string bugs integer overflows/underflows writing secure code: input validation input validation most vulnerabilities are a result of un-validated input always perform input validation could save you without knowing it examples: if it doesn’t have to be negative, ...
... buffer bounds validations (bbv) thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest "foo" someone someday shall type "supercalifragilisticexpialidocious".
Handling Mozilla Security Bugs
this work is separate from the work of developers adding new security features (cryptographically-based or otherwise) to mozilla, although obviously many of the same people will be involved in both sets of activities.
...(as described previously, once added to the security bug group, that person would then have automatic access to all bugs marked security-sensitive, without having to be explicitly added to the cc list for each one.) note that, although we intend to make it relatively simple for a new person to join the security bug group, and we are not limiting the size of the group to any arbitrary number, we do not want the group to expand without any limits whatsoever.
An Overview of XPCOM
gecko although it is in some ways structurally similar to microsoft com, xpcom is designed to be used principally at the application level.
... writing components in other languages though you do not have access to some of the tools that xpcom provides for c++ developers (such as macros, templates, smart pointers, and others) when you create components in other languages, you may be so comfortable with the language itself that you can eschew c++ altogether and build, for example, python-based xpcom components that can be used from javascript or vice versa.
Creating the Component Code
registration alternatives a gecko embedding application may provide other ways to register xpcom components.
... xpinstall, the cross-platform installation technology that mozilla uses to install the browser and other components, is one such alternative.
Preface
although basic ideas such as inheritance and encapsulation should be familar to you, wherever possible they are explained in the book as they are used.
...although, xpcom can be used in many environments which are unrelated to web browsing, xpcom's main client is gecko, an open source, standards compliant, embeddable web browser, where it's easiest and most practical to illustrate xpcom's functionality.
Components.utils.importGlobalProperties
example components.utils.import("resource://gre/modules/devtools/console.jsm"); components.utils.importglobalproperties(["atob", "btoa"]); var encoded = btoa("hello"); console.log(encoded); // "sgvsbg8=" console.log(atob(encoded)); // "hello" alternative methods if importglobalproperties does not support the targeted firefox version, here are some alternative methods to import these objects.
... var domfile = services.appshell.hiddendomwindow.file('/path/to/file'); xpcom components some objects have an xpcom alternative, which typically allows more flexibility then the dom version here is an example of how to use the dom xmlhttprequest through xpcom interface of nsixmlhttprequest: var oreq = cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(ci.nsixmlhttprequest); ...
Observer Notifications
this lets extensions inject api into chrome windows as needed (see nsidomglobalpropertyinitializer for an alternative method of doing this, which uses significantly less memory).
...this lets extensions inject api into content windows as needed (see nsidomglobalpropertyinitializer for an alternative method of doing this).
nsACString (External)
class declaration <map id="classes" name="classes"><area alt="" coords="1005,6,1096,54" href="http://developer.mozilla.org/en/nsacstring_(external)" shape="rect" title="nsacstring_(external)"> <area alt="" coords="980,102,1121,150" href="http://developer.mozilla.org/en/nscstringcontainer_(external)" shape="rect" title="nscstringcontainer_(external)"> <area alt="" coords="571,198,707,246" href="http://developer.mozilla.org/en/nscstring_external" shape="rect" title="nscstring_external"> <area alt="" coords="731,198,955,246" href="http://developer.mozilla.org/en/nsdependentcsubstring_external" shape="rect" title="nsdependentcsubstring_external"> <area alt="" coords="979,198,1123,246" href="http://developer.mozilla.org/en/promiseflatcstring_(external)" shape="rect" title="promiseflatcstri...
...ng_(external)"> <area alt="" coords="1147,198,1259,246" href="http://developer.mozilla.org/en/nscautostring_(external)" shape="rect" title="nscautostring_(external)"> <area alt="" coords="5,294,208,342" href="http://developer.mozilla.org/en/nsdependentcstring_external" shape="rect" title="nsdependentcstring_external"> <area alt="" coords="232,294,475,342" href="http://developer.mozilla.org/en/ns_convertutf16toutf8_external" shape="rect" title="ns_convertutf16toutf8_external"> <area alt="" coords="499,294,779,342" href="http://developer.mozilla.org/en/ns_lossyconvertutf16toascii_external" shape="rect" title="ns_lossyconvertutf16toascii_external"> <area alt="" coords="803,294,925,342" href="http://developer.mozilla.org/en/nsliteralcstring_(external)" shape="rect" title="nsliteralcstring_(extern...
nsAString (External)
<map id="classes" name="classes"> <area alt="" coords="963,6,1045,54" href="http://developer.mozilla.org/en/nsastring_(external)" shape="rect" title="nsastring_(external)"> <area alt="" coords="939,102,1069,150" href="http://developer.mozilla.org/en/nsstringcontainer_(external)" shape="rect" title="nsstringcontainer_(external)"> <area alt="" coords="548,198,676,246" href="http://developer.mozilla.org/en/nsstring_external" shape="rect" title="nsstring_external"> <area alt="" coords="700,198,913,246" href="http://developer.mozilla.org/en/nsdependentsubstring_external" shape="rect" title="nsdependentsubstring_external"> <area alt="" coords="937,...
...198,1071,246" href="http://developer.mozilla.org/en/promiseflatstring_(external)" shape="rect" title="promiseflatstring_(external)"> <area alt="" coords="1095,198,1196,246" href="http://developer.mozilla.org/en/nsautostring_(external)" shape="rect" title="nsautostring_(external)"> <area alt="" coords="5,294,197,342" href="http://developer.mozilla.org/en/nsdependentstring_external" shape="rect" title="nsdependentstring_external"> <area alt="" coords="221,294,467,342" href="http://developer.mozilla.org/en/ns_convertasciitoutf16_external" shape="rect" title="ns_convertasciitoutf16_external"> <area alt="" coords="491,294,733,342" href="http://developer.mozilla.org/en/ns_convertutf8toutf16_external" shape="rect" title="ns_convertutf8toutf16_external"> <area alt="" coords="757,294,869,342" href="ht...
mozIRegistry
nsrepository will be modified to use this interface, thereby enabling alternative registry implementations to be substituted at run/link time.
...this issue needs to be resolved in order to enable alternative moziregistry implementations or to permit other service implementations to be bound at runtime.
mozIStorageService
if this method throws ns_error_file_corrupted, it's recommended that you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet).
...if this method throws ns_error_file_corrupted, it's recommended that you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet).
KeyboardShortcut
« nsiaccessible page summary provides localized string of accesskey name, such as alt+d (alt + d).
...usually alt+letter (alt + letter), or just the letter alone for menu items.
nsIAccessible
keyboardshortcut provides localized string of accesskey name, such as alt+d.
...usually alt+letter, or just the letter alone for menu items.
nsIClipboardDragDropHooks
oncopyordrag() alters the flavors or data presented to the os.
...onpasteordrop() provide an alternative action to the built-in behavior when something is dropped on the browser or in an editor.
nsIConsoleService
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
... var array = {}; return consoleservice.getmessagearray(array, {}) || array.value; } logging a simple message a common usage is logging a message string to the console: function log(msg) { var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); consoleservice.logstringmessage(msg); } alternative logging methods include components.utils.reporterror and dump().
nsIControllers
xul elements can also have controllers, although they do not have any default controllers.
...you should not normally need to create an instance, as you normally need to alter the window or element's existing list of controllers.
nsIDOMMozTouchEvent
g, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long streamidarg); attributes attribute type description streamid unsigned long a unique identifier for each finger, so that each finger's ...
...void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long streamidarg ); parameters streamidarg the value to assign to the streamid attribute; this uniquely identifies the finger generating the touch events.
nsIDOMSimpleGestureEvent
method overview void initsimplegestureevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg); attributes attribute type description delta double the delta value indicating how far the gesture moved.
... void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in unsigned long directionarg, in double deltaarg ); parameters typearg canbubblearg cancelablearg viewarg detailarg screenxarg screenyarg clientxarg clientyarg ctrlkeyarg altkeyarg shiftkeyarg metakeyarg but...
nsIDownloadManager
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIFaviconService
the moz-anno protocol handler's special case for "favicon" annotations will resolve invalid icons to the default icon, although without caching.
...the moz-anno protocol handler's special case for "favicon" annotations will detect most invalid icons and it will resolve to the default icon, although without caching.
nsIFile
an alternate form operates on characters strings encoded in the "native" charset.
...the alternate form operates on character strings encoded in the "native" multibyte character set.
nsILocalFileMac
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIProtocolProxyService
getfailoverforproxy() if the proxy identified by aproxyinfo is unavailable for some reason, this method may be called to access an alternate proxy that may be used instead.
... exceptions thrown ns_error_not_available if there is no alternate proxy available.
nsIRequest
users should normally pass ns_binding_aborted, although other errors may also be passed.
...this may have the effect of closing any underlying transport (in order to free up resources), although any open streams remain logically opened and will continue delivering data when the transport is resumed.
nsISelection
nsidomrange getrangeat(in long index); void modify(in domstring alter, in domstring direction, in domstring granularity); void removeallranges(); void removerange(in nsidomrange range); void selectallchildren(in nsidomnode parentnode); void selectionlanguagechange(in boolean langrtl); domstring tostring(); attributes attribute type description anchornode nsidomnode returns the node ...
...void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend()" } "move" collapses the selection to the end of the selection and applies the movement direction/granularity to the collapsed() selection.
nsISelection3
method overview void modify(in domstring alter, in domstring direction, in domstring granularity); methods modify() modifies the selection.
... void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend" } "move" collapses the selection to the end of the selection and applies the movement direction/granularity to the collapsed selection.
nsISupports proxies
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...for more information about alternatives, see making cross-thread calls using runnables.
nsITreeView
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...to add properties for a particular row, you must use the nsiatomservice to create an nsiatom string, which can then be appended to the array to alter the style (see also styling a tree) getrowproperties: function(index, properties) { var atomservice = components.classes["@mozilla.org/atom-service;1"].getservice(components.interfaces.nsiatomservice); var atom = atomservice.getatom("dummy"); properties.appendelement(atom); } hasnextsibling() used to determine if the row at rowindex has a nextsibling that occurs after the index specified by afterindex.
nsIURIFixupInfo
fixupcreatedalternateuri boolean if we created an alternative uri.
... potentially adding a prefix and/or suffix; set by the browser.fixup.alternate.prefix and .suffix prefs, their defaults "www." and ".com", respectively.
nsIXPCScriptable
return value this should (although does not need to) return pr_true to indicate success or must return pr_false to indicate failure.
... return value this should (although does not need to) return pr_true to indicate success or must return pr_false to indicate failure.
Reference Manual
implementation details and debugging machinery although it is a class, nscomptr has no virtual methods, and therefore, no vtable or vptr.
... // introduce a temporary so we // don't stomp on |p| nscomptr<nsidomnode> temp = p; temp->getnext(getter_addrefs(p)); } although the nscomptr parallel is easy to understand, it suffers from doing one extra addref and one extra release compared to the raw pointer scheme.
Using nsIDirectoryService
although you will not customize these locations, you may need to tell xpcom where its /bin directory is.
...customizing locations although you can change locations one at a time by using the nsiproperties interface of nsdirectoryservice, you can also install your own nsidirectoryserviceprovider to control them en masse.
XPIDL Syntax
MozillaTechXPIDLSyntax
simplifications, conventions and notation the syntax is specified according to abnf as defined by rfc 5234, although a few productions use prose for clarity of understanding.
...libidl only considers a single line feed as a newline, and not carriage returns (although xpidl begs to differ).
Mozilla technologies
apng is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet.docshelldocshell is the second iteration of what originally started out as webshell.
...it has multiple language bindings, allowing xpcom components to be used and implemented in javascript, java, and python in addition to c++.xpidlxpidl is an interface description language used to specify xpcom interface classes.xray visiongecko runs javascript from a variety of different sources and at a variety of different privilege levels.xslt 2.0although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascript) to perform xslt 2.0.xtfthe extensible tag framework (xtf) allows adding support for new namespaces using xpcom components to mozilla (written in javascript or c++).
Index
glodamsgindexer has the message-specific stuff, although the actual attribute-providers are found in glodaexplicitattr and glodafundattr.
...an alternative to these methods is to directly access the element by it's id as in the detect when a folder opens example.
The libmime module
the alternative to that involves typing the literal name of the direct superclass of the class defined in this file, which will be a maintenance headache if the class hierarchy changes.
... } the class hierarchy is: mimeobject (abstract) | |--- mimecontainer (abstract) | | | |--- mimemultipart (abstract) | | | | | |--- mimemultipartmixed | | | | | |--- mimemultipartdigest | | | | | |--- mimemultipartparallel | | | | | |--- mimemultipartalternative | | | | | |--- mimemultipartrelated | | | | | |--- mimemultipartappledouble | | | | | |--- mimesunattachment | | | | | |--- mimemultipartsigned (abstract) | | | |--- mimemessage | | | |--- mimeuntypedtext | |--- mimeleaf (abstract) | ...
Working with windows in chrome code
there also is a window object for each sub-document, although there's no window in a common sense for the sub-document.
...alternatively, the opener window can pass a callback function to the progress dialog in the same way we passed the status string in the previous example: function oncancel() { alert("operation canceled!"); } ...
Standard OS Libraries
the alternative to standard libraries is creating your own dll (for windows) or so (for linux) file with c functions that can be called from your add-on with js-ctypes.
... although jni is done completely through js-ctypes, a jsm was created to abstract away the js-ctypes so developers can focus on the jni aspect.
CData
here is a method to read "malformed", it attempts to do readstring on it, if it errors then it tries to read it in another way, so this is an alternative to readstringreplacemalformed, it is an attempt at readingmalformed function readaschar8thenaschar16(stringptr, known_len, jschar) { // when reading as jschar it assumes max length of 500 // stringptr is either char or jschar, if you know its jschar for sure, pass 2nd arg as true // if known_len is passed, then assumption is not made, at the known_len position in array we wi...
... return char16_val; } if (!jschar) { try { var char8_val = stringptr.readstring(); console.info('stringptr.readstring():', char8_val); return char8_val; } catch (ex if ex.message.indexof('malformed utf-8 character sequence at offset ') == 0) { console.warn('ex of offset utf8 read error when trying to do readstring so using alternative method, ex:', ex); return readjscharstring(); } } else { return readjscharstring(); } } ...
Plug-in Basics - Plugins
although plug-ins are platform-specific, the plug-in api is designed to provide the maximum degree of flexibility and to be functionally consistent across all platforms.
...alternatively, you can write plug-ins that do not require a window to draw into.
Plug-in Development Overview - Plugins
'str#' 128 should contain a list of mime types and file extensions in alternating strings.
... to determine whether plug-in and the browser versions are compatible and possibly provide alternative processing for different versions: use the npn_version method to check for changes in major and minor version numbers.
Streams - Plugins
although a single stream is associated with one specific instance of a plug-in, a plug-in can have more than one stream object per instance.
...there is no guarantee that npp_write will receive requests for ranges in the same order as you requested (although this typically is the case; the server controls the order).
Version, UI, and Status Information - Plugins
if an essential feature is unavailable, the developer must arrange for alternative behavior, shut down the plug-in, or give the user a chance to decide what to do.
...if false is returned, windowless plug-ins will not work, and the developer must provide alternatives.
Accessibility Inspector - Firefox Developer Tools
in the following example, you can see that the image has been highlighted and its role, graphic, name, "road, asphalt, sky, clouds, fall", and the color contrast ratio, 3.46, appears in the information bar above it.
...for a start, you can investigate items that don't have a proper text equivalent — images without alt text and form elements without proper labels have a name property of null, for example.
Browser Console - Firefox Developer Tools
by default, only error messages are logged to the console, although you can change this in the browser's preferences.
... note: you can restart the browser with the command ctrl + alt + r (windows, linux) or cmd + alt + r (mac) this command restarts the browser with the same tabs open as before the restart.
Browser Toolbox - Firefox Developer Tools
you can also open it with the ctrl + alt +shift + i key combination ( cmd + opt +shift + i on a mac).
...altogether you will have access to the following developer tools: debugger (note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger.) console style editor performance network monitor page inspector accessibility inspector you can debug chrome: and about: pages using the normal debugger, just as if they were ordinary content pages.
DevTools API - Firefox Developer Tools
getadditionaltools() returns an array of tooldefinition objects for tools added by addons.
... return this.destroysomethingasynchronosly() .then(() => console.log("destroyed")); }, handleclick: function(event) { console.log("clicked", event.originaltarget); }, }; eventemitter eventemitter is an interface many developer tool classes and objects implement and use to notify others about changes in their internal state.
Page inspector keyboard shortcuts - Firefox Developer Tools
page up shift + page up shift + page up decrement selected value by 100 shift + page down shift + page down shift + page down increment selected value by 10 shift + up arrow shift + up arrow shift + up arrow decrement selected value by 10 shift + down arrow shift + down arrow shift + down arrow increment selected value by 0.1 alt + up arrow (ctrl + up arrow from firefox 60 onwards.) alt + up arrow alt + up arrow (ctrl + up arrow from firefox 60 onwards.) decrement selected value by 0.1 alt + down arrow (ctrl + down arrow from firefox 60 onwards).
... alt + down arrow alt + down arrow (ctrl + down arrow from firefox 60 onwards).
Waterfall - Firefox Developer Tools
changing properties that can alter an object's geometry and position, such as width, display, font-size, or top, will cause a reflow.
... however, changing properties that don't alter geometry or position, such as color or opacity, will not.
Tips - Firefox Developer Tools
alt + click on a node to expand or collapse it and all its descendants.
... press ctrl+alt+f to search in all scripts.
Web Console remoting - Firefox Developer Tools
4, "discardrequestbody": false }, { "from": "conn0.netevent14", "type": "networkeventupdate", "updatetype": "responsestart", "response": { "httpversion": "http/1.1", "status": "304", "statustext": "not modified", "headerssize": 194, "discardresponsebody": true } }, { "from": "conn0.netevent14", "type": "networkeventupdate", "updatetype": "eventtimings", "totaltime": 1 }, { "from": "conn0.netevent14", "type": "networkeventupdate", "updatetype": "responseheaders", "headers": 6, "headerssize": 194 }, { "from": "conn0.netevent14", "type": "networkeventupdate", "updatetype": "responsecookies", "cookies": 0 }, { "from": "conn0.netevent14", "type": "networkeventupdate", "updatetype": "responsecontent", "mimetype": "text/css", "conte...
... the geteventtimings packet: { "to": "conn0.netevent15", "type": "geteventtimings" } { "from": "conn0.netevent15", "timings": { "blocked": 0, "dns": 0, "connect": 0, "send": 0, "wait": 16, "receive": 0 }, "totaltime": 16 } the fileactivity packet when a file load is observed the following fileactivity packet is sent to the client: { "from": "conn0.console9", "type": "fileactivity", "uri": "file:///home/mihai/public_html/mozilla/test2.css" } history protocol changes by firefox version: firefox 18: initial version.
AbstractRange - Web APIs
range provides methods that allow you to alter the range's endpoints, as well as methods to compare ranges, detect intersections beween ranges, and so forth.
...there are fairly obvious limitations (such as if a node is moved to be after the endpoint of a range, or if the content of a node is heavily altered), but it's far better than nothing.
AnimationEffect.getComputedTiming() - Web APIs
although many of the attributes of the returned object are common to the effecttiming contained in the object returned by the animationeffect.gettiming() method, the values returned by this object differ in the following ways: duration returns the calculated value of the iteration duration.
... localtime the current time of the animation in milliseconds.
CSSStyleDeclaration.setProperty() - Web APIs
if priority can be omitted, javascript has a special simpler syntax for setting a css property on a style declaration object: style.csspropertyname = 'value'; examples in this example we have three buttons, which can be pressed to dynamically alter our box paragraph's border, background color, and text color to random values (see the live example at the end of this section).
... we know that the rule we want to alter to do this is contained inside the second stylesheet applied to the page, so we grab a reference to it using document.stylesheets[1].
Using dynamic styling information - Web APIs
<html> <head> <title>simple style example</title> <script type="text/javascript"> function alterstyle(elem) { elem.style.background = 'green'; } function resetstyle(elemid) { elem = document.getelementbyid(elemid); elem.style.background = 'white'; } </script> <style type="text/css"> #p1 { border: solid blue 2px; } </style> </head> <body> <!-- passes a reference to the element's object as parameter 'this'.
... --> <p id="p1" onclick="alterstyle(this);"> click here to change background color.
CanvasRenderingContext2D.setLineDash() - Web APIs
it uses an array of values that specify alternating lengths of lines and gaps which describe the pattern.
... syntax ctx.setlinedash(segments); parameters segments an array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units).
Document.alinkColor - Web APIs
one alternative is the css selector :active.
... another alternative is document.body.alink, although this is deprecated in html 4.01 in favor of the css alternative.
Document.bgColor - Web APIs
WebAPIDocumentbgColor
the recommended alternative is use of the css style background-color which can be accessed through the dom with document.body.style.backgroundcolor.
... another alternative is document.body.bgcolor, although this is also deprecated in html 4.01 in favor of the css alternative.
Document.enableStyleSheetsForSet() - Web APIs
specify an empty string for the name parameter to disable all alternate and preferred style sheets (but not the persistent style sheets; that is, those with no title attribute).
... calling this method with a null name has no effect; if you want to disable all alternate and preferred style sheets, you must pass "", the empty string.
Document.fgColor - Web APIs
WebAPIDocumentfgColor
the recommended alternative is the css property color (e.g., document.body.style.color = "red").
... another alternative is document.body.text, although this is deprecated in html 4.01 in favor of the css alternative above.
Document.linkColor - Web APIs
as an alternative, you can set the css color property on either html anchor links (<a>) or on :link pseudo-classes.
... another alternative is document.body.link, although this is deprecated in html 4.01.
Document.vlinkColor - Web APIs
the recommended alternative is to get/set the color of the css :visited pseudo-class on html <a> elements (e.g., a:visited {color:red;}).
... another alternative is document.body.vlink, although this is deprecated in html 4.01 in favor of the css alternative.
Using the W3C DOM Level 1 Core - Web APIs
for example, the following document <html> <head> <title>my document</title> </head> <body> <h1>header</h1> <p>paragraph</p> </body> </html> has a dom tree that looks like this: (note that, although the above tree is similar to the above document's dom tree, it's not identical, as the actual dom tree preserves whitespace.) when a web browser parses an html document, it builds a dom tree and then uses it to display the document.
...it's a reasonably clear spec, although it is formal.
Document Object Model (DOM) - Web APIs
usually, that means javascript, although modeling html, svg, or xml documents as objects are not part of the core javascript language, as such.
... svg interfaces svg element interfaces svgaelement svgaltglyphelement svgaltglyphdefelement svgaltglyphitemelement svganimationelement svganimateelement svganimatecolorelement svganimatemotionelement svganimatetransformelement svgcircleelement svgclippathelement svgcolorprofileelement svgcomponenttransferfunctionelement svgcursorelement svgdefselement svgdescelement svgelement svgellipseelement svgfeblendelement svgfecolormat...
Element.animate() - Web APIs
WebAPIElementanimate
direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
...although this is technically optional, keep in mind that your animation will not run if this value is 0.
Element.classList - Web APIs
WebAPIElementclassList
using classlist is a convenient alternative to accessing an element's list of classes as a space-delimited string via element.classname.
... the domtokenlist itself is read-only, although you can modify it using the add() and remove() methods.
Using Fetch - Web APIs
fetch provides a better alternative that can be easily used by other technologies such as service workers.
... chunk.length) { // last line didn't end in a newline char yield chunk.substr(startindex); } } async function run() { for await (let line of maketextfilelineiterator(urloffile)) { processline(line); } } run(); checking that the fetch was successful a fetch() promise will reject with a typeerror when a network error is encountered or cors is misconfigured on the server-side, although this usually means permission issues or similar — a 404 does not constitute a network error, for example.
FileSystem - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemchrome full support 7alternate name full support 7alternate name alternate name uses the non-standard name: domfilesystemedge full support ≤18prefixed notes full support ≤18prefixed notes prefixed implemented with the vendor prefix: webkitnotes edge only supports this api in drag-an...
... no support noopera full support 15prefixed full support 15prefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1webview android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: domfilesystemchrome android full support 18alternate name full support 18alternate name alternate name uses the non-standard name: domfilesystemfirefox android ...
FileSystemDirectoryEntry - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemdirectoryentry experimentalchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: directoryentryedge full support 79prefixed full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support ...
... no support noopera full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1webview android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: directoryentrychrome android full support 18alternate name full support 18alternate name alternate name uses the non-standard name: directoryentryfirefox android ...
FileSystemDirectoryReader - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemdirectoryreader deprecatednon-standardchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: directoryreaderedge full support ≤18alternate name full support ≤18alternate name alternate name uses the non-standard name: webkitdirectoryreaderfirefox full ...
... no support noopera full support yesprefixed full support yesprefixed prefixed implemented with the vendor prefix: webkitsafari full support 11.1webview android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: directoryreaderchrome android full support 18alternate name full support 18alternate name alternate name uses the non-standard name: directoryreaderfirefox android ...
FileSystemEntry - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystementry experimentalchrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: entryedge full support 79prefixed full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support 50ie...
... no support noopera no support nosafari full support 11.1webview android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: entrychrome android full support 18alternate name full support 18alternate name alternate name uses the non-standard name: entryfirefox android full support 50opera android no support nosafari ios f...
FileSystemFileEntry - Web APIs
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfilesystemfileentrychrome full support 8alternate name full support 8alternate name alternate name uses the non-standard name: fileentryedge full support 79prefixed full support 79prefixed prefixed implemented with the vendor prefix: webkitfirefox full support ...
...50ie no support noopera no support nosafari full support 11.1webview android full support ≤37alternate name full support ≤37alternate name alternate name uses the non-standard name: fileentrychrome android full support 18alternate name full support 18alternate name alternate name uses the non-standard name: fileentryfirefox android full support 50opera android no support nosafari ios ...
Introduction to the File and Directory Entries API - Web APIs
the file and directory entries api and other storage apis the file and directory entries api is an alternative to other storage apis like indexeddb, websql (which has been deprecated since november18, 2010), and appcache.
...although the error callbacks for the methods are optional parameters, they are not optional for your sanity.
GlobalEventHandlers.onanimationcancel - Web APIs
#box { width: var(--boxwidth); height: var(--boxwidth); left: 0; top: 0; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; animation: 5s ease-in-out 0s infinite alternate both slidebox; } the animation's keyframes are described next, plotting a course from the top-left corner of the content box to the bottom-right corner.
... @keyframes slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } since the animation is described as taking place an infinite number of times, alternating direction each time, the box will glide back and forth between the two corners until stopped or the page is closed.
HTMLCollection - Web APIs
an alternative to accessing collection[i] (which instead returns undefined when i is out-of-bounds).
... an alternative to accessing collection[name] (which instead returns undefined when name does not exist).
HTMLElement: change event - Web APIs
the change event is fired for <input>, <select>, and <textarea> elements when an alteration to the element's value is committed by the user.
... unlike the input event, the change event is not necessarily fired for each alteration to an element's value.
HTMLImageElement.srcset - Web APIs
alternatively, you can use a pixel density descriptor, which specifies the condition in which the corresponding image resource should be used as the display's pixel density.
... <div class="box"> <img src="/files/16797/clock-demo-200px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 1x, /files/16797/clock-demo-400px.png 2x"> </div> css the css simply specifies that the image and its surrounding box should be 200 pixels square and should have a simple border around it.
HTMLImageElement - Web APIs
htmlimageelement.alt a domstring that reflects the alt html attribute, thus indicating the alternate fallback content to be displayed if the image has not been loaded.
... example var img1 = new image(); // image constructor img1.src = 'image1.png'; img1.alt = 'alt'; document.body.appendchild(img1); var img2 = document.createelement('img'); // use dom htmlimageelement img2.src = 'image2.jpg'; img2.alt = 'alt text'; document.body.appendchild(img2); // using first image in the document alert(document.images[0].src); specifications specification status comment css object model (cssom) view modulethe definition of 'extensions...
HTMLTableCellElement - Web APIs
htmltablecellelement.abbr a domstring which can be used on <th> elements (not on <td>), specifying an alternative label for the header cell..
... this alternate label can be used in other contexts, such as when describing the headers that apply to a data cell.
Dragging and Dropping Multiple Items - Web APIs
although not required, you should always add the same formats for each item.
... dt.mozsetdataat("application/x-moz-file", file, 0); by using this method, you can file objects, although you do not necessarily need to support multiple items.
History.pushState() - Web APIs
WebAPIHistorypushState
title most browsers currently ignore this parameter, although they may use it in the future.
...alternatively, you could pass a short title for the state to which you're moving.
History.replaceState() - Web APIs
title most browsers currently ignore this parameter, although they may use it in the future.
...alternatively, you could pass a short title for the state.
Basic concepts - Web APIs
alternatively, you can also look up records in an object store using the key.
... alternatively, you can also look up records in an object store using the index.
Using IndexedDB - Web APIs
var customerobjectstore = db.transaction("customers", "readwrite").objectstore("customers"); customerdata.foreach(function(customer) { customerobjectstore.add(customer); }); }; }; as indicated previously, onupgradeneeded is the only place where you can alter the structure of the database.
... one common pattern with cursors is to retrieve all objects in an object store and add them to an array, like this: var customers = []; objectstore.opencursor().onsuccess = function(event) { var cursor = event.target.result; if (cursor) { customers.push(cursor.value); cursor.continue(); } else { console.log("got all customers: " + customers); } }; note: alternatively, you can use getall() to handle this case (and getallkeys()) .
KeyframeEffect.KeyframeEffect() - Web APIs
direction optional whether the animation runs forwards (normal), backwards (reverse), switches direction after each iteration (alternate), or runs backwards and switches direction after each iteration (alternate-reverse).
...although this is technically optional, keep in mind that your animation will not run if this value is 0.
MediaDevices.getUserMedia() - Web APIs
possible errors are: aborterror although the user and operating system both granted access to the hardware device, and no hardware issues occurred that would cause a notreadableerror, some problem occurred which prevented the device from being used.
... notreadableerror although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or web page level which prevented access to the device.
Recording a media element - Web APIs
the "download" button will download the received data (although it's in a raw, unwrapped form that isn't very useful).
...we always record no more than the specified number of milliseconds of media, although if the media stops before that time is reached, mediarecorder automatically stops recording as well.
NameList - Web APIs
WebAPINameList
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
... note: although this interface was previously implemented in gecko, there was no way to actually create one.
NamedNodeMap - Web APIs
objects inside a namednodemap are not in any particular order, unlike nodelist, although they may be accessed by an index as in an array.
... although called namednodemap, this interface doesn't deal with node objects but with attr objects, which were originally a specialized class of node, and still are in some implementations.
Node.textContent - Web APIs
WebAPINodetextContent
although the names seem similar, there are important differences: textcontent gets the content of all elements, including <script> and <style> elements.
...(reflows can be computationally expensive, and thus should be avoided when possible.) unlike textcontent, altering innertext in internet explorer (version 11 and below) removes child nodes from the element and permanently destroys all descendant text nodes.
Pbkdf2Params - Web APIs
salt a buffersource.
...unlike the input key material passed into derivekey(), salt does not need to be kept secret.
RTCIceServer - Web APIs
credentialtype optional if the rtciceserver represents a turn server, this attribute specifies what kind of credential is to be used when connecting.
... this must be one of the values defined by the rtcicecredentialtype enum.
RTCPeerConnection.addTrack() - Web APIs
this is perfectly acceptable, although it will be up to the remote peer to decide what stream to insert the track into, if any.
...this includes things like changes to the transceiver's direction and tracks being halted using removetrack().
RTCPeerConnection.createDataChannel() - Web APIs
alternatively (true), they can be negotiated out of-band, where both sides call createdatachannel with an agreed-upon id.
...nopen = function(event) { channel.send('hi you!'); } channel.onmessage = function(event) { console.log(event.data); } // answerer side var pc = new rtcpeerconnection(options); pc.ondatachannel = function(event) { var channel = event.channel;  channel.onopen = function(event) { channel.send('hi back!'); } channel.onmessage = function(event) { console.log(event.data); } } alternatively, more symmetrical out-of-band negotiation can be used, using an agreed-upon id (0 here): // both sides var pc = new rtcpeerconnection(options); var channel = pc.createdatachannel("chat", {negotiated: true, id: 0}); channel.onopen = function(event) { channel.send('hi!'); } channel.onmessage = function(event) { console.log(event.data); } for a more thorough example showing how the ...
RTCRtpSender.setParameters() - Web APIs
transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
... an attempt has been made to alter a property that cannot be changed after the sender is first created.
SpeechRecognition - Web APIs
the speechrecognitionresult.isfinal property is false.) speechrecognition.maxalternatives sets the maximum number of speechrecognitionalternatives provided per result.
...| sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color; bg.style.backgroundcolor = col...
Using readable streams - Web APIs
consuming a fetch as a stream the fetch api allows you to fetch resources across the network, providing a modern alternative to xhr.
...this mixin is implemented by both the request and response interfaces, so it is available on both, although consuming the stream of a response body is perhaps a bit more obvious.
SubtleCrypto.deriveBits() - Web APIs
let salt; /* get some key material to use as input to the derivebits method.
...*/ async function getderivedbits() { const keymaterial = await getkeymaterial(); salt = window.crypto.getrandomvalues(new uint8array(16)); const derivedbits = await window.crypto.subtle.derivebits( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, 256 ); const buffer = new uint8array(derivedbits, 0, 5); const derivedbitsvalue = document.queryselector(".pbkdf2 .derived-bits-value"); derivedbits...
SubtleCrypto.deriveKey() - Web APIs
it derives key material by applying a function such as hmac to the input password along with some salt, and repeating this process many times.
...*/ function getkeymaterial() { let password = window.prompt("enter your password"); let enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), "pbkdf2", false, ["derivebits", "derivekey"] ); } async function encrypt(plaintext, salt, iv) { let keymaterial = await getkeymaterial(); let key = await window.crypto.subtle.derivekey( { "name": "pbkdf2", salt: salt, "iterations": 100000, "hash": "sha-256" }, keymaterial, { "name": "aes-gcm", "length": 256}, true, [ "encrypt", "decrypt" ] ); return window.crypto.subtle.encrypt( { name: "aes-gcm", iv: iv }, ...
SubtleCrypto.importKey() - Web APIs
a json web key looks something like this (this is an ec private key): { "crv": "p-384", "d": "wouctu7nw4e8_7n5c1-xbjb4xqsb_lizhymsy8mggxuny6q8ncoh9xsiviwlffk_", "ext": true, "key_ops": ["sign"], "kty": "ec", "x": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqygpcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; examples note: you can try the working examples on github.
... const jwkeckey = { "crv": "p-384", "d": "wouctu7nw4e8_7n5c1-xbjb4xqsb_lizhymsy8mggxuny6q8ncoh9xsiviwlffk_", "ext": true, "key_ops": ["sign"], "kty": "ec", "x": "szrrxmyi8vwfjg1dpunbfcc9jzvjzefh7ulki1ukxaltd7rgwrcffxqygpcwu6aq", "y": "hhuag3ovdzer0uuqnd4pxhqtxp5idgdyhjhl-wlkjngjqaw0rngy5v29-av-ysew" }; /* import a pem encoded rsa private key, to use for rsa-pss signing.
Touch events - Web APIs
alternatively, some frameworks have taken to refiring touch events as mouse events for this same purpose.
...= null; var touch = null; switch (evt.type) { case "touchstart": type = "mousedown"; touch = evt.changedtouches[0]; break; case "touchmove": type = "mousemove"; touch = evt.changedtouches[0]; break; case "touchend": type = "mouseup"; touch = evt.changedtouches[0]; break; } newevt.initmouseevent(type, true, true, evt.originaltarget.ownerdocument.defaultview, 0, touch.screenx, touch.screeny, touch.clientx, touch.clienty, evt.ctrlkey, evt.altkey, evt.shiftkey, evt.metakey, 0, null); evt.originaltarget.dispatchevent(newevt); } calling preventdefault() only on a second touch one technique for preventing things like pinchzoom on a page is to call preventdefault() on the second touch in a series.
USBDevice - Web APIs
WebAPIUSBDevice
usbdevice.clearhalt() returns a promise that resolves when a halt condition is cleared.
... usbdevice.selectalternateinterface() returns a promise that resolves when the specified alternative endpoint is selected.
UserDataHandler - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...in both document.importnode() and node.clonenode(), although user data is not copied over, the handler will be called.
Vibration API - Web APIs
vibration patterns an array of values describes alternating periods in which the device is vibrating and not vibrating.
... each value in the array is converted to an integer, then interpreted alternately as the number of milliseconds the device should vibrate and the number of milliseconds it should not be vibrating.
Basic scissoring - Web APIs
although the clear() drawing command writes the clear color (set by clearcolor()) to all pixels in the drawing buffer, scissor() defines a mask that only allows pixels inside the specified rectangular area to be updated.
...in other cases, the fragments may be discarded altogether (so the pixel value is not updated), or it may interact with the already existing pixel value (such as when doing color blending for non-opaque elements in the scene).
WebGL model view projection - Web APIs
the view matrix is responsible for moving the objects in the scene to simulate the position of the camera being changed, altering what the viewer is currently able to see.
...the result should be identical to the last example: cubedemo.prototype.computesimpleprojectionmatrix = function(scalefactor) { this.transforms.projection = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, scalefactor, 0, 0, 0, scalefactor ]; }; although the result is identical, the important step here is in the vertex shader.
Using DTMF with WebRTC - Web APIs
note, however, that although it's possible to send dtmf using webrtc, there is currently no way to detect or receive incoming dtmf.
...although this method is obsolete, this example supports it as a fallback to let older browsers (and those not yet updated to support the current webrtc dtmf api) run the example.
Geometry and reference spaces in WebXR - Web APIs
scaling is the use of a matrix to alter the size of an object.
... to support progressive enhancement—and thus broaden the availability of your app or site—you should choose a reference space that offers the lowest amount of functionality needed, or provide a fallback mechanism that detects failed attempts to obtain reference spaces and tries again with a less powerful alternative.
Rendering and the WebXR frame animation callback - Web APIs
see optimizing by rendering in object-first order for an alternative approach that renders each object twice back-to-back, once for each eye, before moving on to the next object that makes up the scene for that frame; that is, rendering in object-first order.
...in the next section, we look at an altered approach that reduces these state changes substantially, providing a potentially much faster rendering approach, especially as your object count goes up.
Using IIR filters - Web APIs
demo our simple example for this guide provides a play/pause button that starts and pauses audio play, and a toggle that turns an iir filter on and off, altering the tone of the sound.
... browser support iir filters are supported well across modern browsers, although they have been implemented more recently than some of the more longstanding web audio api features, like biquad filters.
Using the Web Audio API - Web APIs
example code our boombox looks like this: note the retro cassette deck with a play button, and vol and pan sliders to allow you to alter the volume and stereo panning.
...depending on the use case, there's a myriad of options, but we'll provide functionality to play/pause the sound, alter the track's volume, and pan it from left to right.
Web Speech API - Web APIs
speechrecognitionalternative represents a single word that has been recognised by the speech recognition service.
... speechrecognitionresult represents a single recognition match, which may contain multiple speechrecognitionalternative objects.
Window.crypto - Web APIs
WebAPIWindowcrypto
although the property itself is read-only, all of its methods (and the methods of its child object, subtlecrypto) are not read-only, and therefore vulnerable to attack by polyfill.
... although window.crypto is available on all windows, the returned crypto object only has one usable feature in insecure contexts: the getrandomvalues() method.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
code an alternative syntax that allows you to include a string instead of a function, which is compiled and executed when the timer expires.
...ll(myarray, myarray.mymethod, 2.5*1000, 2); // same error possible solutions a common way to solve the problem is to use a wrapper function that sets this to the required value: settimeout(function(){myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(function(){myarray.mymethod('1')}, 2.5*1000); // prints "one" after 2.5 seconds arrow functions are a possible alternative, too: settimeout(() => {myarray.mymethod()}, 2.0*1000); // prints "zero,one,two" after 2 seconds settimeout(() => {myarray.mymethod('1')}, 2.5*1000); // prints "one" after 2.5 seconds another possible way to solve the "this" problem is to replace the host settimeout() and setinterval() global functions with ones that allow passing a this object and set it in the callback using function.
XRView.eye - Web APIs
WebAPIXRVieweye
updateinjury() returns true if the eye is still injured or false if the eye has been restored to health by the function,.
... if the result is false, indicating that the eye is now healthy, we render the scene for that eye.
ARIA: banner role - Accessibility
<div role="banner"> <img src="companylogo.svg" alt="my company name" /> <h1>title</h1> <h2>subtitle</h2> </div> by default, the html5 <header> element has an identical meaning to the banner landmark, unless it is a descendant of <aside>, <article>, <main>, <nav>, or <section>.
... <div role="banner"> <a href="#nav" id="skiptomenu" class="skiptocontent">skip to keyboard navigation</a> <img src="images/w3c.png" alt="w3c logo"> <h1>aria landmarks</h1> <p>identifying page subsections for easy navigation</p> </div> we could also have written the above with the html header element: <header> <a href="#nav" id="skiptomenu" class="skiptocontent">skip to keyboard navigation</a> <img src="images/w3c.png" alt="w3c logo"> <h1>aria landmarks</h1> <p>identifying page subsections for easy navigation</p> </h...
ARIA: listbox role - Accessibility
multiple selection: authors may implement either of two interaction models to support multiple selection: a recommended model that does not require the user to hold a modifier key, such as shift or control, while navigating the list or an alternative model that does require modifier keys to be held while navigating in order to avoid losing selection states.
... required javascript features selecting an option in a single select listbox when the user selects an option, the following must occur: deselect the previously selected option, setting the aria-selected to false, or removing the attribute altogether, changing the appearance of the newly unselected option to appear not selected.
An overview of accessible web applications and widgets - Accessibility
ckbox or radio button aria-disabled: indicates that an element is visible, but not editable or otherwise operable aria-grabbed: indicates the 'grabbed' state of an object in a drag-and-drop operation (for a full list of aria states, consult the aria list of states and properties.) developers should use aria states to indicate the state of ui widget elements and use css attribute selectors to alter the visual appearance based on the state changes (rather than using script to change a class name on the element).
...instead, implement the "view" mode using a different element altogether, such as a <div> or <span> with a role of button, and the « edit » mode using a text <input> element.
Accessibility Information for Web Authors - Accessibility
it can perform a "complete webpage quality check" for accessibility, privacy, searchability, metadata and even alt text attribute quality.
... this document tackles such difficulties and shows several interactive desktop-style widgets such as tree views, menu bars and spreadsheets which are accessible both with the keyboard and assistive technologies such as screen readers, screen magnifiers and alternative input devices.
Operable - Accessibility
the conformance criteria under this guideline ensures that users are able to interact with digital technology using different input methods beyond a keyboard or mouse (including touchscreen, voice, device motion, or alternative input devices.
... understanding target size 2.5.6 concurrent input mechanisms (aaa) added in 2.1 make sure people can use and switch between different modes of input when interacting with digital content including touchscreen, keyboard, mouse, voice commands, or alternative input devices.
-webkit-device-pixel-ratio - CSS: Cascading Style Sheets
the -webkit-device-pixel-ratio is a non-standard boolean css media feature which is an alternative to the standard resolution media feature.
...although the value is a <number>, and thus doesn't syntactically allow units, its implicit unit is dppx.
prefers-reduced-data - CSS: Cascading Style Sheets
reduce indicates that user has expressed the preference for lightweight alternate content.
... user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating system.
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
lumns: 1fr 2fr; grid-template-areas: "img content"; margin-bottom: 1em; } .media::after { content: ""; display: block; clear: both; } .media .image { float: left; width: 150px; margin-right: 20px; } .media .text { padding: 10px; align-self: end; } <div class="media"> <div class="image"><img src="https://udn.realityripple.com/samples/89/f993f273dd.png" alt="placeholder"></div> <div class="text">this is a media object example.
...using display: inline-block is an alternate method.
Grid wrapper - CSS: Cascading Style Sheets
useful fallbacks or alternative methods when using this recipe at page level it can be useful to set a max-width along with left and right auto margins to center the content horizontally: .grid { max-width: 1200px; margin: 0 auto; // horizontally centers the container } /* remove the max-width and margins if the browser supports grid */ @supports (display: grid) { .grid { display: grid; /* other grid co...
... accessibility concerns although grid enables us to position items anwhere (within reason), it is important when placing items using css grid that your underlying markup follows a logical order (see css grid layout and accessibility for more details).
Specificity - CSS: Cascading Style Sheets
although technically !important has nothing to do with specificity, it interacts directly with it.
... some examples with a higher specificity: table td { height: 50px !important; } .mytable td { height: 50px !important; } #mytable td { height: 50px !important; } b) or add the same selector after the existing one: td { height: 50px !important; } c) or, preferably, rewrite the original rule to avoid the use of !important altogether.
animation-fill-mode - CSS: Cascading Style Sheets
the last keyframe depends on the value of animation-direction and animation-iteration-count: animation-direction animation-iteration-count last keyframe encountered normal even or odd 100% or to reverse even or odd 0% or from alternate even 0% or from alternate odd 100% or to alternate-reverse even 100% or to alternate-reverse odd 0% or from backwards the animation will apply the values defined in the first relevant keyframe as soon as it is applied to the target, and retain this during the animation-delay period.
... the first relevant keyframe depends on the value of animation-direction: animation-direction first relevant keyframe normal or alternate 0% or from reverse or alternate-reverse 100% or to both the animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions.
animation - CSS: Cascading Style Sheets
WebCSSanimation
tion> = <time> | <timing-function> | <time> | <single-animation-iteration-count> | <single-animation-direction> | <single-animation-fill-mode> | <single-animation-play-state> | [ none | <keyframes-name> ]where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function><single-animation-iteration-count> = infinite | <number><single-animation-direction> = normal | reverse | alternate | alternate-reverse<single-animation-fill-mode> = none | forwards | backwards | both<single-animation-play-state> = running | paused<keyframes-name> = <custom-ident> | <string>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and mu...
...hite; float: left; margin-right: 2%; } .view_port { background-color: black; height: 25px; width: 100%; overflow: hidden; } .cylon_eye { background-color: red; background-image: linear-gradient(to right, rgba(0, 0, 0, .9) 25%, rgba(0, 0, 0, .1) 50%, rgba(0, 0, 0, .9) 75%); color: white; height: 100%; width: 20%; -webkit-animation: 4s linear 0s infinite alternate move_eye; animation: 4s linear 0s infinite alternate move_eye; } @-webkit-keyframes move_eye { from { margin-left: -20%; } to { margin-left: 100%; } } @keyframes move_eye { from { margin-left: -20%; } to { margin-left: 100%; } } see using css animations for additional examples.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
although it is supported in most modern browsers, its implementation varies widely.
.../div> chrome safari edge media-play-button div{ color: black; -webkit-appearance: media-play-button; } <div>lorem</div> chrome safari edge media-overlay-play-button div{ color: black; -webkit-appearance: media-overlay-play-button; } <div>lorem</div> chrome safari media-return-to-realtime-button div{ color: black; -moz-appearance: media-return-to-realtime-button; -webkit-appearance: media-return-to-realtime-button; } <div>lorem</div> safari media-rewind-button div{ color: black; -moz-appearance: media-rewind-button; -webkit-appearance: media-rewind-button; } <div>lorem</div> safari media...
border - CSS: Cascading Style Sheets
WebCSSborder
alternatively, you can target one border at a time with the physical (e.g., border-top ) and logical (e.g., border-block-start) border properties.
... according to the spec, outlines don't have to be rectangular, although they usually are.
color-adjust - CSS: Cascading Style Sheets
exact the element's content has been specifically and carefully crafted to use colors, images, and styles in a thoughtful and/or important way, such that being altered by the browser might actually make things worse rather than better.
...for example, a page might include a list of information with rows whose background colors alternate between white and a light grey.
conic-gradient() - CSS: Cascading Style Sheets
the transitions between colors can be altered with color hints between adjacent colors' color stops.
...while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images provide no native way to assign alternative text, and therefore the image represented by the conic gradient will not be accessible to screen reader users.
display - CSS: Cascading Style Sheets
WebCSSdisplay
if you want to visually hide the element, a more accessible alternative is to use a combination of properties to remove it visually from the screen but keep it parseable by assistive technology such as screen readers.
... more accessible markup with display: contents | hidde de vries display: contents is not a css reset | adrian roselli tables changing the display value of a <table> element to block, grid, or flex will alter its representation in the accessibility tree.
font-variant-caps - CSS: Cascading Style Sheets
the font-variant-caps css property controls the use of alternate glyphs for capital letters.
... values normal deactivates of the use of alternate glyphs.
font-variant-east-asian - CSS: Cascading Style Sheets
the font-variant-east-asian css property controls the use of alternate glyphs for east asian scripts, like japanese and chinese.
...ant-east-asian: full-width; /* <east-asian-width-values> */ font-variant-east-asian: proportional-width; /* <east-asian-width-values> */ font-variant-east-asian: ruby full-width jis83; /* global values */ font-variant-east-asian: inherit; font-variant-east-asian: initial; font-variant-east-asian: unset; syntax values normal this keyword leads to the deactivation of the use of such alternate glyphs.
font-variant-numeric - CSS: Cascading Style Sheets
the font-variant-numeric css property controls the usage of alternate glyphs for numbers, fractions, and ordinal markers.
... values normal this keyword leads to the deactivation of the use of such alternate glyphs.
<frequency> - CSS: Cascading Style Sheets
WebCSSfrequency
note: although the number 0 is always the same regardless of unit, the unit may not be omitted.
...0 although unitless zero is an allowable <length>, it's an invalid <frequency>.
repeating-conic-gradient() - CSS: Cascading Style Sheets
the transitions between colors can be altered with color hints between adjacent colors' color stops.
...while it is possible to create pie charts, checkerboards, and other effects with conic gradients, css images provide no native way to assign alternative text, and therefore the image represented by the conic gradient will not be accessible to screen reader users.
<time-percentage> - CSS: Cascading Style Sheets
valid percentages 50% +50% optional plus sign -50% negative percentages are not valid for all properties that accept percentages invalid percentages 50 % space not allowed between the space and the percentage sign valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital letters are not recommended.
... +0s zero with a leading + and a unit -0ms zero with a leading - and a unit invalid times 0 although unitless zero is allowed for <length>s, it's invalid for <time>s.
<transform-function> - CSS: Cascading Style Sheets
the most common is the cartesian coordinate system, although homogeneous coordinates are also sometimes used.
... transformation functions transformation functions alter the appearance of an element by manipulating the values of its coordinates.
vertical-align - CSS: Cascading Style Sheets
entagesrefer to the line-height of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise the keyword as specifiedanimation typea length formal syntax baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length> examples basic example html <div>an <img src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a default alignment.</div> <div>an <img class="top" src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a text-top alignment.</div> <div>an <img class="bottom" src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a text-bottom alignment.</d...
...iv> <div>an <img class="middle" src="https://udn.realityripple.com/samples/b4/e1f0faff5b.svg" alt="link" width="32" height="32" /> image with a middle alignment.</div> css img.top { vertical-align: text-top; } img.bottom { vertical-align: text-bottom; } img.middle { vertical-align: middle; } result specifications specification status comment css level 2 (revision 1)the definition of 'vertical-align' in that specification.
CSS: Cascading Style Sheets
WebCSS
css tutorials our css learning area contains a wealth of tutorials to take you from beginner level to proficiency, covering all the fundamentals.
... css first steps css (cascading style sheets) is used to style and layout web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
Audio and video manipulation - Developer guides
ordinarily, if you were implementing a "play video in greyscale" feature, you'd probably add display: none to the style for the <video> element, to keep the source video from being drawn to the screen while showing only the canvas showing the altered frames.
...nd <canvas> element like this: <video id="my-video" controls="true" width="480" height="270" crossorigin="anonymous"> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type="video/webm"> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type="video/mp4"> </video> <canvas id="my-canvas" width="480" height="270"></canvas> javascript this code handles altering the frames.
DOM onevent handlers - Developer guides
you don't need to call them yourself, although you can do so in many cases to easily simulate an event taking place.
... this continues until every handler has been called, unless one of the event handlers explicitly halts the processing of the event by calling stoppropagation() on the event object itself.
Using HTML sections and outlines - Developer guides
the heading does not require the use of the <header> element <section> <h1>amazing mdn contributors</h1> <ul> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> </ul> </section> aside element the <aside> element defines related content that has a different placement than the main content.
... <section> <h1>amazing mdn contributors</h1> <ul> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> </ul> <aside> <p>to get involved contact</p> </aside> </section> nesting aside elements the <aside> element can be nested inside of other sectional html elements.
Index - Developer guides
WebGuideIndex
currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast.
...if you need to slightly alter the site’s message for mobile users, but want to reap the benefits of a responsive design, a hybrid approach may be your best bet.
Parsing and serializing XML - Developer guides
the two types are essentially the same; the difference is largely historical, although differentiating has some practical benefits as well.
...alternatively, use a dom tree obtained from xmlhttprequest.
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
using target="_blank" without rel="noreferrer" and rel="noopener" makes the website vulnerable to window.opener api exploitation attacks (vulnerability description), although note that, in newer browser versions (e.g.
... link that opens a new tab/window <a target="_blank" href="https://www.wikipedia.org"> wikipedia (opens in new tab) </a> link to a non-html resource <a href="2017-annual-report.ppt"> 2017 annual report (powerpoint) </a> if an icon is used to signify link behavior, make sure it has alt text: <a target="_blank" href="https://www.wikipedia.org"> wikipedia <img alt="(opens in new tab)" src="newtab.svg"> </a> <a href="2017-annual-report.ppt"> 2017 annual report <img alt="(powerpoint file)" src="ppt-icon.svg"> </a> webaim: links and hypertext - hypertext links mdn / understanding wcag, guideline 3.2 g200: opening new windows and tabs from a link only when necessary ...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
WebHTMLElementapplet
alt this attribute causes a descriptive text alternate to be displayed on browsers that do not support java.
... page designers should also remember that content enclosed within the <applet> element may also be rendered as alternative text.
<center>: The Centered Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcenter
<p>so will this paragraph.</p></center> example 2 (css alternative) <div style="text-align:center">this text will be centered.
... <p>so will this paragraph.</p></div> example 3 (css alternative) <p style="text-align:center">this line will be centered.<br> and so will this line.</p> note applying text-align:center to a <div> or <p> element centers the contents of those elements while leaving their overall dimensions unchanged.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
it is sent after the state is changed, although if the state changes multiple times before the browser can dispatch the event, the events are coalesced so that only one is sent.
... an input device as well as some form of output device is recommended.</p> </details> result customizing the disclosure widget the disclosure triangle itself can be customized, although this is not as broadly supported.
<header> - HTML: Hypertext Markup Language
WebHTMLElementheader
historical usage although the <header> element didn't make its way into specifications until html5, it actually existed at the very beginning of html.
... examples page header <header> <h1>main page title</h1> <img src="mdn-logo-sm.png" alt="mdn logo"> </header> article header <article> <header> <h2>the planet earth</h2> <p>posted on wednesday, <time datetime="2017-10-04">4 october 2017</time> by jane smith</p> </header> <p>we live on a planet that's blue and green, with so many things still unseen.</p> <p><a href="https://janesmith.com/the-planet-earth/">continue reading....</a></p> </article> specifications specification status comment ...
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
so the html5 (w3c) specification provides advice on how to mark up subheadings, subtitles, alternative titles and taglines without using <hgroup>.
... the <hgroup> element allows the primary heading for a document section to be grouped with any secondary headings—such as subheadings or alternative titles—to form a multi-level heading.
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
by specifying appearance: none, you can remove the native styling altogether, and create your own styles for them.
...although it is supported in most modern browsers, its implementation varies widely.
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
note: the following input attributes do not apply to the input range: accept, alt, checked, dirname, formaction, formenctype, formmethod, formnovalidate, formtarget, height, maxlength, minlength, multiple, pattern, placeholder, readonly, required, size, src, and width.
... html use similar html as in the previous examples, we add the attribute with a value of vertical: <input type="range" min="0" max="11" value="7" step="1" orient="vertical"> writing-mode: bt-lr; the writing-mode property should generally not be used to alter text direction for internationalization or localization purposes, but can be used for special effects.
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
basic example <form> <div> <input type="search" id="mysearch" name="q"> <button>search</button> </div> </form> this renders like so: q is the most common name given to search inputs, although it's not mandatory.
... look at the following example: <form> <div> <input type="search" id="mysearch" name="q" placeholder="search the site..."> <button>search</button> </div> </form> you can see how the placeholder is rendered below: search form labels and accessibility one problem with search forms is their accessibility; a common design practice is not to provide a label for the search field (although there might be a magnifying glass icon or similar), as the purpose of a search form is normally fairly obvious for sighted users due to placement (this example shows a typical pattern).
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
here's the previous example with the s access key added: <form> <div> <label for="example">let's submit some text</label> <input id="example" type="text" name="text"> </div> <div> <input type="submit" value="send" accesskey="s"> </div> </form> for example, in firefox for mac, pressing control-option-s triggers the send button, while chrome on windows uses alt+s.
...adding a tooltip to the button (using the title attribute) can also help, although it's not a complete solution for accessibility purposes.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
by convention, the user agent defaults to rendering the contents of a <kbd> element using its default monospace font, although this is not mandated by the html standard.
... you can define a custom style to override the browser's default font selection for the <kbd> element, although the user's preferences may potentially override your css.
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnoembed
the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use.
... show an alternative content <embed type="vide/webm" src="/media/examples/flower.mp4" width="200" height="200"> <noembed> <h1>alternative content</h1> </noembed> </embed> ...
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
WebHTMLElementnoframes
although most commonly-used browsers support frames, there are exceptions, including certain special-use browsers including some mobile browsers, as well as text-mode browsers.
... <noframes> can be used to present a message explaining that the user's browser doesn't support frames, but ideally should be used to present an alternate form of the site that doesn't use frames but still offers the same or similar functionality.
<small>: the side comment element - HTML: Hypertext Markup Language
WebHTMLElementsmall
<small>this whole sentence is in small letters.</small> </p> css alternative <p>this is the first sentence.
... recommendation notes although the <small> element, like the <b> and <i> elements, may be perceived to violate the principle of separation between structure and presentation, all three are valid in html5.
<sub>: The Subscript element - HTML: Hypertext Markup Language
WebHTMLElementsub
for example, using <sub> to style the name of a company which uses altered baselines in their wordmark would not be appropriate; instead, css should be used (likely the vertical-align property, such as vertical-align: sub or, to more precisely control the baseline shift, vertical-align: -25%.
... marking up the subscript in mathematical variable numbers (although you may also consider using a mathml formula for this).
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
summary this attribute defines an alternative text that summarizes the content of the table.
... ideally, consider alternate ways to present the table's content, including breaking it apart into a collection of smaller, related tables that don't have to rely on using the colspan and rowspan attributes.
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
advanced styling now we'll go all-out, with styles on rows in the header and body areas both, including alternating row colors, cells with different colors depending on position within a row, and so forth.
... color every body other row differently it's common to help improve readability of table data by alternating row colors.
accesskey - HTML: Hypertext Markup Language
the way to activate the accesskey depends on the browser and its platform: windows linux mac firefox alt + shift + key on firefox 57 or newer: control + option + key or control + alt + key on firefox 14 or newer: control + alt + key on firefox 13 or older: control + key internet explorer alt + key alt + shift + key n/a edge n/a control + option + key control + option + shift + key google chrome alt + shift + key safari ...
... n/a opera 15+ alt + key control + alt + key opera 12 shift + esc opens a contents list which are accessible by accesskey, then, can choose an item by pressing key accessibility concerns in addition to poor browser support, there are numerous concerns with the accesskey attribute: an accesskey value can conflict with a system or browser keyboard shortcut, or assistive technology functionality.
itemprop - HTML: Hypertext Markup Language
three properties with values that are strings <div itemscope> <p>my name is <span itemprop="name">neil</span>.</p> <p>my band is called <span itemprop="band">four parts water</span>.</p> <p>i am <span itemprop="nationality">british</span>.</p> </div> one property, "image", whose value is a url <div itemscope> <img itemprop="image" src="google-logo.png" alt="google"> </div> when a string value can't be easily read and understood by a person (e.g., a long string of numbers and letters), it can be displayed using the value attribute of the data element, with the more easily-understood-by-a human-version given in the element's contents (which is not part of the structured data - see example below).
... a meter element <div itemscope itemtype="http://schema.org/product"> <span itemprop="name">panasonic white 60l refrigerator</span> <img src="panasonic-fridge-60l-white.jpg" alt=""> <div itemprop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> <meter itemprop="ratingvalue" min=0 value=3.5 max=5>rated 3.5/5</meter> (based on <span itemprop="reviewcount">11</span> customer reviews) </div> </div> similarly, for date- and time-related data, the time element and its datetime attribute can be used.
itemscope - HTML: Hypertext Markup Language
rop="aggregaterating" itemscope itemtype="http://schema.org/aggregaterating"> <span itemprop="ratingvalue">4.0</span> stars based on <span itemprop="reviewcount">35</span> reviews </span> <br> prep time: <time datetime="pt30m" itemprop="preptime">30 min</time><br> cook time: <time datetime="pt1h" itemprop="cooktime">1 hou</time>r<br> total time: <time datetime="pt1h30m" itemprop="totaltime">1 hour 30 min</time><br> yield: <span itemprop="recipeyield">1 9" pie (8 servings)</span><br> <span itemprop="nutrition" itemscope itemtype="http://schema.org/nutritioninformation"> serving size: <span itemprop="servingsize">1 medium slice</span><br> calories per serving: <span itemprop="calories">250 cal</span><br> fat per serving: <span itemprop="fatcontent">12 g</span><br> ...
... itemprop preptime pt30m itemprop cooktime pt1h itemprop totaltime pt1h30m itemprop recipeyield 1 9" pie (8 servings) itemprop recipeingredient thinly-sliced apples: 6 cups itemprop recipeingredient white sugar: 3/4 cup itemprop recipeinstructions 1.
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
165 <noembed>: the embed fallback element (obsolete) element, embedded content, embedding, html, non-standard, obsolete, reference, noembed the <noembed> element is an obsolete, non-standard way to provide alternative, or "fallback", content for browsers that do not support the <embed> element or do not support the type of embedded content an author wishes to use.
... 175 <picture>: the picture element element, graphics, html, html embedded content, images, reference, web, webp, picture the html <picture> element contains zero or more <source> elements and one <img> element to offer alternative versions of an image for different display/device scenarios.
Inline elements - HTML: Hypertext Markup Language
block elements, on the other hand, typically cause a line break to occur (although, as usual, this can be changed using css).
... list of "inline" elements the following elements are inline by default (although block and inline elements are no longer defined in html 5, use content categories instead): <a> <abbr> <acronym> <audio> (if it has visible controls) <b> <bdi> <bdo> <big> <br> <button> <canvas> <cite> <code> <data> <datalist> <del> <dfn> <em> <embed> <i> <iframe> <img> <input> <ins> <kbd> <label> <map> <mark> <meter> <noscript> <object> <output> <picture> <progress> <q> <ruby> <s> <samp> <script> <select> <slot> <small> <span> <strong> <sub> <sup> <svg> <template> <textarea> <time> <u> <tt> <var> <video> <wbr> see also block-level elements html element reference display content categories block and inline layout in normal flow ...
Using the application cache - HTML: Hypertext Markup Language
if any errors occur, the browser sends an error event, and the update halts.
... in firefox, the offline cache data is stored separately from the firefox profile—next to the regular disk cache: windows vista/7: c:\users\<username>\appdata\local\mozilla\firefox\profiles\<salt>.<profile name>\offlinecache mac/linux: /users/<username>/library/caches/firefox/profiles/<salt>.<profile name>/offlinecache in firefox the current status of the offline cache can be inspected on the about:cache page (under the "offline cache device" heading).
Microformats - HTML: Hypertext Markup Language
img/alt, abbr/title.
... the value of each property is defined in html using the class property any element can carry example h-card <p class="h-card"> <img class="u-photo" src="http://example.org/photo.png" alt="" /> <a class="p-name u-url" href="http://example.org">joe bloggs</a> <a class="u-email" href="mailto:joebloggs@example.com">joebloggs@example.com</a>, <span class="p-street-address">17 austerstræti</span> <span class="p-locality">reykjavík</span> <span class="p-country-name">iceland</span> </p> property description p-name the full/formatted name of the pers...
Data URLs - HTTP
encoding on a unix system base64 encoding of a file or string on linux and mac os x systems can be achieved using the command-line base64 (or, as an alternative, the uuencode utility with -m argument).
... length limitations although firefox supports data urls of essentially unlimited length, browsers are not required to support any particular maximum length of data.
MIME types (IANA media types) - HTTP
alternative mime types for xhtml (like application/xhtml+xml) are mostly useless nowadays.
...theora is the usual video codec used within it; vorbis is the usual audio codec, although opus is becoming more common.
Compression in HTTP - HTTP
compression algorithms used for files can be grouped into two broad categories: loss-less compression, where the compression-uncompression cycle doesn't alter the data that is recovered.
... lossy compression, where the cycle alters the original data in a (hopefully) imperceptible way for the user.
Configuring servers for Ogg media - HTTP
as an inferior alternative, gecko can estimate the video length based on the content-length.
... although it's unlikely, it's possible the browser may advertise that it supports http compression (gzip/deflate) using the accept-encoding: gzip,deflate header when requesting media files.
Connection management in HTTP/1.x - HTTP
alternatively this may be called a keep-alive connection.
...the typical mss (maximum segment size), is big enough to contain several simple requests, although the demand in size of http requests continues to grow.
An overview of HTTP - HTTP
WebHTTPOverview
although important to diagnose network problems, the underlying layers are mostly irrelevant to the description of http.
...these can be transparent, forwarding on the requests they receive without altering them in any way, or non-transparent, in which case they will change the request in some way before passing it along to the server.
A typical HTTP session - HTTP
WebHTTPSession
an absolute url without the protocol or domain name the http protocol version subsequent lines represent an http header, giving the server information about what type of data is appropriate (e.g., what language, what mime types), or other data altering its behavior (e.g., not sending an answer if it is already cached).
...although they can also be nouns, these requests methods are sometimes referred as http verbs.
JavaScript data types and data structures - JavaScript
however, you are able to notice this when you divide by zero: > 42 / +0 infinity > 42 / -0 -infinity although a number often represents only its value, javascript provides binary (bitwise) operators.
... caution: although bitwise operators can be used to represent several boolean values within a single number using bit masking, this is usually considered a bad practice.
Functions - JavaScript
self.age++; }, 1000); } alternatively, a bound function could be created so that the proper this value would be passed to the growup() function.
...note: coercion inside the isnan function has interesting rules; you may alternatively want to use number.isnan(), as defined in ecmascript 2015, or you can use typeof to determine if the value is not-a-number.
Indexed collections - JavaScript
alternatively, create an empty array first before adding the single element to it.
... the foreach() method provides another way of iterating over an array: let colors = ['red', 'green', 'blue'] colors.foreach(function(color) { console.log(color) }) // red // green // blue alternatively, you can shorten the code for the foreach parameter with es2015 arrow functions: let colors = ['red', 'green', 'blue'] colors.foreach(color => console.log(color)) // red // green // blue the function passed to foreach is executed once for every item in the array, with the array item passed as the argument to the function.
Regular expressions - JavaScript
var myre = /d(b+)d/g; var myarray = myre.exec('cdbbdbsbz'); if you do not need to access the properties of the regular expression, an alternative way of creating myarray is with this script: var myarray = /d(b+)d/g.exec('cdbbdbsbz'); // similar to "cdbbdbsbz".match(/d(b+)d/g); however, // "cdbbdbsbz".match(/d(b+)d/g) outputs array [ "dbbd" ], while // /d(b+)d/g.exec('cdbbdbsbz') outputs array [ 'dbbd', 'bb', index: 1, input: 'cdbbdbsbz' ].
... (see different behaviors for further info about the different behaviors.) if you want to construct the regular expression from a string, yet another alternative is this script: var myre = new regexp('d(b+)d', 'g'); var myarray = myre.exec('cdbbdbsbz'); with these scripts, the match succeeds and returns the array and updates the properties shown in the following table.
Working with objects - JavaScript
alternatively, you can first create a constructor function and then instantiate an object invoking that function in conjunction with the new operator.
... using a constructor function alternatively, you can create an object with these two steps: define the object type by writing a constructor function.
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
javascript execution won't be halted.
... examples setting source maps setting a source map by using a comment in the file: //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map or, alternatively, you can set a header to your javascript file: x-sourcemap: /path/to/file.js.map ...
Warning: expression closures are deprecated - JavaScript
javascript execution won't be halted.
... var x = function() { return 1; } var obj = { count: function() { return 1; } }; standard syntax using arrow functions alternatively, you can use arrow functions: var x = () => 1; standard syntax using shorthand method syntax expression closures can also be found with getter and setter, like this: var obj = { get x() 1, set x(v) this.v = v }; with es2015 method definitions, this can be converted to: var obj = { get x() { return 1 }, set x(v) { this.v = v } }; ...
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
javascript execution won't be halted.
... //# sourcemappingurl=http://example.com/path/to/your/sourcemap.map or, alternatively, you can set a sourcemap header to your javascript file to avoid having a comment at all: sourcemap: /path/to/file.js.map ...
Array.prototype.reduce() - JavaScript
examples sum all the values of an array let sum = [0, 1, 2, 3].reduce(function (accumulator, currentvalue) { return accumulator + currentvalue }, 0) // sum is 6 alternatively written with an arrow function: let total = [ 0, 1, 2, 3 ].reduce( ( accumulator, currentvalue ) => accumulator + currentvalue, 0 ) sum of values in an object array to sum up, the values contained in an array of objects, you must supply an initialvalue, so that each item passes through your function.
... let initialvalue = 0 let sum = [{x: 1}, {x: 2}, {x: 3}].reduce(function (accumulator, currentvalue) { return accumulator + currentvalue.x }, initialvalue) console.log(sum) // logs 6 alternatively written with an arrow function: let initialvalue = 0 let sum = [{x: 1}, {x: 2}, {x: 3}].reduce( (accumulator, currentvalue) => accumulator + currentvalue.x , initialvalue ) console.log(sum) // logs 6 flatten an array of arrays let flattened = [[0, 1], [2, 3], [4, 5]].reduce( function(accumulator, currentvalue) { return accumulator.concat(currentvalue) }, [] ) // flattened is [0, 1, 2, 3, 4, 5] alternatively written with an arrow function: let flattened = [[0, 1], [2, 3], [4, 5]].reduce( ( accumulator, currentvalue ) => accumulator.concat(currentvalue), [] ) cou...
Array.prototype.map() - JavaScript
map does not mutate the array on which it is called (although callback, if invoked, may do so).
... a simpler way to achieve the above, while avoiding the "gotcha": ['1', '2', '3'].map(number) // [1, 2, 3] // but unlike parseint(), number() will also return a float or (resolved) exponential notation: ['1.1', '2.2e2', '3e300'].map(number) // [1.1, 220, 3e+300] // for comparison, if we use parseint() on the array above: ['1.1', '2.2e2', '3e300'].map( str => parseint(str) ) // [1, 2, 3] one alternative output of the map method being called with parseint as a parameter runs as follows: let xs = ['10', '10', '10'] xs = xs.map(parseint) console.log(xs) // actual result of 10,nan,2 may be unexpected based on the above description.
Array.prototype.push() - JavaScript
although strings are native, array-like objects, they are not suitable in applications of this method, as strings are immutable.
...obj.addelem({}) obj.addelem({}) console.log(obj.length) // → 2 note that although obj is not an array, the method push successfully incremented obj's length property just like if we were dealing with an actual array.
DataView - JavaScript
precision may be lost'); return combined; } alternatively, if you need full 64-bit range, you can create a bigint.
... further, although native bigints are much faster than user-land library equivalents, bigints will always be much slower than 32-bit integers in javascript due to the nature of their variable size.
JSON.stringify() - JavaScript
replacer optional a function that alters the behavior of the stringification process, or an array of string and number that serve as an allowlist for selecting/filtering the properties of the value object to be included in the json string.
...// '{"obj":"now i am a nested object under key 'obj'"}' json.stringify([ obj ]); // '["now i am a nested object under key '0'"]' issue with json.stringify() when serializing circular references note that since the json format doesn't support object references (although an ietf draft exists), a typeerror will be thrown if one attempts to encode an object with circular references.
Map - JavaScript
in the current ecmascript specification, -0 and +0 are considered equal, although this was not so in earlier drafts.
...for this reason (and because there were no built-in alternatives), objects have been used as maps historically.
String - JavaScript
for example: let s1 = '2 + 2' // creates a string primitive let s2 = new string('2 + 2') // creates a string object console.log(eval(s1)) // returns the number 4 console.log(eval(s2)) // returns the string "2 + 2" for these reasons, the code may break when it encounters string objects when it expects a primitive string instead, although generally, authors need not worry about the distinction.
...type.fontcolor() <font color="color"> string.prototype.fontsize() <font size="size"> string.prototype.italics() <i> string.prototype.link() <a href="url"> (link to url) string.prototype.small() <small> string.prototype.strike() <strike> string.prototype.sub() <sub> string.prototype.sup() <sup> examples string conversion it's possible to use string as a more reliable tostring() alternative, as it works when used on null, undefined, and on symbols.
isNaN() - JavaScript
note, coercion inside the isnan function has interesting rules; you may alternatively want to use number.isnan(), as defined in ecmascript 2015.
...alternatively, in the absence of number.isnan, the expression (x != x) is a more reliable way to test whether variable x is nan or not, as the result is not subject to the false positives that make isnan unreliable.
Lexical grammar - JavaScript
*/ console.log('hello world!'); } comment(); you can also use it in the middle of a line, if you wish, although this can make your code harder to read so it should be used with caution: function comment(x) { console.log('hello ' + x /* insert the value of x */ + ' !'); } comment('world'); in addition, you can use it to disable code to prevent it from running, by wrapping code in a comment, like this: function comment() { /* console.log('hello world!'); */ } comment(); in this case, the console...
... although bom before hashbang comment will work in a browser it is not advised to use bom in a script with hasbang.
delete operator - JavaScript
object.defineproperty(globalthis, 'variable1', { value: 10, configurable: true, }); object.defineproperty(globalthis, 'variable2', { value: 10, configurable: false, }); // syntaxerror in strict mode.
...console.log(delete func); // false cross-browser notes although ecmascript makes iteration order of objects implementation-dependent, it may appear that all major browsers support an iteration order based on the earliest added property coming first (at least for properties not on the prototype).
this - JavaScript
// in web browsers, the window object is also the global object: console.log(this === window); // true a = 37; console.log(window.a); // 37 this.b = "mdn"; console.log(window.b) // "mdn" console.log(b) // "mdn" note: you can always easily get the global object using the global globalthis property, regardless of the current context in which your code is running.
... function f1() { return this; } // in a browser: f1() === window; // true // in node: f1() === globalthis; // true in strict mode, however, if the value of this is not set when entering an execution context, it remains as undefined, as shown in the following example: function f2() { 'use strict'; // see strict mode return this; } f2() === undefined; // true in the second example, this should be undefined, because f2 was called directly and not as a method or property of an object (e.g.
export - JavaScript
bindings that are exported can still be modified locally; when imported, although they can only be read by the importing module the value updates whenever it is updated by the exporting module.
...r html page, we could have: import { cube, foo, graph } from './my-module.js'; graph.options = { color:'blue', thickness:'3px' }; graph.draw(); console.log(cube(3)); // 27 console.log(foo); // 4.555806215962888 it is important to note the following: you need to include this script in your html with a <script> element of type="module", so that it gets recognised as a module and dealt with appropriately.
for...in - JavaScript
alternatively, if you know there won't be any outside code interference, you can extend built-in prototypes with a check method.
...although arrays are often more practical for storing data, in situations where a key-value pair is preferred for working with data (with properties acting as the "key"), there may be instances where you want to check if any of those keys hold a particular value.
with - JavaScript
the recommended alternative is to assign the object whose properties you want to access to a temporary variable.
... performance pro & contra pro: the with statement can help reduce file size by reducing the need to repeat a lengthy object reference without performance penalty.
<mglyph> - MathML
WebMathMLElementmglyph
attributes alt this attribute defines the alternative text describing the image.
... examples <math> <mi><mglyph src="my-glyph.png" alt="my glyph"/></mi> </math> specifications specification status comment mathml 3.0the definition of 'mglyph' in that specification.
Handling media support issues in web content - Web media technologies
a similar concept can be applied to still images; if an image you wish to present is very large and may take time to download (especially for slower devices or connections), you can offer a lower-resolution or alternate version that will be displayed until the full-quality version is available to be displayed.
... <img src="/images/stafff-photo-huge-progressive.jpg" alt="staff photo, taken in january of 1972"> when using a progressive image, the data is stored in such a way that the browser is able to render a low-quality representation of the image as soon as possible, then update the image as it loads—or after it's finished loading—to present it in full quality.
Codecs used by WebRTC - Web media technologies
non-webrtc products that are able to communicate with webrtc to some extent may or may not support these codecs, although they're encouraged to by the specification documents.
... customizing the codec list once you have a list of the available codecs, you can alter it and then send the revised list to rtcrtptransceiver.setcodecpreferences() to rearrange the codec list.
Populating the page: how browsers work - Web Performance
<!doctype html> <html> <head> <meta charset="utf-8"/> <title>my simple page</title> <link rel="stylesheet" src="styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image description"/> </div> <script src="anotherscript.js"></script> </body> </html> this response for this initial request contains the first byte of data received.
... <link rel="stylesheet" src="styles.css"/> <script src="myscript.js" async></script> <img src="myimage.jpg" alt="image description"/> <script src="anotherscript.js" async></script> in this example, while the main thread is parsing the html and css, the preload scanner will find the scripts and image, and start downloading them as well.
Web Performance
alternative media formats when it comes to images and videos, there are more formats than you're likely aware of.
...in this guide we'll discuss some alternative media formats, how to use them responsibly so that non-supporting browsers don't get left out in the cold, and some advanced guidance on transcoding your existing assets to them.
Progressive web app structure - Progressive web apps (PWAs)
nitial-scale=1"> <meta property="og:image" content="icons/icon-512.png"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="style.css"> <link rel="manifest" href="js13kpwa.webmanifest"> <script src="data/games.js" defer></script> <script src="app.js" defer></script> </head> <body> <header> <p><a class="logo" href="http://js13kgames.com"><img src="img/js13kgames.png" alt="js13kgames"></a></p> </header> <main> <h1>js13kgames a-frame entries</h1> <p class="description">list of games submitted to the <a href="http://js13kgames.com/aframe">a-frame category</a> in the <a href="http://2017.js13kgames.com">js13kgames 2017</a> competition.
...first of all it generates the content based on this template: var template = "<article>\n\ <img src='data/img/slug.jpg' alt='name'>\n\ <h3>#pos.
Progressive loading - Progressive web apps (PWAs)
first of all, you should use tools or services similar to tinypng, which will reduce the file size of your images without altering the quality too much.
...the js13kpwa app uses a placeholder image instead, which is small and lightweight, while the final paths to target images are stored in data-src attributes: <img src='data/img/placeholder.png' data-src='data/img/slug.jpg' alt='name'> those images will be loaded via javascript after the site finishes building the html structure.
Graphic design for responsive sites - Progressive web apps (PWAs)
the downsides here are that css3 properties and svg don't work on old browsers such as ie6-8 (although polyfills are available, and you could build in fallbacks), and svg isn't suitable for high detail images, such as photographs.
...it is very powerful when combined with other technologies, although its complexity is a barrier for non-developers.
Mobile first - Progressive web apps (PWAs)
mobile constraints we have already mentioned the fact that mobiles generally have less memory, processing power and bandwidth than other devices (although bear in mind that smart tvs are also generally pretty low powered.) they also have less viewport size available.
...when they are not supported, the <html> tag looks like this: <html class=" js no-rgba no-multiplebgs"> when these are present, we can serve alternative styling rules to provide sensible fallbacks using descendant selectors — see the following in my code.
Structural overview of progressive web apps - Progressive web apps (PWAs)
nitial-scale=1"> <meta property="og:image" content="icons/icon-512.png"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="style.css"> <link rel="manifest" href="js13kpwa.webmanifest"> <script src="data/games.js" defer></script> <script src="app.js" defer></script> </head> <body> <header> <p><a class="logo" href="http://js13kgames.com"><img src="img/js13kgames.png" alt="js13kgames"></a></p> </header> <main> <h1>js13kgames a-frame entries</h1> <p class="description">list of games submitted to the <a href="http://js13kgames.com/aframe"> a-frame category</a> in the <a href="http://2017.js13kgames.com">js13kgames 2017</a> competition.
... the first thing it does is to generate the app's displayed content using the following template: var template = "<article>\n\ <img src='data/img/slug.jpg' alt='name'>\n\ <h3>#pos.
dominant-baseline - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has effect on the text content elements, including: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } text { font: bold 14px verdana, helvetica, arial, sans-serif; } <svg viewbox="0 0 200 120" xmlns="http://www.w3.org/2000/svg"> <path d="m20,20 l180,20 m20,50 l180,50 m20,80 l180,80" stroke="grey" /> <text dominant-baseline="baseline" x="30" y="20">baseline</text> <text dominant-baseline="middle...
... if this property occurs on a <tspan>, <tref>, <altglyph>, or <textpath> element, then the dominant-baseline and the baseline-table components remain the same as those of the parent text content element.
font-variant - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-variant="normal">normal text</text> <text x="100" y="20" font-variant="small-caps">small-caps text</text> </svg> usage notes value normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contex...
...tual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ] default value normal animatable yes for a description of the values, please refer to the css font-variant property.
glyph-orientation-vertical - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value auto | <angle> default value auto animatable no auto fullwidth ideographic and fullwidth latin text will be set with a glyph orientation of 0 degrees.
... ideographic punctuation and other ideographic characters having alternate horizontal and vertical forms will use the vertical form of the glyph.
requiredFeatures - SVG: Scalable Vector Graphics
twentynine elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <circle>, <clippath>, <cursor>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <use> html, body, svg { height: 100%; } text { fill: white; } <svg viewbox="0 0 250 45" xmlns="http://www.w3...
... http://www.w3.org/tr/svg11/feature#text the browser supports the <text>, <tspan>, <tref>, <textpath>, <altglyph>, <altglyphdef>, <altglyphitem> and <glyphref> elements.
stroke-dasharray - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element, but it only has effect on the following twelve elements: <altglyph> <circle> <ellipse> <path> <line> <polygon> <polyline> <rect> <text> <textpath> <tref> <tspan> html,body,svg { height:100% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- no dashes nor gaps --> <line x1="0" y1="1" x2="30" y2="1" stroke="black" /> <!-- dashes and gaps of the same size --> <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="4" /> <!-- dashes and gap...
...es and gaps of various sizes with an even number of values --> <line x1="0" y1="9" x2="30" y2="9" stroke="black" stroke-dasharray="4 1 2 3" /> </svg> usage notes value none | <dasharray> default value none animatable yes <dasharray> a list of comma and/or white space separated <length>s and <percentage>s that specify the lengths of alternating dashes and gaps.
systemLanguage - SVG: Scalable Vector Graphics
35 elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <audio>, <canvas>, <circle>, <clippath>, <cursor>, <defs>, <discard>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <textpath>, <tref>, <tspan>, <unknown>, <use>, and <video> usage notes value <language-tags> default value none animatable no <language-tags> the value is a set of comma-separated tokens, each of which must be a language-tag value, as defined in bcp 47.
... note: if several alternative language objects are enclosed in a <switch> and none of them matches, this may lead to situations where no content is displayed.
text-anchor - SVG: Scalable Vector Graphics
each text chunk has an initial current text position, which represents the point in the user coordinate system resulting from (depending on context) application of the x and y attributes on the <text> element, any x or y attribute values on a <tspan>, <tref> or <altglyph> element assigned explicitly to the first rendered character in a text chunk, or determination of the initial current text position for a <textpath> element.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --> <path d="m60,15 l60,110 m30,40 l90,40 m30,75 l90,75 m30,110 l90,110" stroke="grey" /> <!-- anchors in action --> <text text-anchor="start" x="60" y="40">a</text> <text text-anchor="middle" x="60" y="75">a</text> <text text-anchor="end" x="60" y="110">a</text> <!-- materialisation of anchors --> <circle cx="60" cy="40" r="3" fill="red" /> <circle cx="60" cy="75" r="3" fill="red" /> <circle...
writing-mode - SVG: Scalable Vector Graphics
the writing-mode attribute applies only to <text> elements; the attribute is ignored for <tspan>, <tref>, <altglyph> and <textpath> sub-elements.
... as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes default value horizontal-tb value horizontal-tb | vertical-rl | vertical-lr animatable yes horizontal-tb this value defines a top-to-bottom block flow direction.
Content type - SVG: Scalable Vector Graphics
no embedded white space is allowed in clock values, although leading and trailing white space characters will be ignored.
... svg supports all of the syntax alternatives for <color> defined in css2 syntax and basic data types, and (depend on the implementation) in the future css color module level 3.
SVG element reference - SVG: Scalable Vector Graphics
WebSVGElement
nt>, <solidcolor> renderable elements <a>, <circle>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <unknown>, <use> shape elements <circle>, <ellipse>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect> structural elements <defs>, <g>, <svg>, <symbol>, <use> text content elements <altglyph>, <altglyphdef>, <altglyphitem>, <glyph>, <glyphref>, <textpath>, <text>, <tref>, <tspan> text content child elements <altglyph>, <textpath>, <tref>, <tspan> uncategorized elements <clippath>, <color-profile>, <cursor>, <filter>, <foreignobject>, <hatchpath>, <meshpatch>, <meshrow>, <script>, <style>, <view> obsolete and deprecated elements warning: these are old svg elements which ar...
... a <altglyph>, <altglyphdef>, <altglyphitem>, <animatecolor> c <cursor> f <font>, <font-face>, <font-face-format>, <font-face-name>, <font-face-src>, <font-face-uri> g <glyph>, <glyphref> h <hkern> m <missing-glyph> t <tref> v <vkern> ...
Mixed content - Web security
mixed passive/display content mixed passive/display content is content served over http that is included in an https webpage, but that cannot alter other portions of the webpage.
...this type of mixed content can alter the behavior of the https page and potentially steal sensitive data from the user.
Transport Layer Security - Web security
although tls can be used on top of any low-level transport protocol, the original goal of the protocol was to encrypt http traffic.
...alternative mechanisms are in the process of being developed, which will also support http/2.
Types of attacks - Web security
the traffic is passed through, possibly with alterations.
... alternatively, if the parent domain does not use http strict-transport-security with includesubdomains set, a user subject to an active mitm (perhaps connected to an open wifi network) could be served a response with a set-cookie header from a non-existent sub-domain.
HTML Imports - Web Components
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
...until there is a consensus on the standard or alternative mechanisms are worked out, you can use a polyfill such as google's webcomponents.js.
Using shadow DOM - Web Components
as an example, consider the following html fragment: <!doctype html> <html> <head> <meta charset="utf-8"> <title>simple dom example</title> </head> <body> <section> <img src="dinosaur.png" alt="a red tyrannosaurus rex: a two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p> </section> </body> </html> this fragment produces the following dom structure: shadow dom allows hidden dom trees to be attached to elements in ...
...ements to the shadow dom shadow.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); using our custom element once the class is defined, using the element is as simple as defining it, and putting it on the page, as explained in using custom elements: // define the new element customelements.define('popup-info', popupinfo); <popup-info img="img/alt.png" data-text="your card validation code (cvc) is an extra security feature — it is the last 3 or 4 numbers on the back of your card."> internal versus external styles in the above example we apply style to the shadow dom using a <style> element, but it is perfectly possible to do it by referencing an external styleshee...
Introduction to using XPath in JavaScript - XPath
contextnode.documentelement : contextnode.ownerdocument.documentelement ); or alternatively by using the <code>creatensresolver</code> method of a <code>xpathevaluator</code> object.
... numbervalue stringvalue booleanvalue example the following uses the xpath expression count(//p) to obtain the number of <p> elements in an html document: var paragraphcount = document.evaluate( 'count(//p)', document, null, xpathresult.any_type, null ); alert( 'this document contains ' + paragraphcount.numbervalue + ' paragraph elements' ); although javascript allows us to convert the number to a string for display, the xpath interface will not automatically convert the numerical result if the stringvalue property is requested, so the following code will not work: var paragraphcount = document.evaluate('count(//p)', document, null, xpathresult.any_type, null ); alert( 'this document contains ' + paragraphcount.stringvalue + ' paragrap...
XPath
note: support for xpath varies widely; it's supported reasonably well in firefox (although there are no plans to improve support further), while other browsers implement it to a lesser extent, if at all.
...in these cases jxon could represent the most practical way and valid alternative to xpath.
An Overview - XSLT: Extensible Stylesheet Language Transformations
the outermost element in an xslt stylesheet must be the <xsl:stylesheet> element (an acceptable alternate is the <xsl:transform> element).
...although xsl is the conventionally used shorthand name (called the prefix), it is not mandatory and it is quite possible to choose a different one.
Understanding WebAssembly text format - WebAssembly
although the browser compiles it to something more efficient, wasm execution is defined in terms of a stack machine where the basic idea is that every type of instruction pushes and/or pops a certain number of i32/i64/f32/f64 values to/from a stack.
...to deal with strings and other more complex data types, webassembly provides memory (although we also have reference types in newer implementation of webassembly).
Communicating With Other Scripts - Archive of obsolete content
ontent scripts in the above examples need to be rewritten like this: // content-script.js document.defaultview.postmessage("message from content script", "http://my-domain.org/"); // content-script.js document.defaultview.addeventlistener('message', function(event) { console.log(event.data); // message from page script console.log(event.origin); }, false); using custom dom events as an alternative to using postmessage() you can use custom dom events to communicate between page scripts and content scripts.
Interacting with page scripts - Archive of obsolete content
so the content scripts in the above examples need to be rewritten like this: // talk.js document.defaultview.postmessage("message from content script", "http://my-domain.org/"); // listen.js document.defaultview.addeventlistener('message', function(event) { console.log(event.data); // message from page script console.log(event.origin); }, false); using custom dom events as an alternative to using postmessage() you can use custom dom events to communicate between page scripts and content scripts.
Content Processes - Archive of obsolete content
although e10s has now been suspended, the sdk was designed with this multiprocess model in mind.
Private Properties - Archive of obsolete content
a better alternative is to use weakmap objects, which solve both these problems.
Module structure of the SDK - Archive of obsolete content
although the sdk repository in github includes copies of these modules, they are built into firefox and by default, when you run or build an add-on using jpm run or jpm xpi, it is the versions of the modules in firefox that are used.
SDK API Lifecycle - Archive of obsolete content
migration the deprecation period defaults to 18 weeks (that is, three releases) although in some cases, generally those out of our control, it might be shorter than this.
Working with Events - Archive of obsolete content
then in the constructor you can assign a listener function to this property as an alternative to calling the object's on() method.
XUL Migration Guide - Archive of obsolete content
for example, action buttons appear by default in the main firefox toolbar (although users may relocate them by toolbar customization) because it makes for a better user experience for add-ons to expose their interfaces in a consistent way.
page-mod - Archive of obsolete content
once all the content (dom, js, css, images) has been loaded, at the time the window.onload event fires var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*", contentscript: 'window.alert("matched!");', contentscriptwhen: "start" }); if you specify "start" for contentscriptwhen, your scripts will not be able to interact with the document's dom right away (although they could listen for window.onload or domcontentloaded themselves).
panel - Archive of obsolete content
panel limitations although panels can host html documents, they are not implemented as browser tabs, so many things that work in normal web pages do not work inside panels: prior to firefox 33, you don't get a context menu.
simple-prefs - Archive of obsolete content
hidden a boolean value which, if present and set to true, means that the preference won't appear in the add-ons manager interface, so users of your add-on won't be able to see or alter it.
/loader - Archive of obsolete content
this alternative approach of providing capabilities via modules makes it possible to build module capability graphs by analyzing require statements.
dev/panel - Archive of obsolete content
ass } = require("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool", icon: "./my-devtool.png", url: "./my-devtool.html", setup: function(options) { // my setup goes here }, dispose: function() { // my teardown goes here }, onready: function() { // i can send messages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", ....
places/bookmarks - Archive of obsolete content
ave } = require("sdk/places/bookmarks"); let group = group({ title: "guitars" }); let bookmarks = [ bookmark({ title: "ran", url: "http://ranguitars.com", group: group }), bookmark({ title: "ibanez", url: "http://ibanez.com", group: group }), bookmark({ title: "esp", url: "http://espguitars.com", group: group }) ]; // save `bookmarks` array -- notice we don't have `group` in the array, // although it needs to be saved since all bookmarks are children // of `group`.
test/assert - Archive of obsolete content
for all other object pairs, including array objects, equivalence is determined by having the same number of owned properties (as verified with object.prototype.hasownproperty.call), the same set of keys (although not necessarily the same order), equivalent values for every corresponding key, and an identical "prototype" property.
ui/button/action - Archive of obsolete content
this is an alternative way to set or get the global state.
ui/frame - Archive of obsolete content
ready this event is emitted while a frame instance is being loaded, at the point where it becomes possible to interact with the frame although sub-resources may still be in the process of loading.
ui/sidebar - Archive of obsolete content
alternatively, the view->sidebar submenu in firefox will contain a new item which the user can use to show or hide the sidebar: the sidebar generates a show event when it is shown and a hide event when it is hidden.
ui/toolbar - Archive of obsolete content
showing and hiding toolbars by default, a toolbar is shown when it is created, although you can specify that a toolbar should be hidden initially by passing hidden:true as an option in its constructor.
util/array - Archive of obsolete content
otherwise, this function does not alter the array and returns false.
cfx - Archive of obsolete content
so you just have to make up a path and name the first time, and keep using it: cfx run --profiledir=~/addon-dev/profiles/boogaloo the path must contain at least one "/" (although you may specify just "./dir").
cfx to jpm - Archive of obsolete content
with cfx, this defaults to "lib/main.js", although it can be set to a different file using the main field in package.json.
package.json - Archive of obsolete content
preferences-branch use this to specify an alternative branch for your add-on's simple-prefs.
Storing annotations - Archive of obsolete content
by omitting the "private-browsing" key from the annotator's "package.json" file, the annotator opts out of private browsing altogether.
Creating Reusable Modules - Archive of obsolete content
md5 is a commonly used hash function: although it's no longer considered secure, it works fine outside a security context.
Display a Popup - Archive of obsolete content
you can run content scripts in the panel: although the script running in the panel can't directly access your main add-on code, you can exchange messages between the panel script and the add-on code.
Getting Started (jpm) - Archive of obsolete content
if firefox can not be located, or you have installed firefox developer as an alternate browser, you may need to provide the path to it.
Getting started (cfx) - Archive of obsolete content
an alternative development model is to use the extension auto-installer add-on: this listens for new xpi files on a specified port and installs them automatically.
Dialogs and Prompts - Archive of obsolete content
(although it seems to work in <window> as well).
HTML in XUL for rich tooltips - Archive of obsolete content
our enhanced xul tooltip is an element that is written ahead of time, and it contains an html div element whose type attribute lowers its privileges to being that content element, although it is an element of chrome.
JavaScript Debugger Service - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Preferences - Archive of obsolete content
calling .queryinterface(components.interfaces.nsiprefbranch2) is no longer required, although it still works.
QuerySelector - Archive of obsolete content
// if you'd like to convert it to a array for convenience, use this instead: // return array.prototype.slice.call(el.queryselectorall(selector)); } alert($('#myid').id); (note that while using the firefox web console, the above functions are available automatically.) both xul and even xml can be easily made supportable (an alternative approach to the following would be to add chromewindow.prototype or window.prototype, accessing this.document.queryselector, or following the jquery style of chaining by returning 'this' within each prototype method of $()): htmldocument.prototype.$ = function (selector) { // only for html return this.queryselector(selector); }; example: <h1>test!</h1> <script> htmldocument.prototyp...
Tabbox - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JavaScript Daemons Management - Archive of obsolete content
it also offers an alternative way to pass the this object to the callback functions (see the "this" problem for details).
Communication between HTML and your extension - Archive of obsolete content
after the html component was update with the result of the ajax request, i created and dispatched the event like this: var event = document.createevent("events"); event.initevent("my-custom-event", true, true); document.body.dispatchevent(event); in the code of the extension that catches the loading of a new page i added this code: var doc = aevent.originaltarget; // doc is document that triggered "onload" event // do something with the loaded page.
Chapter 1: Introduction to Extensions - Archive of obsolete content
themes, which alter firefox's appearance, are a kind of add-on.
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
css: a style language to alter the display of xml documents like xml, cascading style sheets (css) is a technical specification established by the w3c; it is a style-description language defining the display of data marked up in xml and html.
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
' [dir]' : '')); } alert(list.join('\n')); get parent directory although the nsilocalfile object does not contain a function for moving to higher directories, listing 10 does show how you can use the parent property to get the parent directory of the current file.
Adding Events and Commands - Archive of obsolete content
you can get information on key modifiers (in case the user was holding a modifier key like alt while performing the event), screen coordinates for mouse events, and most importantly, the target element for the event.
Appendix F: Monitoring DOM changes - Archive of obsolete content
this document lays out some alternatives which do not have such severe performance impacts.
Connecting to Remote Content - Archive of obsolete content
luckily, firefox now provides a few alternatives for extension developers.
Intercepting Page Loads - Archive of obsolete content
let doc = event.originaltarget; if (doc instanceof htmldocument) { // is this an inner frame?
Mozilla Documentation Roadmap - Archive of obsolete content
it is a good alternative if you feel planet mozilla is too much.
The Box Model - Archive of obsolete content
with these you can make an hbox have vertical orientation and viceversa, although that isn't very useful.
Performance best practices in extensions - Archive of obsolete content
as mutation events are officially deprecated, and there are many alternatives, they should be avoided at all costs.
Extensions support in SeaMonkey 2 - Archive of obsolete content
although this doesn't affect the appearance of the display, it may affect your extension if it overlays chrome relative to these elements.
Security best practices in extensions - Archive of obsolete content
while there are some legitimate use-cases, most of the time there are safer alternatives.
Firefox addons developer guide - Archive of obsolete content
an alternative idea: writing a "next step" guide for interested people such as adding statusbar buttons, sidebar panels, and so on.
Promises - Archive of obsolete content
these older interfaces should be avoided, even in their asynchronous forms, due to their performance penalties and needless complexity.
Using Dependent Libraries In Extension Components - Archive of obsolete content
/* * os x stubloader * original stubloader code by benjamin smedberg <benjamin@smedbergs.us> copyright (c) 2005 * adapted for os x by walter johnson <zinkyu@gmail.com>, sept.
Add-ons - Archive of obsolete content
bootstrapped extensions browser.bookmarks.export( function() {...} // optional function ) code snippets … creating custom firefox extensions with the mozilla build system there is a wealth of material on creating extensions for firefox.
Underscores in class and ID Names - Archive of obsolete content
although underscores are, as of this writing, technically permitted in class and id names, there are many historical and practical reasons why they should be avoided.
Creating reusable content with CSS and XBL - Archive of obsolete content
]]></body> </method> <method name="cleardemo"> <parameter name="me"/> <body><![cdata[ me.square.style.backgroundcolor = "transparent" me.square.style.marginleft = "0" me.button.removeattribute("disabled") ]]></body> </method> </implementation> <handlers> <handler event="click" button="0"><![cdata[ if (event.originaltarget == this.button) this.dodemo() ]]></handler> </handlers> </binding> </bindings> make a new css file, bind6.css.
XUL user interfaces - Archive of obsolete content
information: user interfaces although html has some support for user interfaces, it does not support all the features that you need to make a standalone application.
Case Sensitivity in class and id Names - Archive of obsolete content
summary: although css is itself case-insensitive, class and id names are defined to be case-sensitive in html 4.01.
Creating a status bar extension - Archive of obsolete content
although this sample extension only works in firefox, it's entirely possible to create extensions that work in multiple xul-based applications.
JXON - Archive of obsolete content
although the bidirectional conversion is very faithful (except for cdatasection nodes, which will be converted into text nodes), the process is unnecessarily costly.
List of Mozilla-Based Applications - Archive of obsolete content
efox sogo groupware front-end uses thunderbird code songbird music xulrunner application spicebird collaboration suite spiderape embedding tool uses mozilla spidermonkey splashtop web browser browser part of instant-on operating system sqlite-manager database manager standalone version of add-on stealthsurfer secure internet tools on usb key uses firefox and thunderbird streambase complex event processing platform seems to use xulrunner stylizer css editor css editor css editor with built-in firebug-like diagnostics and gecko 1.8 preview sun java enterprise system server products uses nss sundial browser with advanced domain name te...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
although it was corrected in mozilla mainstream: mozilla/extensions/pref/autoconfig/src/nsldapsyncquery.cpp 1.7.2.1 by late 2004, it is still present in thunderbird 1.0.2 at least :-(, so i applied the workaround i proposed in that bug report (start_pos += 1;).
Autodial for Windows NT - Archive of obsolete content
a pref to disable users can bypass the feature altogether by setting the pref network.autodial-helper.enabled to false.
How Mozilla finds its configuration files - Archive of obsolete content
mozilla includes a profile manager, but unfortunately this always include a random part (salt) into the profile's filename, and thus cannot be used to point mozilla to a profile of the our chosing.
Bookmark Keywords - Archive of obsolete content
changing the properties to alter the properties of the bookmark, highlight the bookmark and select the "properties..." button at the top of the bookmark manager.
Creating a Firefox sidebar extension - Archive of obsolete content
most additions are provided with a default tree structure, although not required it is recommended to use this structure.
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
although it is designed to retrieve xml content and parse it into a dom, it can retrieve (but not parse) other kinds of content as well.
Tinderbox - Archive of obsolete content
although there are multiple tinderbox clients machines doing different kinds of builds (f.e.
Creating a hybrid CD - Archive of obsolete content
i used version 1.8.1a03 although you'll probably want to get a newer one.
Creating regular expressions for a microsummary generator - Archive of obsolete content
handling https urls note: although ebay doesn't do this, occasionally a site will make pages available at both insecure and secure urls.
Dehydra - Archive of obsolete content
it presented a wealth of semantic information that can be queried with concise javascripts.
Drag and Drop JavaScript Wrapper - Archive of obsolete content
var textobserver = { ondrop : function (event, transferdata, session) { event.target.setattribute("value",transferdata.data); } } the flavour system used allows multiple objects of various types to be dragged at once and also allows alternative forms of the data to be dragged.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Error Console - Archive of obsolete content
alternatives console2 this extension provides a replacement for error console, fixing many of its bugs and implementing long-wanted enhancement requests.
Exception logging in JavaScript - Archive of obsolete content
alternatively, you can set the environment variable moz_report_all_js_exceptions.
JSS build instructions for OSX 10.6 - Archive of obsolete content
rg/jss_build_4.3.html ftp://ftp.mozilla.org/pub/mozilla.org/ <componente> /releases http://www.mozilla.org/projects/secu...using_jss.html steps: export all this: build_opt="1" cvsroot=":pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot" java_home=$(/usr/libexec/java_home") no_mdupdate="1" nsdistmode="copy" ns_use_gcc="1" create working dir: mkdir nss-jss cd nss-jss obtain source: altought manual said nspr_4_6_4_rtm, nss_3_11_4_rtm, jss_4_2_5_rtm, they didnt work for osx, giving many compiling errors.
Style System Overview - Archive of obsolete content
the data format of the structs and selectors is mostly clear from the code and not worth going into (although the implementation of :not() is confusing).
GRE Registration - Archive of obsolete content
when installing a gre via the command line <tt>xulrunner.exe -register-global</tt>, xulrunner will detect that there is already an installation at hklm/software/mozilla.org/gre/<version> and will try alternate keys <version>_1 _2 until an available key is found.
Helper Apps (and a bit of Save As) - Archive of obsolete content
nsexternalapphandler::onstartrequest creates a temporary file with a salted name to hold the data.
Introducing the Audio API extension - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Java in Firefox Extensions - Archive of obsolete content
liveconnect gives your extension's javascript code (linked from or contained in xul code) access to 2 objects: java and packages (note that per this thread, although the new documentation for the liveconnect reimplementation states that these globals will be deprecated (in the context of applets), "firefox and the java plug-in will continue to support the global java/packages keywords, in particular in the context of firefox extensions.").
Simple Storage - Archive of obsolete content
the object can also be forced to reload its data from disk by calling jetpack.storage.simple.open(), although the data comes loaded automatically.
Simple Storage - Archive of obsolete content
the object can also be forced to reload its data from disk by calling jetpack.storage.simple.open(), although the data comes loaded automatically.
jspage - Archive of obsolete content
h(/over|out/)){switch(j){case"mouseover":l=a.relatedtarget||a.fromelement; break;case"mouseout":l=a.relatedtarget||a.toelement;}if(!(function(){while(l&&l.nodetype==3){l=l.parentnode;}return true;}).create({attempt:browser.engine.gecko})()){l=false; }}}}return $extend(this,{event:a,type:j,page:i,client:c,rightclick:e,wheel:h,relatedtarget:l,target:g,code:b,key:m,shift:a.shiftkey,control:a.ctrlkey,alt:a.altkey,meta:a.metakey}); }});event.keys=new hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});event.implement({stop:function(){return this.stoppropagation().preventdefault(); },stoppropagation:function(){if(this.event.stoppropagation){this.event.stoppropagation();}else{this.event.cancelbubble=true;}return this;},preventdefault:function(){if(this.event...
Mac OS X Build Prerequisites/fink - Archive of obsolete content
fink is a package management system for mac os x, alternative to macports.
Mozilla Application Framework in Detail - Archive of obsolete content
in addition, if the organization maintains sophisticated, interactive websites, it will already possess a wealth of technical expertise that will be relevant for creating xul applications.
Mozilla Crypto FAQ - Archive of obsolete content
the mozilla ssl, s/mime, and pki source code is licensed under the mozilla public license (version 1.1), with the gnu general public license (version 2.0 or later) available as an alternate license.
How to Write and Land Nanojit Patches - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Configuration - Archive of obsolete content
status turns the status messages on or off for this web app: yes or no location turns the readonly location bar on or off for this web app: yes or no navigation turns the hotkey history navigation (alt+left, alt+right and alt+home) on or off for this web app: yes or no splashscreen filename of an html page to be displayed while the app is loading.
Prism - Archive of obsolete content
there are now no alternatives.
Remote XUL - Archive of obsolete content
oreillynet article, part 1 oreillynet article, part 2 restrictions see remote xul bugs for needless restrictions, features which don't work in remote xul (but in chrome xul) although they really should.
Space Manager Detailed Design - Archive of obsolete content
space manager instances come and go pretty frequently, and this recycler prevents excessive heap allocations and the performance penalties associated with it.
File object - Archive of obsolete content
if you are building a standalone version of spidermonkey (see: spidermonkey build documentation), this variable can be added on the make command line, like so: cd mozilla/js/src make -f makefile.ref js_has_file_object=1 alternatively, if you are building a larger product (such as a browser) and want to include the file object, you may need to perform minor makefile surgery.
Stress testing - Archive of obsolete content
although for win2003, it should install into winxp fine (win2000 compatibility is unknown).
Abc Assembler Tests - Archive of obsolete content
* * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesser general public license version 2.1 or later (the "lgpl"), * in which case the provisions of the gpl or the lgpl are applicable instead * of those above.
Tamarin Acceptance Test Template - Archive of obsolete content
* * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesser general public license version 2.1 or later (the "lgpl"), * in which case the provisions of the gpl or the lgpl are applicable instead * of those above.
Tamarin build documentation - Archive of obsolete content
alternatively, run make, in which case the process will complete with errors when it tries to create the shared lib crt0.o: $ /android-public/android-ndk/toolchains/arm-eabi-4.4.0/prebuilt/darwin-x86/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: crt0.o: no such file: no such file or directory collect2: ld returned 1 exit status make[2]: *** [link_app.] error 1 make[1]: *** [openssl] err...
Tamarin Build System Documentation - Archive of obsolete content
expectedfail or skip expectedfail means the test is run and the assertion is the test fails, if the test passes and is marked expectedfail the test result is unexpectedpass and treated like a failure skip means the test is not run, the test may fail intermittently or harm the system altering the results of other tests ...
URIs and URLs - Archive of obsolete content
although many url schemes are named after protocols, this does not imply that the only way to access the url's resource is via the named protocol.
Event Handlers - Archive of obsolete content
the other possible values are target, which means the handler will only fire if event.originaltarget is the same as the target to which the handler is attached, and capturing, which indicates the handler should fire during the capturing phase of event flow.
Example Sticky Notes - Archive of obsolete content
fax - respond today.</p></div> <div class="sticker"><p>don't forget the eggs!</p></div> <div class="sticker"><p>the new project - who's on charge?</p></div> <div class="sticker"><p>learn more about xbl.</p></div> <p style="clear: left"><a href="http://validator.w3.org/check?uri=referer"><img src="https://udn.realityripple.com/samples/e2/dd625ef1cd.png" width="88" height="31" alt="valid html 4.01" style="border: 1px none"></a></p> </body> </html> notes.xml <?xml version="1.0"?> <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- in above only xbl namespace declaration is mandatory.
Mac stub installer - Archive of obsolete content
alternative to steps 3 and 4 copy the "installer modules" folder from the "mozilla installer" folder into the "macbuild" folder that contains the build debug or non-debug installer binary next to miw.mcp.
Using XPInstall to Install Plugins - Archive of obsolete content
xpi packages make use of different apis from within install.js, although the concept is the same.
Methods - Archive of obsolete content
gestalt retrieves information about the operating environment.
Return Codes - Archive of obsolete content
y value does not exist invalid_signature -260 the signature used in the xpi is not valid invalid_hash -261 the hash used in the xpi is not valid invalid_hash_type -262 the has used in the xpi is not of a valid type out_of_memory -299 insufficient memory for operation gestalt_unknown_error -5550 gestalt_invalid_argument -5551 ...
XPInstall API reference - Archive of obsolete content
objects install properties methods adddirectory addfile alert cancelinstall confirm deleteregisteredfile execute gestalt getcomponentfolder getfolder getlasterror getwinprofile getwinregistry initinstall loadresources logcomment patch performinstall refreshplugins registerchrome reseterror setpackagefolder installtrigger no properties methods compareversion enab...
A XUL Bestiary - Archive of obsolete content
even prior to the skinning that takes place with the global skin, which is loaded in almost every xul file you see in mozilla (and whose absence from your own xul files can make your work look strange, senseless, or invisible altogether), a xul.css file is loaded which provides some very basic presentational information for the widgets in the toolkit.
norestorefocus - Archive of obsolete content
if true, the focus will not be reset, although it will be cleared if the focus is within the panel.
accesskey - Archive of obsolete content
*(these are the keys corresponding to event.ctrlkey and event.metakey respectively when listening to key events) although the value is case insensitive, a letter with the case matching the accesskey attribute will be used if both cases exist in the label.
contextmenu - Archive of obsolete content
« xul reference home contextmenu type: id alternate name for the context attribute, but also has a corresponding script property contextmenu.
cycler - Archive of obsolete content
in the case, clicking on a cell in the column will alternate its state between on and off.
datasources - Archive of obsolete content
the datasources attribute may be placed on most elements, although it will usually be found on trees and menu related elements.
menu - Archive of obsolete content
ArchiveMozillaXULAttributemenu
« xul reference home menu type: id alternate name for the popup attribute, but also has a corresponding script property 'menu'.
primary - Archive of obsolete content
if no column has the primary attribute set to true, the tree may still contain nested rows, although no indication will be given to the user.
searchSessions - Archive of obsolete content
the following values are possible, although custom components may be installed which add others.
Attribute (XUL) - Archive of obsolete content
« xul reference home acceltext accessible accesskey activetitlebarcolor afterselected align allowevents allownegativeassertions alternatingbackground alwaysopenpopup attribute autocheck autocompleteenabled autocompletepopup autocompletesearch autocompletesearchparam autofill autofillaftermatch autoscroll beforeselected buttonaccesskeyaccept buttonaccesskeycancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed c...
Building accessible custom components in XUL - Archive of obsolete content
the final product looks like this: <caption>xul spreadsheet with 7 rows and 5 columns</caption> although this has the visual layout of a spreadsheet, assistive technologies will only see it as a collection of individual, unrelated text labels.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
altkey read only boolean true if the alt key was down when the event was fired.
Accessing Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Working With Directories - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Getting File Information - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Uploading and Downloading Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Writing to Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
IO - Archive of obsolete content
ArchiveMozillaXULFileGuideIO
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
Moving, Copying and Deleting Files - Archive of obsolete content
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
TOC - Archive of obsolete content
ArchiveMozillaXULFileGuideTOC
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
International characters in XUL JavaScript - Archive of obsolete content
however, you can use unicode escapes – the earlier example rewritten using them would be: var text = "ein sch\u00f6nes beispiel eines mehrsprachigen textes: \u65e5\u672c\u8a9e"; an alternative might be to use property files via nsistringbundle or the xul <stringbundle> element; this would allow for localization of the xul.
getFormattedString - Archive of obsolete content
alternatively, numbered indices of the format %n$s (e.g.
Panels - Archive of obsolete content
although no element within the popup panel is focused by default, the user may focus the first element within the panel by pressing the tab key.
Actions - Archive of obsolete content
although the uri attribute should only be on one element, it does not have to be the outermost element in the action body.
Attribute Substitution - Archive of obsolete content
although not common, you may also wish to insert a question mark or caret into an attribute value.
Building Menus With Templates - Archive of obsolete content
this will involve at least two rules, although you might use other rules if you had other differences to handle.
Building Trees - Archive of obsolete content
alternatively, you could also use static values (in addition to variables) in the properties attribute.
Multiple Queries - Archive of obsolete content
you can also mix simple and extended queries in one template, although you may prefer to use the same style in all queries for consistency.
Multiple Rules - Archive of obsolete content
for example, although there is no 'greater or equal' operator, you can acheive this effect with a negated 'less' operator.
RDF Modifications - Archive of obsolete content
you don't need to implement this observer yourself, although you may add an observer to the datasource if you want to be notified when the data changes.
Simple Example - Archive of obsolete content
the resource uris correspond to their actual urls although this isn't necessary.
Sorting Results - Archive of obsolete content
for an rdf datasource, again, the results are in the order the query generates them, although except in the case of an rdf seq, this order is arbitrary as rdf triples don't occur in any particular order.
Static Content - Archive of obsolete content
the static content may be placed before or after the template, although usually you would place it first.
Using Multiple Queries to Generate More Results - Archive of obsolete content
a header class is used to distinguish the content, although you could use exactly the same content if you wish.
XML Templates - Archive of obsolete content
the child of the action element has to have a uri attribute, although it does not have to be a direct child.
Template Guide - Archive of obsolete content
nus with templates special condition tests multiple queries using multiple queries to generate more results building trees with templates building trees building hierarchical trees template modifications template builder interface template and tree listeners rdf modifications additional topics sorting results additional template attributes template logging xml namespaces alternative approaches javascript templates xuljsdatasource: a component for extensions, which bring a "javascript template syntax".
Textbox (XPFE autocomplete) - Archive of obsolete content
the following values are possible, although custom components may be installed which add others.
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
although the article covers creating an entire toolbar, rather than just a button, it has a great explanation of the techniques we'll use here.
Complete - Archive of obsolete content
for example, if your locale is fr-fr, it gets the description from: locale/fr-fr/allcustom/install.properties testing a locale to test the alternative locale, install the extension in the normal way.
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
alternate "quick and dirty" method for hooking up a single preexisting xul file to display in seamonkey: as described above, find the seamonkey\chrome folder.
Custom toolbar button - Archive of obsolete content
alternatively, use the application's extensions window to uninstall the extension in the normal way.
Adding Buttons - Archive of obsolete content
when the user presses alt (or a similar key that varies on each platform) and the access key, the button will be focused from anywhere in the window.
Adding Event Handlers - Archive of obsolete content
although it does not matter what the script file is called, usually it would be the same as the xul file with a .js extension.
Adding HTML Elements - Archive of obsolete content
using html elements you can use any html tag although some such as head and body are not really useful.
Adding Labels and Images - Archive of obsolete content
the example below shows this: <image src="images/banner.jpg"/> although you can use this syntax, it would be better in order to support different themes to use a style sheet to set the image url.
Adding Properties to XBL-defined Elements - Archive of obsolete content
getter element and setter element you can use an alternate syntax for the onget and onset attributes that is useful if the scripts are longer.
Adding Style Sheets - Archive of obsolete content
although this works, it is not really the best thing to do.
Box Model Details - Archive of obsolete content
this example will work with a vertical box as well, although the second button will be underneath the first one, instead of beside it.
Box Objects - Archive of obsolete content
there are several subtypes of box object, although only a couple of them are generally used.
Commands - Archive of obsolete content
note that html also has a commands and controller system although you can't use it on unprivileged web pages, but you may use it from, for example, a browser extension.
Creating a Window - Archive of obsolete content
the name can be anything you want although it should be something relevant.
Custom Tree Views - Archive of obsolete content
in general, although the tree view has thirty or so functions that may be implemented, you only need to implement the ones that the tree will call.
Introduction - Archive of obsolete content
xul is fairly similar in firefox and to other browsers, although it has some specific differences such as support for customizable toolbars.
Introduction to XBL - Archive of obsolete content
binding example the box is generic enough that you can use it to create custom widgets (although you can use any element, even one you make up yourself).
List Controls - Archive of obsolete content
each cell may have arbitrary content within it, although usually only text is used.
Manipulating Lists - Archive of obsolete content
although listboxes may be manipulated using the standard dom functions as well, it is recommended that the specialized listbox functions be used instead when possible.
Modifying the Default Skin - Archive of obsolete content
(although the underlying code for mozilla calls them skins and the user interface calls them themes, they're both referring to the same thing).
More Event Handlers - Archive of obsolete content
example 3 : source view <button label="types" type="menu"> <menupopup onpopupshowing="event.preventdefault();"> <menuitem label="glass"/> <menuitem label="plastic"/> </menupopup> </button> alternatively, for attribute event listeners, you can just return false from the code.
More Menu Features - Archive of obsolete content
they don't have to be placed next to each other in the menu, although it doesn't make as much sense if they aren't.
More Tree Features - Archive of obsolete content
you can use the style class tree-splitter to hide the notch, although the column may still be resized.
Numeric Controls - Archive of obsolete content
the format of the attribute is exactly as above, that is dates are of the form yyyy/mm/dd and times are of the form hh:mm:ss (although the seconds and the accompanying colon may be omitted).
Popup Menus - Archive of obsolete content
the position attribute can be used with all three popup types, although you probably would not change the value for tooltips.
Property Files - Archive of obsolete content
although the word order is not the same in all the languages, by using getformattedstring() the specification of the order can be put out the property files.
Skinning XUL Files by Hand - Archive of obsolete content
to keep your xul looking consistent and to avoid breaking skins altogether (when your styles have some dependency on a part of the global skin that changes, such as an image), use the style rules in the global skin by importing it into your stylesheet with the following instruction: @import url("chrome://global/skin/"); refer to the document writing skinnable xul and css for guidelines on how to make your skins friendly to the global skin, to xul, and to mozil...
The Box Model - Archive of obsolete content
although a box is the fundamental part of xul element layout, it follows a few very simple rules.
Updating Commands - Archive of obsolete content
also, we could just call docommand without checking if the command was enabled or not, although we probably shouldn't do that.
Using Remote XUL - Archive of obsolete content
for apache, you can do this by adding the following line to your mime.types file: application/vnd.mozilla.xul+xml .xul alternately, add this line to your httpd.conf file or, if the apache server is configured to allow it, to the .htaccess file in the directory from which the xul file is served: addtype application/vnd.mozilla.xul+xml .xul then restart your web server.
Using the standard theme - Archive of obsolete content
note that you can also mix these two approaches, although it makes your code more readable when sticking to only one way.
Writing Skinnable XUL and CSS - Archive of obsolete content
this is not healthy.
autohide - Archive of obsolete content
« xul reference home autohide type: boolean when set to true, the toolbar will be invisible unless the alt key is pressed by the user.
grid - Archive of obsolete content
ArchiveMozillaXULgrid
elements placed within both the columns and rows will be displayed, although usually only elements will be placed inside one of these.
panel - Archive of obsolete content
ArchiveMozillaXULpanel
if true, the focus will not be reset, although it will be cleared if the focus is within the panel.
stringbundle - Archive of obsolete content
alternatively, numbered indices of the format %n$s (e.g.
toolbar - Archive of obsolete content
oolbar examples <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" accesskey="u" label="users"/> <toolbarbutton id="nav-groups" accesskey="p" label="groups"/> <toolbarbutton id="nav-events" accesskey="e" label="events" disabled="true"/> </toolbar> </toolbox> attributes autohide type: boolean when set to true, the toolbar will be invisible unless the alt key is pressed by the user.
toolbarbutton - Archive of obsolete content
relevant accessbility guidelines all toolbar functionality should be duplicated elsewhere in the application where possible, provide keyboard alternatives.
treechildren - Archive of obsolete content
attributes alternatingbackground attributes alternatingbackground obsolete since gecko 2.0 type: boolean if true, the background of the tree's rows will alternate between two colors.
Components - Archive of obsolete content
alternatively, you can delete compreg.dat and xpti.dat in the user profile directory - that of your xulrunner app, not that of firefox/mozilla.
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
in this case, you'll be a happy, healthier and more well-balanced if you don't try to understand the file at all.
Getting started with XULRunner - Archive of obsolete content
alternative: run xul apps with firefox with firefox 3 and later, you can tell the firefox executable to run a xul application from the command line.
XULRunner Hall of Fame - Archive of obsolete content
build instructions kirix strata a new specialty browser for accessing and manipulating data from the web telekast an open source teleprompter and script editor.
XULRunner tips - Archive of obsolete content
ome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/stylerules/popupoverlay.xul overlay chrome://inspector/content/commandoverlay.xul chrome://inspector/content/viewers/dom/commandoverlay.xul to launch dom inspector in your application, you need to open its main window, with a command like this: window.open("chrome://inspector/content/inspector.xul", "", "chrome"); alternatively, the dom inspector may also be added as an extension: (if you already have inspector installed for another application you can skip to the next step) follow the instructions above through "unzip the package." create a file in the extensions directory of your application with the same name as the dom inspector id (inspector@mozilla.org) containing one line of text -- the exact path...
Using SOAP in XULRunner 1.9 - Archive of obsolete content
several alternatives were considered: soapclient 2.4 - this library contains a few javascript mistakes but nevertheless seems (fairly) widely used, mature and tested.
Windows and menus in XULRunner - Archive of obsolete content
although i have not seen it mentioned yet, i am assuming that you can only have one <window> element per xul file.
calICalendarView - Archive of obsolete content
the view is free to show other dates as well, although this should be kept to a minimum.
nsIContentPolicy - Archive of obsolete content
this interface can be very useful if you are developing a content-aware plugin (blocking ads or altering the look of content, for example), or if you want to stop or allow user-browsed urls.
2006-10-06 - Archive of obsolete content
sun microsystems contributes to lightning to combine it with openoffice.org sun microsystems provide users with an alternative open source choice by combining openoffice.org respectively staroffice and thunderbird/lightning.
2006-11-03 - Archive of obsolete content
picking an alternate search engine for a particular search large discussion about how the search engine could be imporved.
2006-11-04 - Archive of obsolete content
an alternate search engine for a particular search large discussion about how the search engine could be imporved.
2006-10-06 - Archive of obsolete content
q & a q: walt experienced an unusual behaviour in his build and wanted to perform an experiment to figure out the problem, but he couldn't find the mozilla.org's config file.
Extentsions FAQ - Archive of obsolete content
they replace the old labels (although the labels are still recognised).
2006-10-27 - Archive of obsolete content
alternative german locale while the alternative locale is active, the auto update of firefox stops working.
2006-11-24 - Archive of obsolete content
yet more people disgruntled by ev proposal mozilla, opera and co only tout open standards as it suits them in addition eddy nigg posted an alternative proposal for the use of extended validation certificates ev certificates / another proposal meetings none during this week.
JS-Engine FAQ - Archive of obsolete content
an alternative would be to use built-in e4x.
2006-09-29 - Archive of obsolete content
although the w3 validation accepted the generated xhtml as valid, a bug identified within the html working group ignored the invalid elements.
NPP_URLNotify - Archive of obsolete content
other possible reason codes are npres_user_break, indicating that the request was halted due to a user action (for example, clicking the stop button), and npres_network_err, indicating that the request could not be completed, perhaps because the url could not be found.
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
although it has become common practice to use the rss <description> element and put non-plain text data in it.
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
although not necessary, people also often use other rss modules to get at (and read) the comments (since rss does not currently provide facilities for this either).
Version - Archive of obsolete content
note: in the list below, although rss 1.0 seems to be out of place, it is actually in the correct place chronologically.
Introduction to Public-Key Cryptography - Archive of obsolete content
instead it concatenates the password with a random per-user value (so called "salt") and stores the hash value of the result along with the salt.
Threats - Archive of obsolete content
for example, someone could alter an order for goods or change a person's resume.
Sunbird Theme Tutorial - Archive of obsolete content
now you have a theme, although it looks exactly the same as sunbird's classic theme.
Building a Theme - Archive of obsolete content
note: this parameter must be in the format of an email address, although it does not have to be a valid email address.
Using SSH to connect to CVS - Archive of obsolete content
if you're building on win9x/winme you'll need to find an alternative solution.
Browser Feature Detection - Archive of obsolete content
it is clear from these test results that netscape 7.0x and mozilla firefox have the greatest dom support although internet explorer, safari, and opera have sufficient dom css 1 and dom level 1 & 2 document property and method support to enable cross browser web development.
-ms-overflow-style - Archive of obsolete content
none scrollbars are never displayed, although the element can still be scrolled if the element's content overflows.
::-ms-thumb - Archive of obsolete content
the ::-ms-thumb css pseudo-element is a microsoft extension that represents the thumb that the user moves within the track of a slider control to alter its numerical value.
::-ms-ticks-after - Archive of obsolete content
to remove tick marks altogether, set the color property to transparent.
::-ms-ticks-before - Archive of obsolete content
to remove tick marks altogether, set the color property to transparent.
::-ms-track - Archive of obsolete content
to remove tick marks altogether, set the color property to transparent.
E4X for templating - Archive of obsolete content
although a big advantage of e4x is being able to separate presentation from business logic, and the above-mentioned technique may fly in the face of this, if formatted well, it can also allow inline shaping of xml somewhat akin to the w3c standard xquery language, allowing the scripting to mix in context with the surrounding declarative xml: var a = <a><b/><c/><d/></a>; var b = <bar>{function () { ...
Processing XML with E4X - Archive of obsolete content
one must instead either calculate the variable with a javascript expression (e.g., bar={'a'+var1+var2}), define a new variable before the element literal which includes the full interpolation and then include that variable or retrieve the attribute after the literal to alter it (see below).
Introduction - Archive of obsolete content
use of inline functions in content although the brackets are restricted to single statements for evaluation, one might provide an anonymous function to perform some extra processing inline: var a = 'foo'; var b = <bar>{function () {var c = a.touppercase(); var d = 5 * 5; return c + d;}()}</bar>; where the above produces: <bar>foo25</bar>.
Array comprehensions - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Date.prototype.toLocaleFormat() - Archive of obsolete content
intl.datetimeformat is an alternative to format dates in a standards-compliant way.
Object.prototype.__count__ - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Object.prototype.__noSuchMethod__ - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Object.prototype.__parent__ - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
String.prototype.quote() - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Archived JavaScript Reference - Archive of obsolete content
intl.datetimeformat is an alternative to format dates in a standards-compliant way.
LiveConnect Overview - Archive of obsolete content
(although this functionality (along with some others) had been broken in gecko 1.9 (see bug 391642) as the mozilla-specific liveconnect code had not been maintained inside mozilla, with java 6 update 11 and 12 building support for reliance on mozilla's implementation of the generic (and cross-browser) npapi plugin code, this has again been fixed.) for example, suppose you are using the java forname me...
JavaPackage - Archive of obsolete content
although the packages and classes contained in a javapackage are its properties, you cannot use a for...in statement to enumerate them as you can enumerate the properties of other objects.
Packages - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Old Proxy API - Archive of obsolete content
fixing a proxy does not alter its object identity (the object “generated” by the handler during fixing does not have its own object identity; it retains the object identity of the proxy, upholding the illusion that the proxy “becomes” the object).
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
jaxer – server-side ajax via the firefox browser engine on the server although server-side javascript is not a new concept, jaxer implements it in a unique fashion.
Reference - Archive of obsolete content
while also holding in account the previous example where it was avalable in both instances when prototyping object it should be : function->object->instance or (function=object)->instance and ofcourse function == object return false ;) and the following statements also tells me that function == object although math is only an instance of object...
forEach - Archive of obsolete content
feel free to alter the text as english is not my mother tongue and i'm more concerned with the code quality that the english grammar ;-s dotnetcarpenter 30 june 2012 <hr> the compatibility section goes to extraordinary lengths in providing a foreach implementation.
Window.importDialog() - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Troubleshooting XForms Forms - Archive of obsolete content
alternatively, for a long term fix you can enter an exception pattern in the anti-xss protection exceptions text area.
XForms Switch Module - Archive of obsolete content
toggle element the element (see the spec) selects one possible case from an exclusive list of alternatives in a switch.
XForms - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Mozilla's DOCTYPE sniffing - Archive of obsolete content
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Parsing microformats in JavaScript - Archive of obsolete content
this includes looking at thing such as abbr, img and alt, area and alt, and value excerpting.
Common causes of memory leaks in extensions - Extensions
consider the following example code that could be part of your browser.xul overlay: gbrowser.addeventlistener("domcontentloaded", function(evt) { var contentdoc = evt.originaltarget; var i = 0; // refresh the title once each second setinterval(function() { contentdoc.title = ++i; }, 1000); }, false); one would normally expect that the interval (or timer) would be destroyed as soon as the document unloads, in the same way that event listeners are automatically destroyed.
Game distribution - Game development
other alternative tools are: intel xdk — an exciting alternative, similar to cocoonio.
Building up a basic demo with Three.js - Game development
although we've set-up the renderer, we still need to render everything.
Mobile touch controls - Game development
dedicated plugins you could go even further and use dedicated plugins like virtual joystick — this is a paid, official phaser plugin, but you can find free and open source alternatives.
Unconventional controls - Game development
this approach won't give us the full flexibility of using a gamepad, or even leap motion, but it's definitely an interesting, unconventional alternative.
Implementing controls using the Gamepad API - Game development
the theme for the competition was "change", so they submitted a game where you have to feed the hungry fridge by tapping the healthy food (apples, carrots, lettuces) and avoid the "bad" food (beer, burgers, pizza.) a countdown changes the type of food the fridge wants to eat every few seconds, so you have to be careful and act quickly.
Move the ball - Game development
this works ok, although it appears that the ball is leaving a trail behind it: clearing the canvas before each frame the ball is leaving a trail because we're painting a new circle on every frame without removing the previous one.
Build the brick field - Game development
building the brick field is a little bit more complicated than adding a single object to the screen, although it's still easier with phaser than in pure javascript.
Visual typescript game engine - Game development
restart 'npm run dev' best way to fully healthy build.
Gecko FAQ - Gecko Redirect 1
ards fully except for the areas noted below and open bugs documented in bugzilla: html 4.0 - full support except for: elements: bdo, basefont attributes: shape attribute on the a element, abbr, axis, headers, scope-row, scope-col, scope-rowgroup, scope-colgroup, charoff, datasrc, datafld, dataformat, datapagesize, summary, event, dir, align on table columns, label attribute of option, alternate text of area elements, longdesc various metadata attributes: cite, datetime, lang, hreflang bidirectional text layout, which is only used in hebrew and arabic (ibm has begun work to add bidi support in a future release) style sheets css 1 - full support, except for: the application of styles to html column elements the ability to turn off author styles ...
Digest - MDN Web Docs Glossary: Definitions of Web-related terms
a digest can be used to perform several tasks: in non-cryptographic applications (e.g., the index of hash tables, or a fingerprint used to detect duplicate data or to uniquely identify files) verify message integrity (a tampered message will have a different hash) store passwords so that they can't be retrieved, but can still be checked (to do this securely, you also need to salt the password.) generate pseudo-random numbers generate keys it is critical to choose the proper hash function for your use case to avoid collisions and predictability.
Graceful degradation - MDN Web Docs Glossary: Definitions of Web-related terms
polyfills can be used to build in missing features with javascript, but acceptable alternatives to features like styling and layout should be provided where possible, for example by using the css cascade, or html fallback behaviour.
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
an http header is a field of an http request or response that passes additional information, altering or precising the semantics of the message or of the body.
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
although "java" and "javascript" are trademarks (or registered trademarks) of oracle in the u.s.
LGPL - MDN Web Docs Glossary: Definitions of Web-related terms
the lgpl provides a more permissive alternative for the strictly copyleft gpl.
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
although browser page prediction and prediction services enable faster page loads, they consume additional bandwidth.
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
although this reason for polyfilling is very rare today, it was especially prevalent back in the days of ie6, netscape, and nnav where each browser implemented javascript very differently.
Progressive Enhancement - MDN Web Docs Glossary: Definitions of Web-related terms
acceptable alternatives should be provided where possible.
REST - MDN Web Docs Glossary: Definitions of Web-related terms
because http, the standard protocol hehind the "world wide web", "web" also transfers documents and hypertext links, simple http apis are sometimes colloguially referred to as restful apis, restful services, or simply rest services, although they don't necessarily adhere to all rest constraints.
RGB - MDN Web Docs Glossary: Definitions of Web-related terms
in opengl, webgl, and glsl the red-green-blue components are fractions (floating-point numbers between 0.0 and 1.0), although in the actual color buffer they are typically stored as 8-bit integers.
SVN - MDN Web Docs Glossary: Definitions of Web-related terms
although svn can also handle binary files, we do not recommend that you use it for such files.
Semantics - MDN Web Docs Glossary: Definitions of Web-related terms
semantics in html in html, for example, the <h1> element is a semantic element, which gives the text it wraps around the role (or meaning) of "a top level heading on your page." <h1>this is a top level heading</h1> by default, most browser's user agent stylesheet will style an <h1> with a large font size to make it look like a heading (although you could style it to look like anything you wanted).
Sloppy mode - MDN Web Docs Glossary: Definitions of Web-related terms
ecmascript 5 and later let scripts opt in to a new strict mode, which alters the semantics of javascript in several ways to improve its resiliency and which make it easier to understand what's going on when there are problems.
Syntax - MDN Web Docs Glossary: Definitions of Web-related terms
although languages can share few similarities in terms of their syntaxes for example "operand operator operand" rule in javascript and python.
Time to interactive - MDN Web Docs Glossary: Definitions of Web-related terms
although available in some performance monitoring tools, tti is not a part of any official web specification at the time of writing.
World Wide Web - MDN Web Docs Glossary: Definitions of Web-related terms
in 1991, he announced his creation on the alt.hypertext newsgroup, marking the moment the web was first made public.
lossy compression - MDN Web Docs Glossary: Definitions of Web-related terms
although there is no obvious difference quality between the two images above, the size of the second image has been significantly reduced, using lossy compression.
WebM - MDN Web Docs Glossary: Definitions of Web-related terms
webm is royalty-free and is an open web video format natively supported in mozilla firefox.
Accessibility - Learn web development
accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives, so they can be understood by assistive technologies and their users.
A cool-looking box - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
Backgrounds and borders - Learn web development
the available values are: no-repeat — stop the background from repeating altogether.
Creating fancy letterheaded paper - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
Debugging CSS - Learn web development
understanding the box model in previous lessons we have discussed the box model, and the fact that we have an alternate box model that changes how the size of elements are calculated based on the size you give them, plus the padding and borders.
Overflowing content - Learn web development
you can also scroll on the x axis using overflow-x, although this is not a recommended way to accommodate long words!
Type, class, and ID selectors - Learn web development
it is selecting any element which is the first-child of any descendant element of <article>: article *:first-child { } although both do the same thing, the readability is significantly improved.
Grids - Learn web development
positioning with grid-template-areas an alternative way to place items on your grid is to use the grid-template-areas property and giving the various elements of your design a name.
Legacy layout methods - Learn web development
note: if you can't get this to work, it might be because your browser does not support the calc() function, although it is fairly well supported across browsers — as far back as ie9.
Beginner's guide to media queries - Learn web development
there are a number of other media features that you can test for, although some of the newer features introduced in level 4 and 5 of the media queries specification have limited browser support.
Normal Flow - Learn web development
and, as we began to discover, you can change how elements behave either by adjusting their position in that normal flow, or removing them from it altogether.
CSS layout - Learn web development
responsive design as more diverse screen sizes have appeared on web-enabled devices, the concept of responsive web design (rwd) has appeared: a set of practices that allows web pages to alter their layout and appearance to suit different screen widths, resolutions, etc.
How CSS works - Learn web development
coupled with the way that the cascade works, and the fact that browsers will use the last css they come across in a stylesheet when you have two rules with the same specificity you can also offer alternatives for browsers that don't support new css.
Using your new knowledge - Learn web development
alternatively use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
CSS first steps - Learn web development
css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
Styling lists - Learn web development
d chop the salad.</li> <li>fill pita with salad, hummus, and fried halloumi.</li> </ol> <h2>ingredient description list</h2> <p>paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference, paragraph for reference.</p> <dl> <dt>hummus</dt> <dd>a thick dip/sauce generally made from chick peas blended with tahini, lemon juice, salt, garlic, and other ingredients.</dd> <dt>pita</dt> <dd>a soft, slightly leavened flatbread.</dd> <dt>halloumi</dt> <dd>a semi-hard, unripened, brined cheese with a higher-than-usual melting point, usually made from goat/sheep milk.</dd> <dt>green salad</dt> <dd>that green healthy stuff that many of us just use to garnish kebabs.</dd> </dl> if you go to the live example now and invest...
Typesetting a community school homepage - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
What do common web layouts contain? - Learn web development
stuff on the side 1) information complementing the main content; 2) information shared among a subset of pages; 3) alternative navigation system.
What HTML features promote accessibility? - Learn web development
<a href="inept.html" title="why i'm rubbish at writing link text: an explanation and an apology.">click here</a> to find out more.</p> access keys access keys provide easier navigation by assigning a keyboard shortcut to a link, which will usually gain focus when the user presses alt or ctrl + the access key.
How do I use GitHub Pages? - Learn web development
linux: usually you can pull up a terminal with ctrl + alt + t.
What is a URL? - Learn web development
alternatively, it is possible to directly use an ip address, but because it is less convenient, it is not often used on the web.
What is accessibility? - Learn web development
the basics of web accessibility a few necessities for basic web accessibility include: whenever your site needs an image to convey meaning, include text as an alternative for visually-challenged users or those with slow connections.
What software do I need to build a website? - Learn web development
alternatively, you can set up your own virtual machine, but that takes some expertise.
Other form controls - Learn web development
(with fallback)</label> <input type="text" id="myfruit" name="fruit" list="fruitlist"> <datalist id="fruitlist"> <label for="suggestion">or pick a fruit</label> <select id="suggestion" name="altfruit"> <option>apple</option> <option>banana</option> <option>blackberry</option> <option>blueberry</option> <option>lemon</option> <option>lychee</option> <option>peach</option> <option>pear</option> </select> </datalist> browsers that support the <datalist> element will ignore all the elements that are not <option> elements, with the datalist working as exp...
Your first form - Learn web development
the controls can be single or multi-line text fields, dropdown boxes, buttons, checkboxes, or radio buttons, and are mostly created using the <input> element, although there are some other elements to learn about too.
Dealing with files - Learn web development
<!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <img src="" alt="my test image"> </body> </html> the line <img src="" alt="my test image"> is the html code that inserts an image into the page.
Installing basic software - Learn web development
windows: firefox, chrome, opera, internet explorer, microsoft edge, brave (windows 10 comes with edge by default; if you have windows 7 or above, you can install internet explorer 11; otherwise, you should install an alternative browser).
What will your website look like? - Learn web development
alternatively, copy the image's web address from your browser's address bar for later use.
HTML Cheatsheet - Learn web development
embedded audio with alternative sources <audio controls="controls"><source src="https://udn.realityripple.com/samples/b7/193cb038d0.mp3" type="audio/mpeg"><source src="https://udn.realityripple.com/samples/f7/14a4179ee6.ogg" type="audio/ogg"> your browser does not support audio.
Creating hyperlinks - Learn web development
<a href="https://www.mozilla.org/"> <img src="mozilla-image.png" alt="mozilla logo that links to the mozilla homepage"> </a> note: you'll find out more about using images on the web in a future article.
Debugging HTML - Learn web development
the incorrect nesting has been fixed by the browser as shown here: <strong>strong <em>strong emphasised?</em> </strong> <em> what is this?</em> the link with the missing double quote has been deleted altogether.
Getting started with HTML - Learn web development
(for example, changing fonts or colors, or altering the page layout) html and css work well together, as you will soon discover.
Structuring a page of content - Learn web development
create the example on your local computer, or alternatively use an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
What’s in the head? Metadata in HTML - Learn web development
it will look something like this (although it may change over time): <meta name="description" content="the mdn web docs site provides information about open web technologies including html, css, and apis for both web sites and progressive web apps."> now search for "mdn web docs" in your favorite search engine (we used google.) you'll notice the description <meta> and <title> element content used in the search result — d...
Test your skills: HTML images - Learn web development
add some alternative text to an appropriate attribute to describe the image, for people that cannot see it.
Video and audio content - Learn web development
a webm file containing a movie which has a main video track and one alternate angle track, plus audio for both english and spanish, in addition to audio for an english commentary track can be conceptualized as shown in the diagram below.
HTML table advanced features and accessibility - Learn web development
the id and headers attributes an alternative to using the scope attribute is to use id and headers attributes to create associations between headers and cells.
Assessment: Structuring planet data - Learn web development
note: alternatively, you could use a site like jsbin or glitch to do your assessment.
Structuring the web with HTML - Learn web development
after learning html, you can then move on to learning about more advanced topics such as: css, and how to use it to style html (for example alter your text size and fonts used, add borders and drop shadows, layout your page with multiple columns, add animations and other visual effects.) javascript, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) ...
Making asynchronous programming easier with async and await - Learn web development
here is a trivial example: async function hello() { return greeting = await promise.resolve("hello"); }; hello().then(alert); of course, the above example is not very useful, although it does serve to illustrate the syntax.
Choosing the right approach - Learn web development
browser compatibility really good general support, although the exact support for callbacks in apis depends on the particular api.
General asynchronous programming concepts - Learn web development
the second problem is that although code run in a worker is not blocking, it is still basically synchronous.
Introducing asynchronous JavaScript - Learn web development
note however that synchronous try...catch won't work with promises, although it will work with async/await, as you'll learn later on.
Graceful asynchronous programming with Promises - Learn web development
the asynchronous nature is basically faked using settimeout(), although it does still show that promises are useful for creating a custom function with a sensible flow of operations, good error handling, etc.
Introduction to events - Learn web development
note: event handlers are sometimes called event listeners — they are pretty much interchangeable for our purposes, although strictly speaking, they work together.
Functions — reusable blocks of code - Learn web development
the example above would throw an error referenceerror: myvalue is not defined, because although the myvalue variable is defined in the same scope as the function calls, it is not defined inside the function definitions — the actual code that is run when the functions are called.
Looping code - Learn web development
the javascript is mostly the same too, although the loop itself is a bit different: let num = input.value; for (let i = 1; i <= num; i++) { let sqroot = math.sqrt(i); if (math.floor(sqroot) !== sqroot) { continue; } para.textcontent += i + ' '; } here's the output: hidden code 4 <!doctype html> <html> <head> <meta charset="utf-8"> <title>integer squares generator</title> <style> </style> </head> <...
JavaScript building blocks - Learn web development
build your own function with most of the essential theory dealt with previously, this article provides a practical experience.
Fetching data from the server - Learn web development
fetch and promises, on the other hand, are a more recent addition to the web platform, although they're supported well across the browser landscape, with the exception of internet explorer.
Video and Audio APIs - Learn web development
the htmlmediaelement api makes a wealth of functionality available for creating simple video and audio players, and that's only the tip of the iceberg.
Client-side web APIs - Learn web development
in this article, we'll look at how to use the dom in detail, along with some other interesting apis that can alter your environment in interesting ways.
A first splash into JavaScript - Learn web development
all we have left to do now in this article is talk about a few other important code features that you've already seen, although you may have not realized it.
Arrays - Learn web development
array objects can be stored in variables and dealt with in much the same way as any other type of value, the difference being that we can access each value inside the list individually, and do super useful and efficient things with the list, like loop through it and do the same thing to every value.
Basic math in JavaScript — numbers and operators - Learn web development
if you want to override operator precedence, you can put parentheses round the parts that you want to be explicitly dealt with first.
Silly story generator - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
Handling text — strings in JavaScript - Learn web development
strings — the basics strings are dealt with similarly to numbers at first glance, but when you dig deeper you'll start to see some notable differences.
Useful string methods - Learn web development
this works very simply at a basic level, although there are some advanced things you can do with it that we won't go into yet.
Adding features to our bouncing balls demo - Learn web development
alternatively, you could use a site like jsbin or glitch to do your assessment.
JavaScript object basics - Learn web development
overview: objects next in this article, we'll look at fundamental javascript object syntax, and revisit some javascript features that we've already seen earlier in the course, reiterating the fact that many of the features you've already dealt with are objects.
Working with JSON - Learn web development
you should be careful to validate any data you are attempting to use (although computer-generated json is less likely to include errors, as long as the generator program is working correctly).
Object-oriented JavaScript for beginners - Learn web development
notice that it has all the features you'd expect in a function, although it doesn't return anything or explicitly create an object — it basically just defines properties and methods.
Introducing JavaScript objects - Learn web development
guides object basics in the first article looking at javascript objects, we'll look at fundamental javascript object syntax, and revisit some javascript features we've already looked at earlier on in the course, reiterating the fact that many of the features you've already dealt with are in fact objects.
The business case for web performance - Learn web development
net promotion score the net promoter score (nps) is a metric for assessing customer loyalty for a company’s brand, product, or service.
Introduction to the server side - Learn web development
the server is not limited to sending information from databases, and might alternatively return the result of software tools, or data from communications services.
Server-side web frameworks - Learn web development
although definitely not the only framework based on java it is easy to use to create stand-alone, production-grade spring-based applications that you can "just run".
Getting started with Ember - Learn web development
starting the development server you may start the app in development mode by typing the following command in your terminal, while inside the todomvc directory: ember server this should give you an output similar to the following: build successful (190ms) – serving on http://localhost:4200/ slowest nodes (totaltime >= 5%) | total (avg) -----------------------------------------+----------- broccolimergetrees (17) | 35ms (2 ms) package /assets/vendor.js (1) | 13ms concat: vendor styles/assets/vend...
Ember interactivity: Events, classes and state - Learn web development
replace it with the following: this.todos.add(text); if we try this out in the todo app in our browser (npm start, go to localhost:4200), it will look like nothing happens after hitting the enter key (although the fact that the app builds without any errors is a good sign).
Ember resources and troubleshooting - Learn web development
a common alternative is to any fully-featured front-end data client is the fetch api.
Ember app structure and componentization - Learn web development
testing is outside the scope of this tutorial, although generally testing should be implemented as you develop, rather than after, otherwise it tends to be forgotten about.
Starting our Svelte Todo list app - Learn web development
for example, if we add an <img> element to our todos.svelte component without its corresponding alt prop: <h1>svelte to-do list</h1> <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> the compiler will issue the following warning: (!) plugin svelte: a11y: <img> element should have an alt attribute src/components/todos.svelte 1: <h1>svelte to-do list</h1> 2: 3: <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> ...
Getting started with Svelte - Learn web development
cmder is another very good and complete alternative.
Working with Svelte stores - Learn web development
update stores.js like so: import { writable } from 'svelte/store' import { localstore } from './localstore.js' export const alert = writable('welcome to the to-do list app!') const initialtodos = [ { id: 1, name: 'visit mdn web docs', completed: true }, { id: 2, name: 'complete the svelte tutorial', completed: false }, ] export const todos = localstore('mdn-svelte-todo', initialtodos) using localstore('mdn-svelte-todo', initialtodos), we are configuring the store to save the data in web storage under the key mdn-svelte-todo.
Creating our first Vue component - Learn web development
however, it's important that props serve as one-way data binding — a component should never alter the value of its own props.
Getting started with Vue - Learn web development
open the app.vue file, and delete the <img> element from the template section: <img alt="vue logo" src="./assets/logo.png"> if your server is still running, you should see the logo removed from the rendered site almost instantly.
Vue resources - Learn web development
the biggest change is a new composition api that works as an alternative to the current property-based api.
Styling Vue components with CSS - Learn web development
however, if these styles alter things outside of this component, it could be challenging to track down the styles responsible, and fix the problem.
Understanding client-side JavaScript frameworks - Learn web development
introduction to client-side frameworks we begin our look at frameworks with a general overview of the area, looking at a brief history of javascript and frameworks, why frameworks exist and what they give us, how to start thinking about choosing a framework to learn, and what alternatives there are to client-side frameworks.
Introduction to automated testing - Learn web development
settings (cog icon) — allows you to alter general settings for the session.
Handling common HTML and CSS problems - Learn web development
it is really easy and convenient to use, although it does have some downsides (see the link above for details), and it is arguable that parsing every stylesheet in your site and add prefixes at run time can be a drain on the computer's processing power for a large site.
Strategies for carrying out testing - Learn web development
another alternative is to use no-code test automation tools such as endtest.
Setting up your own test automation environment - Learn web development
note: the resources menu option on the browserstack automation dashboard contains a wealth of useful information on using it to run automated tests.
Git and GitHub - Learn web development
there are other alternatives such as gitlab that you could try, and you could also try setting your own git server up and using it instead of github.
Information for Assistive Technology Vendors
please read this page if you're interested in an alternative accessible browser.
Links and Resources
just like webxact, it can also perform a "complete webpage quality check" for accessibility, privacy, searchability, metadata and even alt text attribute quality.
Adding a new event
although, a lot of existing members don't have "m" prefix, but you shouldn't use the legacy local rules.
Android-specific test suites
while developing, lint warnings should appear within android studio, although this is not infallible.
A bird's-eye view of the Mozilla framework
if nsirdfnode doesn't support nsirdfliteral, it returns null and it's up to the client to choose an alternate course of action.
Chrome registration
this allows translators to plug in a different chrome package to translate an application without altering the rest of the source code.
Creating a spell check dictionary add-on
although the restartless format for dictionary add-ons were introduced in gecko 10, dictionary updates only works starting from gecko 18.
Creating reftest-based unit tests
or, alternatively, the conditions can be reversed (a != test rather than an == test).
Debugging JavaScript
components.utils.import("resource://gre/modules/log.jsm"); "debugger" keyword you can halt venkman or chromebug at a line using the keyword debugger.
Makefiles - Best practices and suggestions
any activity within a directory will alter inodes forcing targets to always be stale.
Old Thunderbird build
other build configuration options can be added to this file, although it's strongly recommended that you only use options that you fully understand.
Simple Instantbird build
if that's not exactly what you want, there are many build configuration options to choose from, although it's strongly recommended that you only use options that you fully understand.
Simple Thunderbird build
other build configuration options can be added to this file, although it's strongly recommended that you only use options that you fully understand.
pymake
alternately, if you would like to simply type in pymake -f client.mk from within the mingw32 shell.
The Firefox codebase: CSS Guidelines
is there an alternative to using the variable like inheriting or using the currentcolor keyword?
Gecko Logging
it is enabled for all builds, thread-safe, and the preferred alternative to nspr logging.
Reviewer Checklist
accessibility for html pages, images should have the alt attribute set when appropriate.
Displaying Places information using views
this method may be used as an alternative to setting the tree's place property as described above.
Index
this new policy is designed as an alternative to the current policies, which have been available in firefox for many years.
Limitations of chrome scripts
alternatively, you can use nsiwebprogresslistener in the content process.
Limitations of frame scripts
examples of apis add-on authors should avoid in frame scripts: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely to not work in the content process.
Limitations of frame scripts
for example: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) file: uris, see bug 1187099 <...> xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely not to work in the content process.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
when you tap the url bar, you can enter a url using the built-in firefox os keyboard (although note that we haven't implemented anything sophisticated in this app, like autofilling the http://, etc.).
HTMLIFrameElement.getStructuredData()
examples var browser = document.queryselector('iframe'); browser.addeventlistener('mozbrowserloadend',function() { var request = browser.getstructureddata(); request.onsuccess = function() { console.log(request.result); } }); running this code in a browser api app and then loading up a page that contains microdata (such as the website of british alt-country band salter cane) will result in a json object being returned, along the lines of: { "items": [ { "type":["http://microformats.org/profile/hcard"], "properties":{"fn":["chris askew"], "n":[ { "properties": { "given-name":["chris"], "family-name":["askew"], ...
mozbrowserloadend
although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to firefox os apps.
HTMLIFrameElement.sendMouseEvent()
modifiers a number representing a key pressed at the same time the mouse button was clicked: 1 : alt 2 : ctrl 4 : shift 8 : meta 16 : alt gr 32 : caps lock 64 : fn 128 : num lock 256 : scroll 512 : symbol lock 1024 : win note: you can specify multiple key modifiers separated by a pipe symbol, for example 1 | 1014.
HTMLIFrameElement.sendTouchEvent()
modifiers a number representing a key pressed at the same time the mouse button was clicked: 1 : alt 2 : ctrl 4 : shift 8 : meta 16 : alt gr 32 : caps lock 64 : fn 128 : num lock 256 : scroll 512 : symbol lock 1024 : win note: you can specify multiple key modifiers separated by a pipe symbol, for example 1 | 1014.
Embedding the editor
alternative solution: rather than having multiple editors in this scenario, we could have a single editor, which is capable of saving and restoring state such that it can be transferred between the various subdocuments being edited.
Script security
b gets no access to a, although a may choose to export objects to b.
Geckoview-Junit Tests
assumethat(sessionrule.env.isdebugbuild && sessionrule.env.cpuarch == "x86", equalto(false)) running tests on try to run these tests on try, use something like: mach try fuzzy -q geckoview-junit --artifact or mach try -b do -p android-x86_64 -u geckoview-junit --artifact currently, geckoview-junit is only run on android-x86_64.
How to implement a custom autocomplete search component
thunderbird 2.x and seamonkey 1.1.x support the toolkit interfaces, although they do not use the same autocomplete widget.
IPDL Tutorial
st nscstring& type, const nstarray<nscstring>& args, int* rv) = 0; /* deallocate the pplugininstanceparent after pplugininstancedestructor is done with it */ virtual bool deallocpplugininstance(pplugininstanceparent* actor) = 0; /* constructor message */ virtual callpplugininstanceconstructor(const nscstring& type, const nstarray<nscstring>& args, int* rv) { /* generated code */ } /* alternate form of constructor message: supply your own pplugininstanceparent* to bypass allocpplugininstance */ virtual bool callpplugininstanceconstructor(pplugininstanceparent* actor, const nscstring& type, const nstarray<nscstring>& args, int* rv) { /* generated code */ } /* destructor message */ virtual bool call__delete__(pplugininstanceparent* actor) { /* generated code */ } /* noti...
JavaScript-DOM Prototypes in Mozilla
alternatively, one can access and modify the prototype of an htmlimageelement through the prototype property of the constructor: htmlimageelement.prototype.foo = bar; modifying the prototype of a host object is not guaranteed by ecmascript specification.
AddonManager
this includes an add-on being moved to a new location, changing version, or having been detected as possibly altered.
CustomizableUI.jsm
area_bookmarks string "personaltoolbar", a constant reference to the id of the bookmarks toolbar.
Geometry.jsm
note: although this module is usable from mobile, and is present in firefox 4, it's currently not used in firefox 4 and attempting to use it may produce unreliable results there.
JavaScript OS.Constants
os.constants.libc is available on all platforms, although some constants are not defined everywhere.
Deferred
although the reason can be undefined, it is generally an error object, like in exception handling.
Promise
although the reason can be undefined, it is generally an error object, like in exception handling.
Promise.jsm
although the reason can be undefined, it is generally an error object, like in exception handling.
Deferred
although the reason can be undefined, it is generally an error object, like in exception handling.
PromiseWorker.jsm
also unlike sending/transferring from the main thread, when sending/transferring from worker there are no alternative syntaxes, it must be wrapped in a meta object.
Using workers in JavaScript code modules
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
WebRequest.jsm
"stylesheet" "script" "image" "object" "xmlhttprequest" http headers https headers are represented as objects with two properties, name and value: name type description name string header name, for example "content-type" value string header value, for example "image/png" chrome incompatibilities although this api is modeled on chrome's webrequest extension api, there are some differences.
Encodings for localization files
browser/installer/installer.inc utf-8 toolkit/installer/unix/install.it utf-8 native windows encodings the following table lists native windows encodings, and the win_installer_charset and charset= values for each: encoding name win_installer_charset (charset.mk) charset= (windows/install.it) ansi_charset cp1252 0 baltic_charset cp1257 186 chinesebig5_charset cp950 136 easteurope_charset cp1250 238 gb2312_charset cp936 134 greek_charset cp1253 161 hangul_charset cp949 129 russian_charset cp1251 204 shiftjis_charset cp932 128 turkish_charset cp1254 162 vietnamese_charset cp125...
Localization content best practices
one possible way to test a patch for localizability issues is to alter the en-us localization files, adding extraneous characters to the original strings: this can help to identify both hard-coded strings and "flexibility issues" in the ui.
Localizing extension descriptions
"?> <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <em:id>tabsidebar@blueprintit.co.uk</em:id> <em:localized> <description> <em:locale>de-de</em:locale> <em:name>tab sidebar</em:name> <em:description>zeigt in einer sidebar vorschaubilder der inhalte aller offenen tabs an.</em:description> </description> </em:localized> <em:localized> <description> <em:locale>es-es</em:locale> <em:name>tab sidebar</em:name> <em:description>muestra una vista previa de sus pestañas en su panel lateral.</em:description> </description> </em:localized> <em:localized> <description> <em:locale...
Localizing with Mercurial
if the utility modified your %path% successfully, a dialog will open saying, "%path% has been updated correctly." alternatively, you can edit the %path% variable manually.
Patching a Localization
alternatively, you can select specific files for diff to evaluate and print (see below).
Release phase
sign-offs do not need to be approved before revision merge between release channels, although it is recommended.
SVN for Localizers
a possible alternative is to install tortoisesvn (graphical interface and command line client).
Extras
="natural log">ln</mi> <mo>&applyfunction;</mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math> </p> css content math.cue *[title] { color: blue; } mixing with other markups html content <math display="block"> <mrow> <mi>a</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext> <img width="16" height="16" src="https://udn.realityripple.com/samples/3f/9341cbddc0.png" alt="mozilla-16" /> </mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input value="type" size="4"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math> <math display="block"> <msqrt> <mpadded width="30px" height="15px" depth="15px" voffset="-15px"> <mtext> <svg width="30px" height="30px"> <defs> <radialgradient id="radgrad1" cx="50%" cy="50%" r="50%" ...
Mozilla MathML Status
altimg, altimg-width, altimg-height, altimg-valign, alttext accepted, but do not have any effect on the rendering.
MathML Demo: <mo> - operator, fence, separator, or accent
emulating this behavior in mathml would require a context sensitive transaltion.
Using the viewport meta tag to control layout on mobile browsers
many other mobile browsers now support this tag, although it is not part of any web standard.
Mozilla DOM Hacking Guide
"interface flattening is the ability to call methods on an object regardless of the interface it was defined on." for example, when we have the document object in javascript, we can call indistinctly document.getelementbyid(), or document.addeventlistener(), although they are defined on two different interfaces (domdocument and domeventtarget.
Mozilla Quirks Mode Behavior
images (img elements) without alt attributes sometimes display placeholder icons in quirks mode.
mozilla::MonitorAutoEnter
methods wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on the underlying monitor until it is notifyed.
Build Metrics
static constructors are undesirable because their initialization imposes an unavoidable time penalty every time firefox is started.
BloatView
note that although this isn't necessarily the amount of memory consumed at any given time, it does give an indication of how much memory we're consuming.
GC and CC logs
alternatives there are two add-ons that can be used to create and analyze cc graphs.
Gecko Profiler FAQ
another approach to get more precision is also raising the sampling frequency to sub-millisecond ranges (it won’t work on windows.) high frequency sampling may also be an area where native profilers are a useful alternative tool to try.
Profiling with Concurrency Visualizer - Performance
concurrency visualizer is an excellent alternative to xperf.
Reporting a Performance Problem
your first reflex once you find what addon is slowing down the profile might be to disable it and search for alternatives.
tools/power/rapl
sudo $objdir/dist/bin/rapl alternatively, it can be run without root privileges by setting the contents of /proc/sys/kernel/perf_event_paranoid to 0.
A brief guide to Mozilla preferences
the administrator may alternatively put a user.js file in app_dir/defaults/profile/ ; this will put a copy of the user.js in all new profiles.
Preference reference
accessibility.tabfocusthe preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key.browser.altclicksavethe preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.browser.dom.window.dump.enabledthis setting enables the dump function, which sends messages to the system console.
Profile Manager
see http://kb.mozillazine.org/profile_manager#accessing_the_profile_manager for an alternative method of managing profiles.
A guide to searching crash reports
alternatively, you can browse the complete list.
L20n HTML Bindings
<script type="application/l20n"> <brandname "firefox"> <about "about {{ brandname }}"> </script> an alternative is to include localization resources in script elements.
L20n Javascript API
alternatively, you can register callbacks to execute when the context is ready (or when globals change and translations need to be updated) with ctx.localize.
AsyncTestUtils extended framework
we just cram them using addmessage, although we try and approximate what would happen with pop in terms of still invoking filters and such.
MailNews automated testing
although currently based on simple tests, these are useful for determining if new leaks have been introduced.
NSPR's Position On Abrupt Thread Termination
they are alternatives to large state machines with mostly non-blocking library functions.
Nonblocking IO In NSPR
(note: <tt>pr_poll()</tt> also works with blocking file descriptors, although it is less useful in the blocking io model.) when <tt>pr_poll()</tt> reports that a file descriptor is ready for some io operation, the central thread invokes that io function on the file descriptor.
Date and Time
two often-used callback functions of this type are provided by nspr: prtimeparamfn pr_localtimeparameters and pr_gmtparameters functions the functions that create and manipulate time and date values are: pr_now pr_explodetime pr_implodetime pr_normalizetime ...
Dynamic Library Linking
alternatively, you can enable the +s option as a postprocessing step using the chatr tool.
Introduction to NSPR
an alternate form of notification (pr_notifyallcondvar) promotes all threads waiting on a condition to the ready state.
PRJobIoDesc
syntax #include <prtpool.h> typedef struct prjobiodesc { prfiledesc *socket; prerrorcode error; printervaltime timeout; } prjobiodesc; ...
PRNetAddr
prnetaddr is binary-compatible with the socket address structures in the familiar berkeley socket interface, although this fact should not be relied upon.
PRTime
although utc and gmt are not exactly the same in their precise definitions, they can generally be treated as if they were.
PR_AcceptRead
syntax #include <prio.h> print32 pr_acceptread( prfiledesc *listensock, prfiledesc **acceptedsock, prnetaddr **peeraddr, void *buf, print32 amount, printervaltime timeout); parameters the function has the following parameters: listensock a pointer to a prfiledesc object representing a socket descriptor that has been called with the pr_listen function, also known as the rendezvous socket.
PR_GetErrorText
copies the current thread's current error text without altering the text as stored in the thread's context.
PR ImportTCPSocket
although pr_importtcpsocket is a supported function, it is declared in "private/pprio.h" to stress the fact that this function depends on the internals of the nspr implementation.
PR_Initialize
provides an alternate form of explicit initialization.
PR_MicrosecondsToInterval
syntax #include <prinrval.h> printervaltime pr_microsecondstointerval(pruint32 milli); parameter the function has the following parameter: micro the number of microseconds to convert to interval form.
PR_MillisecondsToInterval
syntax #include <prinrval.h> printervaltime pr_millisecondstointerval(pruint32 milli); parameter the function has the following parameter: milli the number of milliseconds to convert to interval form.
PR_NormalizeTime
returns nothing; the time parameter is altered by the callback function.
PR_Poll
syntax #include <prio.h> print32 pr_poll( prpolldesc *pds, printn npds, printervaltime timeout); parameters the function has the following parameters: pds a pointer to the first element of an array of prpolldesc structures.
PR_Realloc
the contents of the specified memory remains the same up to the smaller of its old size and new size, although the new memory block's address can be different from the original address.
PR_STATIC_ASSERT
an expression which cannot be evaluated at compile time will cause a compiler error; see pr_assert for a runtime alternative.
PR_SecondsToInterval
syntax #include <prinrval.h> printervaltime pr_secondstointerval(pruint32 seconds); parameter the function has the following parameter: seconds the number of seconds to convert to interval form.
PR_Sleep
syntax #include <prthread.h> prstatus pr_sleep(printervaltime ticks); parameter pr_sleep has the following parameter: ticks the number of ticks you want the thread to sleep for (see printervaltime).
PR_TransmitFile
syntax #include <prio.h> print32 pr_transmitfile( prfiledesc *networksocket, prfiledesc *sourcefile, const void *headers, print32 hlen, prtransmitfileflags flags, printervaltime timeout); parameters the function has the following parameters: networksocket a pointer to a prfiledesc object representing the connected socket to send data over.
PR_WaitCondVar
syntax #include <prcvar.h> prstatus pr_waitcondvar( prcondvar *cvar, printervaltime timeout); parameters pr_waitcondvar has the following parameters: cvar the condition variable on which to wait.
JSS Provider Notes
the class java.security.spec.pbekeyspec in jdk versions earlier than 1.4 does not contain the salt and iteration fields, which are necessary for pbe key generation.
Mozilla-JSS JCA Provider notes
the class java.security.spec.pbekeyspec in jdk versions earlier than 1.4 does not contain the salt and iteration fields, which are necessary for pbe key generation.
Using JSS
MozillaProjectsNSSJSSUsing JSS
for example, although jss 4.2 was tested with nss 3.11.
NSS 3.12.6 release notes
t numerous bug fixes bug 496993: add accessor functions for ssl_implementedciphers bug 515279: cert_pkixverifycert considers a certificate revoked if cert_processocspresponse fails for any reason bug 515870: gcc compiler warnings in nss 3.12.4 bug 518255: the input buffer for sgn_update should be declared const bug 519550: allow the specification of an alternate library for sqlite bug 524167: crash in [[@ find_objects_by_template - nsstoken_findcertificatebyissuerandserialnumber] bug 526910: maxresponselength (initialized to pkix_default_max_response_length) is too small for downloading some crls.
NSS_3.12_release_notes.html
commandline bug 161326: need api to convert dotted oid format to/from octet representation bug 376737: cert_importcerts routinely sets valid_peer or valid_ca override trust flags bug 390381: libpkix rejects cert chain when root ca cert has no basic constraints bug 391183: rename libpkix error string number type to pkix error number types bug 397122: nss 3.12 alpha treats a key3.db with no global salt as having no password bug 405966: unknown signature oid 1.3.14.3.2.29 causes sec_error_bad_signature, 3.11 ignores it bug 413010: cert_comparerdn may return a false match bug 417664: false positive crl revocation test on ppc/ppc64 nss_enable_pkix_verify=1 bug 404526: glibc detected free(): invalid pointer bug 300929: certificate policy extensions not supported bug 129303: nss needs to expose inte...
NSS 3.14.2 release notes
bug 816853 - when using libpkix for certificate validation, applications may now supply additional application-defined trust anchors to be used in addition to those from loaded security tokens, rather than as an alternative to.
NSS 3.14 release notes
the following functions have been added to the libssl library included in nss 3.14 ssl_versionrangeget (in ssl.h) ssl_versionrangegetdefault (in ssl.h) ssl_versionrangegetsupported (in ssl.h) ssl_versionrangeset (in ssl.h) ssl_versionrangesetdefault (in ssl.h) to better ensure interoperability with peers that support tls 1.1, nss has altered how it handles certain ssl protocol layer events.
NSS 3.15.1 release notes
notable changes in nss 3.15.1 bug 856060 - enforce name constraints on the common name in libpkix when no subjectaltname is present.
NSS 3.16.1 release notes
in secmod.h secmod_internaltopubmechflags - converts from nss-internal to public representation of mechanism flags.
NSS 3.16.2 release notes
the certutil commands supports additionals types of subject alt name extensions: --extsan type:name[,type:name]...
NSS 3.24 release notes
although these certificates can be configured, they will not be used by nss in this version.
NSS 3.27.1 release notes
nss 3.27 set this value on by default, allowing tls 1.3 (draft) to be disabled using nss_disable_tls_1_3, although the maximum version used by default remained tls 1.2.
NSS 3.27 release notes
although the maximum tls version enabled by default is still tls 1.2, there are applications that query the list of tls protocol versions supported by nss, and enable all supported versions.
NSS 3.28 release notes
for the future nss 3.29 release, it is planned that standard builds of nss will support the tls 1.3 protocol (although the maximum tls protocol version enabled by default will remain at tls 1.2).
NSS 3.35 release notes
the experimental api ssl_usealtserverhellotype has been disabled.
NSS 3.50 release notes
bug 1547639 - update zlib in nss to 1.2.11 bug 1609181 - detect arm (32-bit) cpu features on freebsd bug 1602386 - fix build on freebsd/powerpc* bug 1608151 - introduce nss_disable_altivec bug 1612623 - depend on nspr 4.25 bug 1609673 - fix a crash when nss is compiled without libnssdbm support, but the nssdbm shared object is available anyway.
NSS 3.52 release notes
alternatively, defining nss_pkcs11_2_0_compat will yield the old definition.
NSS API Guidelines
we have lots of code which takes an optional arena pointer, using the arena if there is one, or alternatively the heap if there isn't.
NSS Sample Code sample2
if you choose something else, then data padding is the * application's responsibility */ ciphermech = ckm_des_cbc_pad; slot = pk11_getbestslot(ciphermech, null); /* slot = pk11_getinternalkeyslot(); is a simpler alternative but in * theory, it *may not* return the optimal slot for the operation.
Notes on TLS - SSL 3.0 Intolerant Servers
it is designed to permit a server to detect a man-in-the-middle that is altering the ssl client hello (connection) requests as they pass from the client to the server, altering them by changing the protocol version number to a lower version number.
NSS Key Functions
never alter the contents of a certificate or key structure.
NSS environment variables
before 3.0 moz_debug_symbols boolean (1 to enable) needed on windows to build with versions of msvc (such as vc8 and vc9) that do not understand /pdb:none 3.11 moz_debug_flags string when moz_debug_symbols is set, you may use moz_debug_flags to specify alternative compiler flags to produce symbolic debugging information in a particular format.
NSS tools : ssltab
although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
NSS tools : ssltap
although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
troubleshoot.html
cd c:/programs/cygnus/bin (or wherever your gnu tools are installed) cp shmsdos.exe shmsdos.bak (backup shmsdos) cp sh.exe shmsdos.exe (substitute alternative shell) making this change will probably break other builds you are making on the same machine.
gtstd.html
although it is possible to use nss command line tools to operate a proper ca, these instructions do not provide nearly enough understanding of the many considerations required to competently operate a ca.
sslcrt.html
never alter the contents of a certificate or key structure.
sslkey.html
never alter the contents of a certificate or key structure.
TLS Cipher Suite Discovery
*/ ssl_import const pruint16 ssl_numimplementedciphers; of course, the raw integer numbers of the cipher suites are not likely to be known to most users, so libssl provides a function by which the application can obtain a wealth of information about any supported cipher suite, by its number.
NSS_3.12.3_release_notes.html
cbc_sha in sslt.h: ssl_calg_seed new structure for seed support: (see blapit.h) seedcontextstr seedcontext new functions in the nss shared library: cert_rfc1485_escapeandquote (see cert.h) cert_comparecerts (see cert.h) cert_registeralternateocspaiainfocallback (see ocsp.h) pk11_getsymkeyhandle (see pk11pqg.h) util_setforkstate (see secoid.h) nss_getalgorithmpolicy (see secoid.h) nss_setalgorithmpolicy (see secoid.h) for the 2 functions above see also (in secoidt.h): nss_use_alg_in_cert_signature nss_use_alg_in_cms_signature nss_use_alg_reserv...
NSS Tools ssltap
although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
although you can run the tool at its most basic by issuing the ssltap command with no options other than hostname:port, the information you get in this way is not very useful.
Necko Architecture
although the protocol handler creates channels, protocol interpretation doesn't begin until the user initiates the transaction using the nsichannel api.
Proxies in Necko
alternatively, if proxies are disabled, or this host is in the list of hosts for which no proxy should be used, null is also returned.
Small Footprint
rhino will continue to run, although it will not be able to execute any regular expression matches.
Creating JavaScript tests
jstests run in both the shell and the browser (although you can specify that the test should be run in only one of the two locations).
GCIntegration - SpiderMonkey Redirect 1
if a pointer is not traced via js_call_tracer or any similar mechanism, then there's no need for a write barrier (although see below about read barriers).
Tracing JIT
if it fails enough times to become hot, the monitor will record an alternative sub-trace beginning at the guard and patch the code into the existing guard.
Introduction to the JavaScript shell
environment options there are some environment variables that can be set to alter js shell behavior.
JSAPI Cookbook
an alternative would be to simulate the behavior of the javascript .
BOOLEAN_TO_JSVAL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
DOUBLE_TO_JSVAL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
INT_FITS_IN_JSVAL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
INT_TO_JSVAL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS::Add*Root
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS::Remove*Root
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSBool
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSCheckAccessOp
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSExtendedClass.outerObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSExtendedClass
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSExtendedClass.wrappedObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSFUN_BOUND_METHOD
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSFUN_GLOBAL_PARENT
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSFastNative
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSGetObjectOps
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSIteratorOp
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSMarkOp
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSNewResolveOp
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOp
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.defaultValue
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.defineProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.destroyObjectMap
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.dropProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.getAttributes
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.getProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.getRequiredSlot
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.lookupProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.newObjectMap
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectOps.setProto
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSObjectPrincipalsFinder
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSPRINCIPALS_HOLD
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSReserveSlotsOp
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_BOOLEAN
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_DOUBLE
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_INT
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_NUMBER
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_OBJECT
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_PRIMITIVE
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_STRING
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_IS_VOID
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_LOCK
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_NULL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_ONE
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_TO_BOOLEAN
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_TO_DOUBLE
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_TO_OBJECT
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_TO_STRING
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_TRUE
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_UNLOCK
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_VOID
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSVAL_ZERO
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JSXDRObjectOp
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_AddArgumentFormatter
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_AddExternalStringFinalizer
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CStringsAreUTF8
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CheckAccess
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ClearContextThread
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ClearNewbornRoots
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ClearNonGlobalObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ClearScope
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CloneFunctionObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CompileFunction
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CompileFunctionForPrincipals
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CompileScriptForPrincipals
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CompileUTF8File
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_CompileUTF8FileHandle
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ContextIterator
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ConvertArguments
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ConvertArgumentsVA
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ConvertValue
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_DefaultValue
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_DefineOwnProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_DefinePropertyWithTinyId
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_DeleteElement2
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_DeleteProperty2
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_DoubleToInt32
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_DumpNamedRoots
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_EncodeCharacters
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_EnterCrossCompartmentCall
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_EnterLocalRootScope
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_EnumerateResolvedStandardClasses
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_EvaluateScript
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_EvaluateScriptForPrincipals
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ExecuteScriptPart
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ExecuteScriptVersion
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_Finish
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_FlushCaches
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ForgetLocalRoot
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GET_CLASS
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetContextThread
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetExternalStringClosure
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetFlatStringChars
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetFunctionCallback
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetFunctionFlags
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetGlobalForScopeChain
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetGlobalObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetInternedStringChars
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetOptions
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetParent
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetPropertyAttributes
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetPropertyAttrsGetterAndSetter
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetPropertyDefault
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetScopeChain
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetStringBytes
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetStringChars
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetStringCharsAndLength
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_GetTypeName
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_HasArrayLength
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_IsAssigning
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_IsConstructing
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_IsConstructing_PossiblyWithGivenThisObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_LeaveCrossCompartmentCall
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_LeaveLocalRootScope
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_LeaveLocalRootScopeWithResult
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_Lock
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_LockGCThing
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_LookupElement
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_LookupProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_MakeStringImmutable
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_MapGCRoots
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_NewCompartmentAndGlobalObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_NewDouble
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_NewDoubleValue
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_NewObject
however, although javascript code can freely redefine constructors, the ecmascript standard requires us in certain cases to use the original constructors' prototypes.
JS_NewPropertyIterator
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_NewScriptObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_NextProperty
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_PopArguments
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_PushArguments
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_RemoveExternalStringFinalizer
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_Remove*Root
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SealObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetBranchCallback
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetCallReturnValue2
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetContextCallback
in a debug build, if the callback returns false, the js engine will halt with an assertion.
JS_SetErrorReporter
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetFunctionCallback
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetGCCallback
sometimes several gc cycles happen in a row, so jsgc_begin is followed by alternating jsgc_mark_end and jsgc_finalize_end callbacks, followed at last by jsgc_end.
JS_SetGlobalObject
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetOperationCallback
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetOptions
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetParent
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetPropertyAttributes
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetThreadStackLimit
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SetVersion
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_SuspendRequest
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_THREADSAFE
until recently, sharing objects among threads would mostly work, although scripts could easily make it crash.
JS_ToggleOptions
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_TracerInit
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_Unlock
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ValueToBoolean
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ValueToECMAInt32
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ValueToInt32
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ValueToNumber
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_ValueToString
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
JS_YieldRequest
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
OBJECT_TO_JSVAL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
PRIVATE_TO_JSVAL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
STRING_TO_JSVAL
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
jschar
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
jsint
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
SpiderMonkey 1.8.8
typedef changes many types have been removed from the jsapi and replaced with simpler alternatives.
SpiderMonkey 1.8
(if you would like to contribute and maintain a project file, please feel free to contact the spidermonkey team via email, bugzilla, or irc.) alternatively, you can install mozillabuild and run the command make -f makefile.ref in the js/src directory.
SpiderMonkey 17
typedef changes many types have been removed from the jsapi and replaced with simpler alternatives.
SpiderMonkey 24
it is recommended that you embed a separate xml parser, or include an xml parsing implementation written in javascript, as an alternative.
Shell global objects
if omitted, attach no source map url to the code (although the code may provide one itself, via a //#sourcemappingurl comment).
TPS Tests
one alternative is to put underscores before the "disabled" preferences, e.g.
WebReplayRoadmap
an alternate use of the types that appear in practice would be to provide seed information for automatically populating the types in an app that is being converted to use flow or typescript.
Redis Tips
i recommend reading this article on realtime metrics with bitstrings: https://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/.
Animated PNG graphics
MozillaTechAPNG
apng is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet.
Gecko events
is supported: yes targets: table_cell - the cell of <xul:tree/>, any accessible for html element when @title or @alt attribute is changed.
XForms Accessibility
currently we have verified that xforms accessibility is working on the windows platform, and linux testing has not yet been done, although everything should work and is ready to be tested.
Feed content access API
we could, alternatively, use its plaintext() method to get a copy of the title translated into plain text.
Mork
MozillaTechMork
meta-rows do not appear to be used at all, although the parser seems to consider setting the charset, row scope, and atom scope.
Places utilities for JavaScript
the showminimaladd methods open the dialog by its alternative uri.
FUEL
objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage fueliapplication objects fueliannotations fueliapplication fuelibookmark fuelibookmarkfolder fuelibookmarkroots fuelibrowsertab fueliwindow xpcom although the fuel application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
SMILE
objects extiapplication objects exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage smileiapplication objects smileibookmarkroots smileiwindow smileibrowsertab smileiapplication xpcom although the extiapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
STEEL
objects extiapplication objects extiapplication exticonsole extieventitem extieventlistener extievents extiextension extiextensions extipreference extipreferencebranch extisessionstorage steeliapplication objects steeliapplication xpcom although the steel steeliapplication object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
extIApplication
xpcom although the application object is preloaded into xul scripts, it is not preloaded into javascript xpcom code.
Aggregating the In-Memory Datasource
when it won't work although this magic is terribly convenient to use, it won't work in the case that you want to "override" some of the in-memory datasource's methods.
Avoiding leaks in JavaScript XPCOM components
take every information on this site with a grain of salt, although most concepts and best practices still apply.
Component Internals
there is a slight footprint penalty to linking directly, but this gives your component freedom to work in any recent environment.
Finishing the Component
they may be able to suggest a supported alternative, or they may be able to notify you about pending changes.
Using XPCOM Components
alternatively, you can try xpcomviewer, a similar add-on.
Using XPCOM Utilities to Make Things Easier
although we haven't formally introduced these two interfaces, the next code sample shows how simple it is to switch between these two interfaces: someclass::dosomething(nsifile* afile) { if (!afile) return ns_error_null_pointer; nsresult rv; nscomptr<nsilocalfile> localfile = do_queryinterface(afile, &rv); // ...
Creating XPCOM components
onent internals creating components in cpp xpcom initialization xpcom registry manifests registration methods in xpcom autoregistration the shutdown process three parts of a xpcom component library xpcom glue the glue library xpcom string classes creating the component code what we'll be working on component registration the regxpcom program registration alternatives overview of the weblock module source digging in: required includes and constants identifiers in xpcom coding for the registration process the registration methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros w...
Mozilla internal string guide
nsautostringn/nsautocstringn are more general alternatives that let you choose the number of characters in the inline buffer.
mozilla::services namespace
the services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.
XPCOM guide
MozillaTechXPCOMGuide
mozilla::services namespacethe services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.receiving startup notificationssometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example.xpcom...
Language bindings
this is useful particularly when testing for memory leaks, because normal garbage collection is conservative when javascript code is running to ensure that in-use memory isn't inadvertently collected.components.utils.setgczealthis method lets scripts set the zeal level for garbage collection.
NS_InitXPCOM2
the service manager may alternatively be accessed by calling ns_getservicemanager.
NS_InitXPCOM3
the service manager may alternatively be accessed by calling ns_getservicemanager.
IAccessibleAction
an at such as an on screen keyboard might not expose these bindings but provide alternative means of activation.
IAccessibleHyperlink
alternatively this method could return an iunknown variant of a com interface representing a target object to be activated when the link is activated.
IAccessibleText
setting the caret position may or may not alter the current selection().
imgICache
ng snippet to obtain a relevant image cache for a given document or channel (where relevantdocument is a document object that contains images you care about, or relevantchannel is an nsichannel that is used for fetching images): var tools = components.classes["@mozilla.org/image/tools;1"].getservice(components.interfaces.imgitools); var cache = tools.getimgcachefordocument(relevantdocument); // alternatively, tools.getimgcacheforchannel(relevantchannel) if there is no relevant document or channel, null may be passed, but this will cause any image cache requests to use the permanent storage cache (ie.
imgIEncoder
the alternative is to use startimageencode(), call addimageframe() one or more times, and then finish initialization with endimageencode().
jsdIStackFrame
attempting to alter this bit will result in an ns_error_illegal_value.
mozIAsyncFavicons
as an alternative, you can just use placesutils.favicons from javascript.
GroupPosition
remark alternatively this information is exposed by nsiaccessible.attribute attribute, also see group attributes page.
TakeFocus
it is the callers responsibility to determine whether this node is focusable.acctakefocus on a node that is not normally focusable (such as a table), will still set focus on that node, although normally that will not be visually indicated in most style sheets.
nsIAccessibleDocument
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIAccessibleText
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIAccessibleTreeCache
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsICacheService
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIContentPrefService
useful for accessing and manipulating preferences in ways that are caller-specific or for which there is not yet a generic method, although generic functionality useful to multiple callers should generally be added to this unfrozen interface.
nsICookieStorage
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIDBChangeListener
there are a couple of ways to access the message database: if you have a nsimsgfolder, you can do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdbview like so: gfolderdisplay.view.dbview.db.addlistener(mylistener); method overview void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbchangelistener ainstigator); void onhdrdeleted(in nsimsgdbhdr ahdrchanged, in nsmsgkey aparentkey, in long afla...
nsIDOMFileError
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIDOMGlobalPropertyInitializer
an alternative way to expose an object to the web content is to add the property in response to the content-document-global-created notification.
nsIDOMStorageEventObsolete
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIDebug
inherits from: nsisupports last changed in gecko 1.7 note: c/c++ consumers who are planning to use the nsidebug interface with the @mozilla.org/xpcom;1 contract should use ns_debugbreak() from xpcom glue instead, or alternatively the ns_abort, ns_assertion, ns_break, and ns_warning macros, which also call ns_debugbreak() if used in a debugging build.
getFile
available on all platforms these symbolic names are available on all platforms (although, of course, they may refer to different physical paths on the storage device).
nsIDocShell
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIDocumentLoader
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIDragService
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIEditor
void begintransaction(); void endtransaction(); void beginplaceholdertransaction(in nsiatom name); void endplaceholdertransaction(); boolean shouldtxnsetselection(); void setshouldtxnsetselection(in boolean should); inline spellchecking methods nsiinlinespellchecker getinlinespellchecker(in boolean autocreate); void syncrealtimespell(); void setspellcheckuseroverride(in boolean enable); clipboard methods void cut(); boolean cancut(); void copy(); boolean cancopy(); void paste(in long aselectiontype); boolean canpaste(in long aselectiontype); selection methods void selectall(); void beginningofdocument(); void en...
nsIEditorSpellCheck
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIEventTarget
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIFocusManager
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIFrameMessageManager
an alternative method to listen for death of frame script is to use message-manager-disconnect observer: observer notifications :: message manager.
nsIIOService
when in offline mode, attempts to access the network will fail (although this does not necessarily correlate with whether there is actually a network available -- that's hard to detect without causing the dialer to come up).
nsIMessageListenerManager
an alternative method to listen for death of frame script is to use a message-manager-disconnect observer; see observer notifications :: message manager.
nsIMessageWakeupService
alternatively, it is possible to register a wakeup entry programmatically via the nsicategorymanager interface.
nsIMsgCompFields
b28 priority char * receiptheadertype print32 references char * replyto astring securityinfo nsisupports subject astring templatename astring temporaryfiles char * obsolete temporaryfiles obsolete, do not use anymore to astring usemultipartalternative prbool uuencodeattachments prbool methods utility methods prbool checkcharsetconversion ( out char * fallbackcharset ); nsimsgrecipientarray splitrecipients ( in prunichar * recipients, in prbool emailaddressonly ); void convertbodytoplaintext ( ); attachment handling methods void addattachment ( in n...
nsIMsgDBHdr
headers are backed by the database: a call to these functions directly modifies the state of the database, although it is not saved until the database is committed.
nsIMutableArray
xpcom/ds/nsimutablearray.idlscriptable this interface is a subclass of nsiarray that provides arrays that are mutable; that is, they can be altered programmatically.
nsINavHistoryContainerResultNode
childrenreadonly boolean false if the node's list of children can be modified (by adding or removing children, or rearranging them), or true if the user interface should not allow the list of children to be altered.
nsINavHistoryResultObserver
although this attribute is read-write, you should not alter it directly; instead, call nsinavhistoryresult.addobserver() to add an observer to a result.
nsIPlacesImportExportService
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIPushSubscription
auth the shared authentication secret, used as the salt in the hkdf invocation.
nsIScriptableIO
there are alternative xpcom apis you can use, your help in updating this pages to use the supported api is very much welcome!
nsISelectionPrivate
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsISocketTransport
nsitransporteventsink status codes note: although these constants look like xpcom error codes and are passed in an nsresult variable, they are not error codes.
nsIStringBundle
alternatively, a string bundle can be created within a javascript context with nsistringbundleservice.
nsITaskbarPreviewController
note: although these attributes are read only, that indicates that the previews controlled by an nsitaskbarpreviewcontroller cannot alter these values.
nsIThreadPool
threadlimit unsigned long the maximum number of threads allowed at once in the pool; you may change this value by altering this attribute.
nsITransferable
isprivatedata boolean although this is not a read-only attribute, you should generally avoid changing it, since doing so may cause it not to actually reflect the status of the context in which the transferable was created.
nsIURIFixup
fixup_flags_make_alternate_uri 2 tell the fixup to make an alternate uri from the input uri, for example to turn foo into www.foo.com.
nsIXMLHttpRequest
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIXSLTProcessorObsolete
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIXULSortService
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
nsIXmlRpcFault
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
NS ENSURE TRUE
syntax ns_ensure_true( expr, return-value ); usage nsresult mozmyclass::mozstringmucking() { char *foo = new char[123]; ns_ensure_true(foo, ns_error_out_of_memory); // this is equivalent to doing: if (!foo) return ns_error_out_of_memory; // thou shalt not return ns_error_failure..
nsIAbCard/Thunderbird3
the non-variant functions are marked [noscript] since xpconnect uses magic with nsivariant such that the other functions are not needed, although c++ does need them.
Performance
the asynchronous writes discussed below removes most of the immediate penalty of a commit, so you will not notice the problem as much.
Storage
alternatively, if you do not expect any results but still need to execute a bound statement, you can simply call mozistoragestatement.execute().
Frequently Asked Questions
[see initialization and assignment for more details] you should note, though, that there is a small performance penalty for this.
Weak reference
} alternatives this technique is useful, but in situations where you need this, there are two alternatives which you may want to consider: you might hold an owning reference, but arrange to release it out-of-band; this must be before the destructor, which would otherwise never be called.
nsCOMPtr versus RefPtr
(although, confusingly, debug builds don't work this way).
XSLT 2.0
although xslt 2.0 is not natively supported in firefox, it is possible via saxon-b (java) or, more recently, saxon-ce (javascript) to perform xslt 2.0.
Xray vision
so this is not a straightforward privilege escalation attack, although it might lead to one if the chrome code is sufficiently confused.
The Valgrind Test Job
alternatively, bugs relating to the test job can be filed in the "testing" product, under the "general" component.
Creating a gloda message query
the max number of messages which are returned is governed by a preference: "mailnews.database.global.search.msg.limit" although you can deal with the messages as they show up via the listener, the list of messages in the collection is available in collection.items.
Gloda examples
ion) { }, /* called when our database query completes */ onquerycompleted: function _onquerycompleted(conversation_coll) { try { for (var conv in conversation_coll) { //do something with the conversation here alert(conv.subject); } } catch (e) {} } } glodamessage.conversation.getmessagescollection(alistener) alternatively if you need to get a conversation based on the subject, you need to do a query (using the same listener as above).
MailNews fakeserver
alternatively, one can wait for the timeout, which occurs after 3 minutes, so not closing connections would make the tests take unbearably long.
Mail composition back end
ns_imethod onstopsending( nsresult astatus, - the resulting status for the send operation const prunichar *amsg, - a status message pruint32 atotaltried, - the total messages that were attempted pruint32 asuccessful) = 0; - the number of successful messages quoting quoting a mail message is made possible via the nsimsgquote interface.
Mail event system
nsimsgmailsession also contains a number of other methods that are completely unrealted to folder notification.
Mailnews and Mail code review requirements
the patch only adds/modifies logging statements, although the logs can be conditional.
Thunderbird Configuration Files
$ cd $profile # where $profile is your profile folder $ touch user.js # create the empty javascript file alternatively, open a files window (if you're on ubuntu.
Access StringBundle from Overlay
rc="chrome://your_extension/locale/overlay.properties" id="your-extension-strings" /> </stringbundleset> now that your stringbundle is attached you can access it from javascript as follows: var str = document.getelementbyid("your-extension-strings"); //get the stringbundle object itself str.getstring("propertyname"); //get a string (and do something with it) alternative way let stringbundleservice = cc["@mozilla.org/intl/stringbundle;1"].getservice(ci.nsistringbundleservice); let bundle = stringbundleservice.createbundle("chrome://your_extension/locale/overlay.properties"); let str = bundle.getstringfromname("propertyname"); see nsistringbundleservice ...
Access Thunderbird Window Areas
an alternative to these methods is to directly access the element by it's id as in the detect when a folder opens example.
customDBHeaders Preference
setting the preferences although there are various ways to set preferences, i tend to just navigate to the directory where my profile is stored and edit the user.js file with my favorite text editor.
Using popup notifications
ementbyid("notification-popup-box")); var notification = notify.show( // browser gbrowser.selectedbrowser, // popup id "pdes-popup", // message "hi, there!, i'm gonna show you something today!!", // anchor id null, // main action { label: "click here", accesskey: "d", callback: function() { // you can call your function here } }, // secondary action null, // options { // alternative way to set the popup icon popupiconurl: "chrome://popupnotifications/skin/mozlogo.png" } ); settimeout(function(){ notification.remove(); }, 900); // time in milliseconds to disappear the door-hanger popup.
Virtualenv
the mozilla build system mostly uses .pth files instead of the more typically used python setup.py develop or python setup.py install to install python modules in to the virtualenv's python path due to performance concerns (although such functionality is available via the setup.py keyword in a packages.txt file).
WebIDL bindings
for objects that can only be created via a constructor, this allows disabling the functionality altogether and making it look like the feature is not implemented at all.
Library
alternative syntax another use for ctypes.declare is to get non-function/non-methods from libraries.
PKCS #11 Netscape Trust Objects - Network Security Services
although these are specific to a certificate, they do not need to be stored on the same token as the certificate.
URLs - Plugins
nntp (usenet news using nntp access) locates usenet news groups or individual usenet articles; alternate to news.
DOM Inspector internals - Firefox Developer Tools
using modular overlays also allows for common xul to be shared across the various documents that make up the dom inspector's ui, although not all overlays are shared by multiple consumers.
Introduction to DOM Inspector - Firefox Developer Tools
alternatively, when used in conjunction with the style sheets viewer, the css rules viewer lists all recognized rules from that style sheet in order.
Inspecting web app manifests - Firefox Developer Tools
lly deployed, you'll get the following output shown: deploying a manifest to get a manifest deployed successfully, you need to include a <link> element in the <head> of your document that points to your .webmanifest file: <link rel="manifest" href="/manifest.webmanifest"> the .webmanifest extension is recommended in the spec, and should be served with an application/manifest+json mime type, although browsers generally tend to support manifests with other appropriate extensions like .json (mime type: application/json).
Debugging service workers - Firefox Developer Tools
when you fill up the cache with assets, but then want to alter the behavior slightly, you previously had to manually write code to empty the cache, and then fill it again.
Debugger.Source - Firefox Developer Tools
although the main script of a worker thread is introduced by a call to worker or sharedworker, these accessors always return undefined on such script’s sources.
Dominators view - Firefox Developer Tools
you can use alt + click to expand the whole graph under a node.
Migrating from Firebug - Firefox Developer Tools
with the script execution halted it shows the different variable scopes available within the current call stack frame.
Inspecting web sockets - Firefox Developer Tools
supported ws protocols the inspector currently supports the following web socket protocols: plain json socket.io sockjs signalr wamp the payload based on those protocols is parsed and displayed as an expandable tree for easy inspection, although you can of course still see the raw data (as sent over the wire) as well.
Performance Analysis - Firefox Developer Tools
(alternatively, if you have only just opened the network monitor, so it's not yet populated with the list of requests, you'll get a stopwatch icon in the main window.) the network monitor then loads the site twice: once with an empty browser cache, and once with a primed browser cache.
Examine and edit CSS - Firefox Developer Tools
ctrl + up/down (on linux and windows) or alt + up/down (on mac) increments or decrements values by 0.1.
Frame rate - Firefox Developer Tools
for example, here's a screenshot of a performance profile: you can see that the average frame rate is reasonably healthy, but there are three spots where frame rate collapses for tens of milliseconds.
Intensive JavaScript - Firefox Developer Tools
we can see that frame rate is pretty healthy for most of the recording, but collapses completely whenever we press the button.
Style Editor - Firefox Developer Tools
md + x ctrl + x copy ctrl + c cmd + c ctrl + c paste ctrl + v cmd + v ctrl + v undo ctrl + z cmd + z ctrl + z redo ctrl + shift + z / ctrl + y cmd + shift + z / cmd + y ctrl + shift + z / ctrl + y indent tab tab tab unindent shift + tab shift + tab shift + tab move line(s) up alt + up alt + up alt + up move line(s) down alt + down alt + down alt + down comment/uncomment line(s) ctrl + / cmd + / ctrl + / ...
View Source - Firefox Developer Tools
to access go to line from the keyboard, press control + option + l on macos, or alt + shift + l on windows or linux.
AesGcmParams - Web APIs
the aes-gcm specification recommends that it should be 96, 104, 112, 120 or 128, although 32 or 64 bits may be acceptable in some applications: appendix c of the specification provides additional guidance here.
Animation() - Web APIs
although in the future other effects such as sequenceeffects or groupeffects might be possible, the only kind of effect currently available is keyframeeffect.
AudioBufferSourceNode.loopEnd - Web APIs
when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend.
AudioBufferSourceNode.loopStart - Web APIs
when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend.
AudioBufferSourceNode.playbackRate - Web APIs
you can run the example live (or view the source.) play the song and alter the playback rate for some fun results.
AudioContext.suspend() - Web APIs
the suspend() method of the audiocontext interface suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing cpu/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while.
AudioContext - Web APIs
audiocontext.suspend() suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing cpu/battery usage in the process.
AudioListener - Web APIs
note: although these methods are deprecated they are currently the only way to set the orientation and position in firefox, internet explorer and safari.
AudioNode.connect() - Web APIs
WebAPIAudioNodeconnect
var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillator = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillator.connect(gainnode); gainnode.connect(audioctx.destination); audioparam example in this example, we will be altering the gain value of a gainnode using an oscillatornode with a slow frequency value.
AudioNode - Web APIs
WebAPIAudioNode
while the actual processing is done internally by the browser and cannot be altered, you could write a wrapper around an audio node to provide custom properties and methods.
AudioParam.linearRampToValueAtTime() - Web APIs
this is pretty useful for fade in/fade out effects, although audioparam.exponentialramptovalueattime() is often said to be a bit more natural.
AudioParam.value - Web APIs
WebAPIAudioParamvalue
this is the parameter's value at a time of 0.0 seconds, and will remain the parameter's value until the first render quantum in which the value is altered.
AudioParamDescriptor - Web APIs
here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well).
AudioTrack.enabled - Web APIs
the element's audio tracks are then scanned through using the javascript foreach() method (although the audiotracks property of a media element isn't actually a javascript array, it can be accessed like one for the most part).
AudioTrack.kind - Web APIs
WebAPIAudioTrackkind
audio track kind strings the kinds available for audio tracks are: "alternative" a potential alternative to the main track, such as a different audio take or a version of the soundtrack with only the music and no dialogue.
AudioTrack.label - Web APIs
WebAPIAudioTracklabel
function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "main-desc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label: track.label }); } }); return tracklist; } the resulting tracklist contains an array of audio tracks whose kind is one of those in the array wantedkinds, w...
AudioTrack - Web APIs
function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "main-desc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label: track.label }); } }); return tracklist; } the resulting tracklist contains an array of audio tracks whose kind is one of those in the array wantedkinds, w...
AudioWorkletNode.parameters - Web APIs
here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well).
AudioWorkletNode - Web APIs
although the interface is available outside secure contexts, the baseaudiocontext.audioworklet property is not, thus custom audioworkletprocessors cannot be defined outside them.
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well).
AudioWorkletProcessor.process - Web APIs
although the method is not a part of the audioworkletprocessor interface, any implementation of audioworkletprocessor must provide a process() method.
AudioWorkletProcessor - Web APIs
although not defined on the interface, the deriving class must have the process method.
BasicCardResponse - Web APIs
the basiccardresponse dictionary (related to the payment request api, although defined in the basic card payment spec) defines an object structure for payment response details such as the number/expiry date of the card used to make the payment, and the billing address.
Blob.slice() - Web APIs
WebAPIBlobslice
the original blob is not altered.
CSS.escape() - Web APIs
WebAPICSSescape
// "--a" css.escape(0) // "\30 ", the unicode code point of '0' is 30 css.escape('\0') // "\ufffd", the unicode replacement character in context uses to escape a string for use as part of a selector, the escape() method can be used: var element = document.queryselector('#' + css.escape(id) + ' > img'); the escape() method can also be used for escaping strings, although it escapes characters that don't strictly need to be escaped: var element = document.queryselector('a[href="#' + css.escape(fragment) + '"]'); specification specification status comment css object model (cssom)the definition of 'css.escape()' in that specification.
CSSPositionValue - Web APIs
#image { width: 300px; height: 300px; border: 1px solid black; background-color: #dededf; object-fit: none; } <p>check the developer tools to see the log in the console and to inspect the style attribute on the image.</p> <img id="image" src="https://udn.realityripple.com/samples/db/4f9fbd7dfb.svg" alt="mdn logo"/> ...
CSSStyleDeclaration - Web APIs
an alternative to accessing nodelist[i] (which instead returns undefined when i is out-of-bounds).
CSSStyleSheet.insertRule() - Web APIs
note: although insertrule() is exclusively a method of cssstylesheet, it actually inserts the rule into cssstylesheet.cssrules — its internal cssrulelist.
CSSStyleSheet - Web APIs
as the stylesheet list cannot be modified directly, there's no useful way to create a new cssstylesheet object manually (although constructable stylesheet objects is coming to the web platform soon and is already supported in blink).
Using the CSS Typed Object Model - Web APIs
let parsedunit = cssnumericvalue.parse( unit ); console.log( parsedunit ); // cssunitvalue {value: 1.2, unit: "rem"} console.log( parsedunit.unit ); // "rem" console.log( parsedunit.value ); // 1.2 cssmathsum although the <button> element is an inline element by default, we've added display: inline-block; to enable sizing.
CSS Typed Object Model API - Web APIs
stylepropertymap the stylepropertymap interface of the the css typed object model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration.
CacheStorage - Web APIs
those that aren't using https, although this definition will likely become more complex in the future.) when testing, you can get around this by checking the "enable service workers over http (when toolbox is open)" option in the firefox devtools options/gear menu.
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
this may change in the future, so it would be wise to plan ahead and watch for exceptions such as securityerror (although the specific error that might be thrown is not mentioned in the spec, this is a likely candidate).
CanvasRenderingContext2D.addHitRegion() - Web APIs
lue = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }); canvas.addeventlistener("mousemove", function(event){ if(event.region) { alert("ouch, my eye :("); } }); textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications canvas hit regions have been removed from the whatwg living standard, although discussions about future standardization are ongoing.
CanvasRenderingContext2D.clearHitRegions() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // set some hit regions ctx.addhitregion({id: 'eyes'}); ctx.addhitregion({id: 'nose'}); ctx.addhitregion({id: 'mouth'}); // remove them altogether from the canvas ctx.clearhitregions(); specifications canvas hit regions have been removed from the whatwg living standard, although discussions about future standardization are ongoing.
CanvasRenderingContext2D.closePath() - Web APIs
note: although closepath() is called after all the arcs have been created, only the last arc (sub-path) gets closed.
CanvasRenderingContext2D.getLineDash() - Web APIs
syntax ctx.getlinedash(); return value an array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units).
CanvasRenderingContext2D.removeHitRegion() - Web APIs
html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // set a hit region ctx.addhitregion({id: 'eyes'}); // remove it from the canvas ctx.removehitregion('eyes'); specifications canvas hit regions have been removed from the whatwg living standard, although discussions about future standardization are ongoing.
CanvasRenderingContext2D.textAlign - Web APIs
note that the direction property is manually specified as "ltr", although this is also the default for english-language text.
Applying styles and colors - Web APIs
the setlinedash method accepts a list of numbers that specifies distances to alternately draw a line and a gap and the linedashoffset property sets an offset where to start the pattern.
Drawing shapes with canvas - Web APIs
in upcoming pages we'll see two alternative methods for clearrect(), and we'll also see how to change the color and stroke style of the rendered shapes.
Comment - Web APIs
WebAPIComment
the comment interface represents textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view.
Console API - Web APIs
the console api spec was created to define consistent behavior, and all modern browsers eventually settled on implementing this behavior — although some implementations still have their own additional proprietary functions.
ConstantSourceNode.offset - Web APIs
let's say we have an event handler (for click events, in this case) which needs to respond by altering the value of the two gain nodes.
CredentialsContainer.get() - Web APIs
signal: an instance of abortsignal that can indicate that an ongoing get() operation should be halted.
CustomElementRegistry.define() - Web APIs
hover + .info, .icon:focus + .info {' + 'opacity: 1;' + '}'; // attach the created elements to the shadow dom shadow.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); } } // define the new element customelements.define('popup-info', popupinfo); <popup-info img="img/alt.png" text="your card validation code (cvc) is an extra security feature — it is the last 3 or 4 numbers on the back of your card."> note: constructors for autonomous custom elements must extend htmlelement.
CustomEvent - Web APIs
event.explicitoriginaltarget read only the explicit original target of the event (mozilla-specific.) event.originaltarget read only the original target of the event, before any retargetings.
DOMMatrix - Web APIs
WebAPIDOMMatrix
properties this interface inherits properties from dommatrixreadonly, though some of these properties are altered to be mutable.
DOMPoint.fromPoint() - Web APIs
although this interface is based on dompointreadonly, it is not read-only; the properties within may be changed at will.
DOMPoint.x - Web APIs
WebAPIDOMPointx
in general, positive values x mean to the right, and negative values of x means to the left, barring any transforms that may have altered the orientation of the axes.
DOMPoint.y - Web APIs
WebAPIDOMPointy
unless transforms have been applied to alter the orientation, the value of y increases downward and decreases upward.
DOMPointInit.x - Web APIs
WebAPIDOMPointInitx
in general, positive values x mean to the right, and negative values of x means to the left, assuming that transforms have not altered the orientation of the axes.
DOMPointInit - Web APIs
dompointinit.z an unrestricted floating-point value which gives the point's z-coordinate, which is (assuming no transformations that alter the situation) the depth coordinate; positive values are closer to the user and negative values retreat back into the screen.
DOMPointReadOnly() - Web APIs
the dompointreadonly() constructor returns a new dompointreadonly object representing a point in 2d or 3d space, optionally with perspective, whose values cannot be altered by script code.
DOMUserData - Web APIs
note that although it can be an object, in mozilla, it may be returned as a string or other type, if it was set as such a type (e.g., node.setuserdata() and node.getuserdata()).
DataTransfer.dropEffect - Web APIs
how this is determined is platform specific, but typically the user can press modifier keys such as the alt key to adjust the desired action.
DataTransferItem.type - Web APIs
the type is a unicode string generally given by a mime type, although a mime type is not required.
DedicatedWorkerGlobalScope: message event - Web APIs
sage(): const worker = new worker("static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); the worker can listen for this message using addeventlistener(): // inside static/scripts/worker.js self.addeventlistener('message', (event) => { console.log(`received message from parent: ${event.data}`); }); alternatively, it could listen using the onmessage event handler property: // static/scripts/worker.js self.onmessage = (event) => { console.log(`received message from parent: ${event.data}`); }; specifications specification status html living standard living standard ...
DelayNode - Web APIs
WebAPIDelayNode
alternatively, you can use the baseaudiocontext.createdelay() factory method.
Document: DOMContentLoaded event - Web APIs
bubbles yes cancelable yes (although specified as a simple event that isn't cancelable) interface event event handler property none a different event, load, should be used only to detect a fully-loaded page.
Document.adoptNode() - Web APIs
best practice: although firefox doesn't currently enforce this rule, we encourage you to follow this rule for improved future compatibility.
Document.createElementNS() - Web APIs
although this is not an extremely useful xul document, it does demonstrate the use of elements from two different namespaces within a single document: <?xml version="1.0"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" title="||working with elements||" onload="init()"> <script type="application/javascript"><![...
Document.createEntityReference() - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
you can make changes to the document by altering snapshot nodes.
Document.fullscreen - Web APIs
although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.
Document.fullscreenEnabled - Web APIs
although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.
Document.height - Web APIs
WebAPIDocumentheight
syntax pixels = document.height example // alert document height alert(document.height); alternatives document.body.clientheight document.documentelement.clientheight document.documentelement.scrollheight specification html5 ...
Document.importNode() - Web APIs
best practice: although firefox doesn't currently enforce this rule, we encourage you to follow this rule for improved future compatibility.
Document: keypress event - Web APIs
examples of keys that don't produce a character value are modifier keys such as alt, shift, ctrl, or meta.
Document.readyState - Web APIs
console.log("the first css rule is: " + document.stylesheets[0].cssrules[0].csstext); break; } readystatechange as an alternative to domcontentloaded event // alternative to domcontentloaded event document.onreadystatechange = function () { if (document.readystate === 'interactive') { initapplication(); } } readystatechange as an alternative to load event // alternative to load event document.onreadystatechange = function () { if (document.readystate === 'complete') { initapplication(); } } read...
Document.width - Web APIs
WebAPIDocumentwidth
syntax pixels = document.width; example function init() { alert("the width of the document is " + document.width + " pixels."); } alternatives document.body.clientwidth /* width of <body> */ document.documentelement.clientwidth /* width of <html> */ window.innerwidth /* window's width */ specification html5 ...
Document.xmlEncoding - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Document.xmlVersion - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
DocumentOrShadowRoot.fullscreenElement - Web APIs
although this property is read-only, it will not throw if it is modified (even in strict mode); the setter is a no-operation and it will be ignored.
Introduction to the DOM - Web APIs
note: because the vast majority of code that uses the dom revolves around manipulating html documents, it's common to refer to the nodes in the dom as elements, although strictly speaking not every node is an element.
DragEvent() - Web APIs
although this interface has a constructor, it is not possible to create a useful datatransfer object from script, since datatransfer objects have a processing and security model that is coordinated by the browser during drag-and-drops.
DragEvent - Web APIs
WebAPIDragEvent
constructors although this interface has a constructor, it is not possible to create a useful datatransfer object from script, since datatransfer objects have a processing and security model that is coordinated by the browser during drag-and-drops.
EffectTiming.iterations - Web APIs
examples in the forgotten key example, alice waves her arm up and down the entire time the page is open by passing infinity as the value for her iterations property: // get alice's arm, and wave it up and down document.getelementbyid("alice_arm").animate([ { transform: 'rotate(10deg)' }, { transform: 'rotate(-40deg)' } ], { easing: 'steps(2, end)', iterations: infinity, direction: 'alternate', duration: 600 }); specifications specification status comment web animationsthe definition of 'iterations' in that specification.
Element.accessKey - Web APIs
WebAPIElementaccessKey
to work around this, browsers implement accesskey behavior if the keys are pressed with other "qualifying" keys (such as alt + accesskey).
Element.computedStyleMap() - Web APIs
the computedstylemap() method of the element interface returns a stylepropertymapreadonly interface which provides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration.
Element.getAttributeNames() - Web APIs
using getattributenames() along with getattribute(), is a memory-efficient and performant alternative to accessing element.attributes.
Element.getClientRects() - Web APIs
<h3>a table with a caption</h3> <p>although the table's border box doesn't include the caption, the client rects do include the caption.</p> <div> <strong>original</strong> <table> <caption>caption</caption> <thead> <tr><th>thead</th></tr> </thead> <tbody> <tr><td>tbody</td></tr> </tbody> </table> </div> <div> <strong>table's rect</strong> <table class="withclientrectsoverlay"> <captio...
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
name = "<script>alert('i am john in an annoying alert!')</script>"; el.innerhtml = name; // harmless in this case although this may look like a cross-site scripting attack, the result is harmless.
Element: keypress event - Web APIs
examples of keys that don't produce a character value are modifier keys such as alt, shift, ctrl, or meta.
Element - Web APIs
WebAPIElement
element.computedstylemap() returns a stylepropertymapreadonly interface which provides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration.
ElementCSSInlineStyle.style - Web APIs
for adding specific styles to an element without altering other style values, it is preferred to use the individual properties of style (as in elt.style.color = '...') as using elt.style.csstext = '...' or elt.setattribute('style', '...') sets the complete inline style for the element by overriding the existing inline styles.
Event.returnValue - Web APIs
WebAPIEventreturnValue
new projects should generally avoid using returnvalue, although they may if they choose to do so.
Event - Web APIs
WebAPIEvent
event.explicitoriginaltarget read only the explicit original target of the event (mozilla-specific.) event.originaltarget read only the original target of the event, before any retargetings.
EventTarget.dispatchEvent() - Web APIs
amsung internetdispatcheventchrome full support 4edge full support 12firefox full support 2ie full support 9 full support 9 no support 6 — 11notes alternate name notes older versions of ie supported an equivalent, proprietary eventtarget.fireevent() method.alternate name uses the non-standard name: fireeventopera full support 9safari full support 3.2webview android full support 4chrome android fu...
FetchEvent.respondWith() - Web APIs
this means sites can still provide an "alternate" view of a web page when offline without changing the user-visible url.
File.fileName - Web APIs
WebAPIFilefileName
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
File.getAsBinary() - Web APIs
WebAPIFilegetAsBinary
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
File.getAsText() - Web APIs
WebAPIFilegetAsText
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
FileError - Web APIs
WebAPIFileError
error callbacks are not optional for your sanity although error callbacks are optional, you should include them in the arguments of the methods for the sake of the sanity of your users.
FileReader: abort event - Web APIs
face progressevent event handler property filereader.onabort examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "se...
FileReader: load event - Web APIs
rface progressevent event handler property filereader.onload examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "se...
FileReader: loadend event - Web APIs
ce progressevent event handler property filereader.onloadend examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "se...
FileReader: loadstart event - Web APIs
progressevent event handler property filereader.onloadstart examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "se...
FileReader: progress event - Web APIs
e progressevent event handler property filereader.onprogress examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "se...
FileReader.readAsDataURL() - Web APIs
example html <input type="file" onchange="previewfile()"><br> <img src="" height="200" alt="image preview..."> javascript function previewfile() { const preview = document.queryselector('img'); const file = document.queryselector('input[type=file]').files[0]; const reader = new filereader(); reader.addeventlistener("load", function () { // convert image file to base64 string preview.src = reader.result; }, false); if (file) { reader.readasdataurl(file); } ...
GeolocationPosition.coords - Web APIs
it contains the location, that is longitude and latitude on the earth, the altitude, and the speed of the object concerned, regrouped inside the returned value.
GeolocationPosition - Web APIs
the position, represented by a geolocationcoordinates object, comprehends the 2d position of the device, on a spheroid representing the earth, but also its altitude and its speed.
Using the Geolocation API - Web APIs
hence many geolocation success callbacks look fairly simple: function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; // do something with your latitude and longitude } you can however get a number of other bits of information from a geolocationcoordinates object, including altitude, speed, what direction the device is facing, and an accuracy measure of the altitude, longitude, and latitude data.
GlobalEventHandlers.onanimationiteration - Web APIs
#box { width: var(--boxwidth); height: var(--boxwidth); left: 0; top: 0; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; animation: 2s ease-in-out 0s infinite alternate both paused slidebox; } the animation's keyframes are defined next; they describe an animation which causes the box to migrate from the top-left corner of the container to the bottom-right corner.
GlobalEventHandlers.onauxclick - Web APIs
historically, click has generally fired for the click of any device input button, although with browser behavior being somewhat inconsistent.
GlobalEventHandlers.onchange - Web APIs
note: unlike oninput, the onchange event handler is not necessarily called for each alteration to an element's value.
GlobalEventHandlers.oninput - Web APIs
note: unlike oninput, the onchange event handler is not necessarily called for each alteration to an element's value.
HTMLAreaElement - Web APIs
htmlareaelement.alt is a domstring that reflects the alt html attribute, containing alternative text for the element.
Audio() - Web APIs
it is sent to the <audio> element when there's enough audio available to begin playback, although interruptions may occur).
msAudioCategory - Web APIs
*note that if msaudiocategory is set to communications, msrealtime is automatically set to true.
HTMLCanvasElement.toDataURL() - Web APIs
color in this example): html <img class="grayscale" src="mypicture.png" alt="description of my picture" /> javascript window.addeventlistener('load', removecolors); function showcolorimg() { this.style.display = 'none'; this.nextsibling.style.display = 'inline'; } function showgrayimg() { this.previoussibling.style.display = 'inline'; this.style.display = 'none'; } function removecolors() { var aimages = document.getelementsbyclassname('grayscale'), ...
HTMLElement.dir - Web APIs
WebAPIHTMLElementdir
an image can have its dir property set to "rtl" in which case the html attributes title and alt will be formatted and defined as "rtl".
HTMLElement - Web APIs
unlike the input event, the change event is not necessarily fired for each alteration to an element's value.
HTMLFormElement.encoding - Web APIs
the htmlformelement.encoding property is an alternative name for the enctype element on the dom htmlformelement object.
HTMLFormElement: reset event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for form resets, and logs the current event.timestamp whenever that occurs.
HTMLFormElement: submit event - Web APIs
bubbles yes (although specified as a simple event that doesn't bubble) cancelable yes interface submitevent event handler property globaleventhandlers.onsubmit note that the submit event fires on the <form> element itself, and not on any <button> or <input type="submit"> inside it.
HTMLImageElement.crossOrigin - Web APIs
ument.queryselector(".container"); function loadimage(url) { const image = new image(200, 200); image.addeventlistener("load", () => container.prepend(image) ); image.addeventlistener("error", () => { const errmsg = document.createelement("output"); errmsg.value = `error loading image at ${url}`; container.append(errmsg); }); image.crossorigin = "anonymous"; image.alt = ""; image.src = url; } loadimage(imageurl); html <div class="container"> <p>here's a paragraph.
HTMLImageElement.currentSrc - Web APIs
html <img src="/files/16797/clock-demo-400px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 200w, /files/16797/clock-demo-400px.png 400w" sizes="(max-width: 400px) 50%, 90%"> javascript var clockimage = document.queryselector("img"); let p = document.createelement("p"); if (!clockimage.currentsrc.endswith("200px.png")) { p.innertext = "using the 200px image."; } else { p.innertext = "using the 400px image!"; } document...
HTMLImageElement.height - Web APIs
<p>image height: <span class="size">?</span>px (resize to update)</p> <img src="/files/17373/clock-demo-200px.png" alt="clock" srcset="/files/17373/clock-demo-200px.png 200w, /files/17374/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 300px"> javascript the javascript code looks at the height to determine the height of the image given the width at which it's currently drawn.
HTMLImageElement.lowSrc - Web APIs
reduced color depth; a primary image in 32-bit color might have an alternate image in 8-bit color.
HTMLImageElement.naturalHeight - Web APIs
example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors.
HTMLImageElement.naturalWidth - Web APIs
example this example simply displays both the natural, density-adjusted size of an image as well as its rendered size as altered by the page's css and other factors.
HTMLImageElement.src - Web APIs
examples specifying a single image html <img src="https://udn.realityripple.com/samples/d6/7ab36d79bb.jpg" width="160" alt="slices of grapefruit, looking yummy."> result using src with an image set when using a set of images with the srcset property, the src serves as either a fallback for older browsers, or as the 1x size of the image.
HTMLImageElement.useMap - Web APIs
consider a <map> that looks like this: <map name="mainmenu-map"> <area shape="circle" coords="25, 25, 75, 75" href="/index.html" alt="return to home page"> <area shape="rect" coords="25, 25, 100, 150" href="/index.html" alt="shop"> </map> given the image map named mainmenu-map, the image which uses it should look something like the following: <img src="menubox.png" usemap="#mainmenu-map"> for additional examples (including interactive ones), see the articles about the <map> and <area> elements, as well as the guide to us...
HTMLImageElement.width - Web APIs
<p>image width: <span class="size">?</span>px (resize to update)</p> <img src="/files/16864/clock-demo-200px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 200w, /files/16797/clock-demo-400px.png 400w" sizes="(max-width: 400px) 200px, 400px"> javascript the javascript code looks at the width to determine the width of the image at the moment.
HTMLInputElement - Web APIs
properties that apply only to elements of type image alt string: returns / sets the element's alt attribute, containing alternative text to use when type is image.
HTMLMediaElement.play() - Web APIs
usage notes although the term "autoplay" is usually thought of as referring to pages that immediately begin playing media upon being loaded, web browsers' autoplay policies also apply to any script-initiated playback of media, including calls to play().
HTMLMediaElement - Web APIs
htmlmediaelement.initialtime read only returns a double that indicates the initial playback position in seconds.
HTMLOptionsCollection - Web APIs
the htmloptionscollection interface represents a collection of <option> html elements (in document order) and offers methods and properties for selecting from the list as well as optionally altering its items.
HTMLTableElement.rows - Web APIs
although the property itself is read-only, the returned object is live and allows the modification of its content.
HTMLTableElement.tBodies - Web APIs
although the property is read-only, the returned object is live and allows the modification of its content.
Headers.getAll() - Web APIs
WebAPIHeadersgetAll
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
HmacImportParams - Web APIs
warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable.
IDBCursor.update() - Web APIs
WebAPIIDBCursorupdate
in such a situation, you would have to delete the record altogether and then add a new one using idbobjectstore.add.
InstallEvent - Web APIs
although this example has only one cache, you can use this approach for multiple caches.
IntersectionObserver.rootMargin - Web APIs
the browser is permitted to alter the values if rootmargin isn't specified when the object was instantiated, it defaults to the string "0px 0px 0px 0px", meaning that the intersection will be computed between the root element's unmodified bounds rectangle and the target's bounds.
IntersectionObserver.thresholds - Web APIs
although the options object you can specify when creating an intersectionobserver has a field named threshold, this property is called thresholds.
KeyboardEvent() - Web APIs
"altkey", optional and defaulting to false, of type boolean, that sets the value of keyboardevent.altkey.
KeyboardEvent.code - Web APIs
in other words, this property returns a value that isn't altered by keyboard layout or the state of the modifier keys.
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
some specialty keyboard keys (such as the extended keys for controlling media on multimedia keyboards) don't generate key codes on windows; instead, they trigger wm_appcommand events.
KeyboardEvent.keyCode - Web APIs
as described above, the keycode attribute is not useful for printable characters, especially those input with the shift or alt key pressed.
KeyboardEvent.shiftKey - Web APIs
syntax var shiftkeypressed = instanceofkeyboardevent.shiftkey return value a boolean example <html> <head> <title>shiftkey example</title> <script type="text/javascript"> function showchar(e){ alert( "key pressed: " + string.fromcharcode(e.charcode) + "\n" + "charcode: " + e.charcode + "\n" + "shift key pressed: " + e.shiftkey + "\n" + "alt key pressed: " + e.altkey + "\n" ); } </script> </head> <body onkeypress="showchar(event);"> <p>press any character key, with or without holding down the shift key.<br /> you can also use the shift key together with the alt key.</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe definition of ...
Keyboard API - Web APIs
examples of such key/key combinations include escape, alt+tab, and ctrl+n.
LocalMediaStream - Web APIs
when the source of the stream is a connected device (such as a camera or microphone), capture of media from the device is halted.
Location - Web APIs
WebAPILocation
examples // create anchor element and use href property for the purpose of this example // a more correct alternative is to browse to the url and use document.location or window.location var url = document.createelement('a'); url.href = 'https://developer.mozilla.org:8080/search?q=url#search-results-close-container'; console.log(url.href); // https://developer.mozilla.org:8080/search?q=url#search-results-close-container console.log(url.protocol); // https: console.log(url.host); // developer.m...
MIDIOutputMap - Web APIs
although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions.
MSCandidateWindowUpdate - Web APIs
tan ime candidate window may be identified as needing to change size for any of the following reasons: as a result of displaying new / changed alternatives or predictions web applications need only register for this event once per element (the handler will remain valid for the lifetime of the element).
MSSiteModeEvent - Web APIs
although this event inherits from the event object, it cannot be created by using createevent.
MediaDeviceInfo.groupId - Web APIs
this could be altered easily to either leave out the passed-in device from the returned list, or to place it at the top of the list, by comparing the two objects' deviceid values, only pushing the device onto the result list if it doesn't match.
MediaRecorder.onwarning - Web APIs
the mediarecorder.onwarning event handler (part of the mediarecorder api) handles the recordingwarning event, allowing you to run code in response to non-fatal errors being thrown during media recording via a mediarecorder, which don't halt recording.
MediaSession.setActionHandler() - Web APIs
stop halts playback entirely.
Media Session action types - Web APIs
stop halts playback entirely.
MediaSessionActionDetails.action - Web APIs
stop halts playback entirely.
MediaSessionActionDetails - Web APIs
stop halts playback entirely.
MediaTrackConstraints.autoGainControl - Web APIs
automatic gain control is typically a feature provided by microphones, although it can be provided by other input sources as well.
MediaTrackConstraints.cursor - Web APIs
for example, if your app needs to alter the stream by inserting a representation of the cursor position if the stream doesn't include the rendered cursor, you can determine the need to do so by using code like this: let insertfakecursorflag = false; if (displaystream.getvideotracks()[0].getsettings().cursor === "never") { insertfakecursorflag = true; } following this code, insertfakecursorflag is true if there's no cursor rende...
MediaTrackConstraints.deviceId - Web APIs
however, the value of the deviceid is determined by the source of the track's content, and there's no particular format mandated by the specification (although some kind of guid is recommended).
MediaTrackConstraints.groupId - Web APIs
however, the value of the groupid is determined by the source of the track's content, and there's no particular format mandated by the specification (although some kind of guid is recommended).
MediaTrackConstraints.noiseSuppression - Web APIs
noise suppression is typically provided by microphones, although it can be provided by other input sources as well.
MediaTrackSettings.autoGainControl - Web APIs
this feature is typically used on microphones, although it can be provided by other input sources as well.
MediaTrackSettings.deviceId - Web APIs
the actual value of the string, however, is determined by the source of the track, and there is no guarantee what form it will take, although the specification does recommend it be a guid.
MediaTrackSettings.groupId - Web APIs
the actual value of the string, however, is determined by the source of the track, and there is no guarantee what form it will take, although the specification does recommend it be a guid.
MediaTrackSettings.noiseSuppression - Web APIs
this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well.
MediaTrackSupportedConstraints.frameRate - Web APIs
"not supported" with code to provide alternative methods for presenting the audiovisual information you want to share with the user or otherwise work with.
Media Capabilities API - Web APIs
media capabilities information enables websites to enable adaptative streaming to alter the quality of content based on actual user-perceived quality, and react to a pick of cpu/gpu usage in real time.
Capabilities, constraints, and settings - Web APIs
this returns a mediastream with the audio and video from a source matching the inputs (typically a webcam, although if you provide the right constraints you can get media from other sources).
Microdata DOM API - Web APIs
g from an earlier example: <section itemscope itemtype="http://example.org/animals#cat"> <h1 itemprop="name http://example.com/fn">hedral</h1> <p itemprop="desc">hedral is a male american domestic shorthair, with a fluffy <span itemprop="http://example.com/color">black</span> fur with <span itemprop="http://example.com/color">white</span> paws and belly.</p> <img itemprop="img" src="hedral.jpeg" alt="" title="hedral, age 18 months"> </section> ...it would result in the following output: name http://example.com/fn desc http://example.com/color img (the duplicate occurrence of "http://example.com/color" is not included in the list.) htmlpropertiescollection the htmlpropertiescollection interface is used for collections of elements that add name-value pairs to a particular item in the micro...
Microsoft API extensions - Web APIs
element.msislayoutoptimalforplayback htmlvideoelement.msisstereo3d htmlvideoelement.mszoom htmlaudioelement.msaudiocategory htmlaudioelement.msaudiodevicetype htmlmediaelement.mscleareffects() htmlmediaelement.msinsertaudioeffect() mediaerror.msextendedcode msgraphicstrust msgraphicstruststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager mssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideoformatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled ms...
MouseEvent() - Web APIs
"altkey", optional and defaulting to false, of type boolean, that indicates if the alt key was simultaneously pressed.
MouseEvent.relatedTarget - Web APIs
document object model (dom) level 2 events specificationthe definition of 'mouseevent.altkey' in that specification.
MouseEvent.which - Web APIs
WebAPIMouseEventwhich
the standard alternatives to this property are mouseevent.button and mouseevent.buttons.
MouseEvent - Web APIs
mouseevent.altkey read only returns true if the alt key was down when the mouse event was fired.
MouseScrollEvent - Web APIs
method overview void initmousescrollevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long detailarg, in long screenxarg, in long screenyarg, in long clientxarg, in long clientyarg, in boolean ctrlkeyarg, in boolean altkeyarg, in boolean shiftkeyarg, in boolean metakeyarg, in unsigned short buttonarg, in nsidomeventtarget relatedtargetarg, in long axis); attributes attribute type description axis read only long indicates scroll direction.
MutationObserverInit.attributeOldValue - Web APIs
the mutationobserverinit dictionary's optional attributeoldvalue property is used to specify whether or not to record the prior value of the altered attribute in mutationrecord objects denoting attribute value changes.
Node.baseURI - Web APIs
WebAPINodebaseURI
although this property is read-only, its value may change in certain situations (see below).
Node.cloneNode() - Web APIs
WebAPINodecloneNode
although deep it still optional, it now defaults to false.
Node.nodePrincipal - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Node.setUserData() - Web APIs
WebAPINodesetUserData
this method offers the convenience of associating data with specific nodes without needing to alter the structure of a document and in a standard fashion, but it also means that extra steps may need to be taken if one wishes to serialize the information or include the information upon clone, import, or rename operations.
Node - Web APIs
WebAPINode
an alternative to document.body.innerhtml = "" ...
NodeList.item() - Web APIs
WebAPINodeListitem
alternate syntax javascript also offers an array-like bracketed syntax for obtaining an item from a nodelist by index: nodeitem = nodelist[index] example var tables = document.getelementsbytagname("table"); var firsttable = tables.item(1); // or simply tables[1] - returns the second table in the dom specifications specification status comment domthe definition of '...
Notification.Notification() - Web APIs
it defaults to auto, which just adopts the browser's language setting behavior, but you can override that behaviour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: the notification's language, as specified using a domstring representing a bcp 47 language tag.
PannerNode.orientationX - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and coneoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played.
PannerNode.orientationY - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played.
PannerNode.orientationZ - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played.
PannerNode.positionX - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played.
PannerNode.positionY - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played.
PannerNode.positionZ - Web APIs
depending on the directionality of the sound (as specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played.
PaymentRequest: shippingaddresschange event - Web APIs
that is, the paymentaddress which contains the shipping address may have some portions of its content altered, obscured, or left out entirely in order to prevent identifying the user without their consent (since if they choose to have you ship products to them, you'll need their address).
PaymentRequest.show() - Web APIs
function validateresponse(response) { checkallvalues(response) .then(response => response.complete("success")) .catch(response => response.complete("fail")); } you could even have checkallvalues() be a synchronous function, although that may have performance implications you don't want to deal with: function validateresponse(response) { if (checkallvalues(response) { response.complete("success"); } else { response.complete("fail"); } } see the article using promises for more information if you need more information about working with promises.
Using the Permissions API - Web APIs
this object will eventually include methods for querying, requesting, and revoking permissions, although currently it only contains permissions.query(); see below.
Point - Web APIs
WebAPIPoint
although it is not directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification.
Pointer events - Web APIs
#target { touch-action: pan-x; } compatibility with mouse events although the pointer event interfaces enable applications to create enhanced user experiences on pointer enabled devices, the reality is the vast majority of today's web content is designed to only work with mouse input.
Web Push API Notifications best practices - Web APIs
allowing your site to push notifications in realtime requires trust.
Push API - Web APIs
WebAPIPush API
firefox allows a limited number (quota) of push messages to be sent to an application, although push messages that generate notifications are exempt from this limit.
RTCConfiguration.certificates - Web APIs
although a given dtls connection only uses a single certificate, providing multiple options in the certificates list may improve the odds of establishing a connection by increasing the chances a mutually-compatible encryption algorithm and key size may be found.
RTCConfiguration - Web APIs
although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances.
RTCDataChannel.id - Web APIs
WebAPIRTCDataChannelid
each rtcpeerconnection can therefore have up to a theoretical maximum of 65,534 data channels on it, although the actual maximum may vary from browser to browser.
RTCIceCandidate.address - Web APIs
security notes it's important to note here that although webrtc does not require the two peers on an rtcpeerconnection to know one another's true ip addresses, the address property on rtcicecandidate can expose more information about the source of the remote peer than the user expects.
RTCIceCandidate.usernameFragment - Web APIs
example although the webrtc infrastructure will filter out obsolete candidates for you after an ice restart, you can do it yourself if you're trying to absolutely minimize the number of messages going back and forth.
RTCIceCandidatePairStats.circuitBreakerTriggerCount - Web APIs
a circuit breaker trigger is fired each time the connection times out or otherwise needs to be halted automatically.
RTCInboundRtpStreamStats.packetsDuplicated - Web APIs
the resulting value will be positive, although it will not match the count as computed in rfc 3660.
RTCOutboundRtpStreamStats.pliCount - Web APIs
this is often achieved by methods such as increasing the compression or lowering resolution, although the mechanisms available to reduce the bit rate of the stream vary from codec to codec.
RTCPeerConnection() - Web APIs
although only one certificate is used by a given connection, providing certificates for multiple algorithms may improve the odds of successfully connecting in some circumstances.
RTCRtpSendParameters - Web APIs
transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters().
RTCRtpStreamStats.ssrc - Web APIs
the manner in which these values are generated is not mandated by the specification, although it does make recommendations.
RTCRtpTransceiver.setCodecPreferences() - Web APIs
pass the altered list into setcodecpreferences() to specify your preferences.
Range.compareNode() - Web APIs
WebAPIRangecompareNode
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Range.surroundContents() - Web APIs
that is, unlike the alternative above, if there are partially selected nodes, they will not be cloned and instead the operation will fail.
ReadableStream.ReadableStream() - Web APIs
type optional this property controls what type of readable stream is being dealt with.
ReportingObserver() - Web APIs
available types include deprecation, intervention, and crash (although this last type usually isn't retrievable via a reportingobserver).
Using the Resource Timing API - Web APIs
transfersize[" + i + "] = not supported"); } } managing the resource buffer although the browser is required to support at least 150 resource timing performance entries in its resource timing buffer, some applications may use more resources than that limit.
RsaHashedImportParams - Web APIs
warning: although you can technically pass sha-1 here, this is strongly discouraged as it is considered vulnerable.
RsaHashedKeyGenParams - Web APIs
warning: although you can technically pass sha-1 as a value here, this is strongly discouraged as sha-1 is considered vulnerable.
format - Web APIs
the svgaltglyphelement.format property is a domstring that defines the format of the given font.
SVGTextContentElement - Web APIs
it is inherited by various text-related interfaces, such as svgtextelement, svgtspanelement, svgtrefelement, svgaltglyphelement and svgtextpathelement.
SVGTextPositioningElement - Web APIs
it is inherited by svgtextelement, svgtspanelement, svgtrefelement and svgaltglyphelement.
Using the Screen Capture API - Web APIs
the contraints alter what you see in the resulting stream.
Selection.modify() - Web APIs
WebAPISelectionmodify
syntax sel.modify(alter, direction, granularity) parameters alter the type of change to apply.
Selection.selectionLanguageChange() - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
ServiceWorkerContainer.register() - Web APIs
alternatively, if this code were included in a page at example.com/product/description.html, with the javascript file residing at example.com/product/sw.js, then the service worker would only apply to resources under example.com/product.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
bubbles no cancelable no interface pushsubscriptionchangeevent event handler property onpushsubscriptionchange usage notes although examples demonstrating how to share subscription related information with the application server tend to use fetch(), this is not necessarily the best choice for real-world use, since it will not work if the app is offline, for example.
Using Service Workers - Web APIs
in the json separately when the for() loop is being iterated through later on, it wouldn’t work, as the promise wouldn’t resolve at the same time as the iterations are being done (that is a synchronous process.) we actually resolve the promise with an array, as we want to make the loaded image blob available to the resolving function later on in the code, but also the image name, credits and alt text (see app.js lines 31-34).
SharedWorker() - Web APIs
although gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later accept data uris, that's not the case in all other browsers.
SpeechRecognition() - Web APIs
sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.continuous - Web APIs
| sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.grammars - Web APIs
sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.interimResults - Web APIs
sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
SpeechRecognition.lang - Web APIs
sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; //recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; ...
Storage Access API - Web APIs
safari implementation differences although the api surface is the same, websites using the storage access api should expect differences in the level and extent of storage access they receive between firefox and safari.
Streams API concepts - Web APIs
if you want another reader to start reading your stream, you typically need to cancel the first reader before you do anything else (although you can tee streams, see the teeing section below) note that there are two different types of readable stream.
StylePropertyMap - Web APIs
the stylepropertymap interface of the the css typed object model api provides a representation of a css declaration block that is an alternative to cssstyledeclaration.
StylePropertyMapReadOnly - Web APIs
the stylepropertymapreadonly interface of the the css typed object model api provides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration.
StyleSheet.disabled - Web APIs
a style sheet may be disabled by manually setting this property to true or if it's an inactive alternative style sheet.
SubtleCrypto.verify() - Web APIs
*/ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsa-pss .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( { name: "rsa-pss", saltlength: 32, }, publickey, signature, encoded ); signaturevalue.classlist.add(result ?
TouchEvent() - Web APIs
"altkey", optional and defaulting to false, of type boolean, that indicates if the alt key was simultaneously pressed.
TouchEvent.ctrlKey - Web APIs
example the touchevent.altkey example includes an example of this property's usage.
TouchEvent.metaKey - Web APIs
example the touchevent.altkey example includes an example of this property's usage.
TouchEvent.shiftKey - Web APIs
example the touchevent.altkey example includes an example of this property's usage.
TouchEvent - Web APIs
touchevent.altkey read only a boolean value indicating whether or not the alt key was down when the touch event was fired.
Supporting both TouchEvent and MouseEvent - Web APIs
// touchmove handler function process_touchmove(ev) { // call preventdefault() to prevent any further handling ev.preventdefault(); } event order although the specific ordering of touch and mouse events is implementation-defined, the standard indicates the following order is typical: for single input: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend mousemove mousedown mouseup click if the touchstart, touchmove or touchend event is canceled during an interaction, no mouse or click events will...
Using Touch Events - Web APIs
implementation and deployment status the touch events browser compatibility data indicates touch event support among mobile browsers is relatively broad, with desktop browser support lagging although additional implementations are in progress.
UIEvent.cancelBubble - Web APIs
although the similar event.cancelbubble property was included in an old working draft of w3c dom level 2.
UIEvent.isChar - Web APIs
WebAPIUIEventisChar
some keystroke combinations may raise events but not produce any character (example: ctrl-alt-?).
UIEvent - Web APIs
WebAPIUIEvent
although the uievent.inituievent() method is kept for backward compatibility, you should create a uievent object using the uievent() constructor.
URL.toJSON() - Web APIs
WebAPIURLtoJSON
the tojson() method of the url interface returns a usvstring containing a serialized version of the url, although in practice it seems to have the same effect as url.tostring().
URL API - Web APIs
WebAPIURL API
changing the url most of the properties of url are settable; you can write new values to them to alter the url represented by the object.
USBInTransferResult - Web APIs
a stall on a bulk or interrupt endpoint must be cleared by calling clearhalt() before transferin() can be called again.
USBOutTransferResult - Web APIs
a stall on a bulk or interrupt endpoint must be cleared by calling clearhalt() before transferout() can be called again.
VideoPlaybackQuality.totalFrameDelay - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
VideoTrack.kind - Web APIs
WebAPIVideoTrackkind
video track kind strings the kinds available for video tracks are: "alternative" a potential alternative to the main track, such as a different video take or a version of the soundtrack with only the music and no dialogue.
VideoTrack.label - Web APIs
WebAPIVideoTracklabel
function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "commentary" ]; el.videotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label: track.label }); } }); return tracklist; } the resulting tracklist contains an array of video tracks whose kind is one of those in the array wantedkinds, with each entry providing the...
WakeLockSentinel - Web APIs
// create a reference for the wake lock let wakelock = null; // create an async function to request a wake lock const requestwakelock = async () => { try { wakelock = await navigator.wakelock.request('screen'); // listen for our release event wakelock.addeventlistener('release', () => { // if wake lock is released alter the ui accordingly }); } catch (err) { // if wake lock request fails - usually system related, such as battery } } wakelockonbutton.addeventlistener('click', () => { requestwakelock(); }) wakelockoffbutton.addeventlistener('click', () => { if (wakelock !== null) { wakelock.release() .then(() => { wakelock = null; }) } }) specifications s...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
alternatively, you use the index that is assigned by the graphics card when compiling the vertex shader.
Color masking - Web APIs
alternatively, you may use the rgb components for color, but the alpha component for some custom pixel data of your invention.
Lighting in WebGL - Web APIs
simulating lighting and shading in 3d although going into detail about the theory behind simulated lighting in 3d graphics is far beyond the scope of this article, it's helpful to know a bit about how it works.
Using WebGL extensions - Web APIs
it should also be used for extensions which originated with the opengl es or opengl apis, but whose behavior has been significantly altered.
WebGL best practices - Web APIs
shaders, programs, and glsl avoid "#ifdef gl_es", which is always true you should never use #ifdef gl_es in your webgl shaders; although some early examples used this, it's not necessary, since this condition is always true in webgl shaders.
WebRTC connectivity - Web APIs
you can identify which one your end of the connection is by examining the value of rtcicecandidate.transport.role, although in general it doesn't matter which is which.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
where it matters for webrtc purposes, these are dealt with in a variety of places within the webrtc infrastructure.
Introduction to WebRTC protocols - Web APIs
this obviously comes with some overhead so it is only used if there are no other alternatives.
Taking still photos with WebRTC - Web APIs
<canvas id="canvas"> </canvas> <div class="output"> <img id="photo" alt="the screen capture will appear in this box."> </div> that's all of the relevant html.
Writing WebSocket client applications - Web APIs
this should use the url scheme wss://, although some software may allow you to use the insecure ws:// for local connections.
Writing a WebSocket server in C# - Web APIs
alternative solutions should be investigated for production environments.
Writing a WebSocket server in Java - Web APIs
although other server-side languages can be used to create a websocket server, this example uses oracle java to simplify the example code.
Using bounded reference spaces - Web APIs
although the user's xr system may provide automated detection and protection against exiting the safe area, it is always good practice to handle this yourself, watching for collisions between the user's position and the boundary of the world, and providing guidance to move back toward the origin point, or at least to stay inside the safe zone.
Movement, orientation, and motion: A WebXR example - Web APIs
it takes as input the base reference space for the object, and returns a new reference space that alters the location and orientation of the object o match the result of the inputs.
Advanced techniques: Creating and sequencing audio - Web APIs
.createoscillator(); osc.type = 'sine'; osc.frequency.value = 880; now we're going to create a gainnode, as it's the gain value that we will oscillate with our second, low frequency oscillator: let amp = audioctx.creategain(); amp.gain.setvalueattime(1, audioctx.currenttime); creating the second, low frequency, oscillator we'll now create a second — square — wave (or pulse) oscillator, to alter the amplification of our first sine wave: let lfo = audioctx.createoscillator(); lfo.type = 'square'; lfo.frequency.value = 30; connecting the graph the key here is connecting the graph correctly, and also starting both oscillators: lfo.connect(amp.gain); osc.connect(amp).connect(audioctx.destination); lfo.start(); osc.start(); osc.stop(audioctx.currenttime + pulsetime); note: we also don...
Web Audio API best practices - Web APIs
although it doesn't harness the full gamut of filters and other effects the web audio api comes with, you can do most of what you'd want to do.
Background audio processing using AudioWorklet - Web APIs
count; i++) { let sample = output[channelnum][i] + input[channelnum][i]; if (sample > 1.0) { sample = 1.0; } else if (sample < -1.0) { sample = -1.0; } output[channelnum][i] = sample; } } }; return true; } this is similar code to the previous sample in many ways, but only the first output—outputlist[0]—is altered.
Web audio spatialization basics - Web APIs
the sound direction is coming from the boombox speaker at the front, so when we rotate it, we can alter the sound's direction — i.e.
Functions and classes available to Web Workers - Web APIs
across the network.) 39 (39) (mostly in 34 (34) behind pref, although a few features are later.) no support 42 41 behind pref 10.1 filereader this api allows asynchronous read of blob and file objects.
Using Web Workers - Web APIs
in addition, they can perform i/o using xmlhttprequest (although the responsexml and channel attributes are always null).
Window: DOMContentLoaded event - Web APIs
bubbles yes cancelable yes (although specified as a simple event that isn't cancelable) interface event event handler property none the original target for this event is the document that has loaded.
Window.alert() - Web APIs
WebAPIWindowalert
syntax window.alert(message); parameters message optional a string you want to display in the alert dialog, or, alternatively, an object that is converted into a string and displayed.
Window.defaultStatus - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window.directories - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window.home() - Web APIs
WebAPIWindowhome
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window: message event - Web APIs
ps://example.org'; const windowmessagebutton = document.queryselector('#window-message'); windowmessagebutton.addeventlistener('click', () => { targetframe.postmessage('hello there', targetorigin); }); the receiver can listen for the message using addeventlistener() with code like this: window.addeventlistener('message', (event) => { console.log(`received message: ${event.data}`); }); alternatively the listener could use the onmessage event handler property: window.onmessage = (event) => { console.log(`received message: ${event.data}`); }; specifications specification status html living standard living standard ...
Window.mozAnimationStartTime - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window.mozPaintCount - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window.name - Web APIs
WebAPIWindowname
it has also been used in some frameworks for providing cross-domain messaging (e.g., sessionvars and dojo's dojox.io.windowname) as a more secure alternative to jsonp.
Window.onmozbeforepaint - Web APIs
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window.pkcs11 - Web APIs
WebAPIWindowpkcs11
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window: popstate event - Web APIs
these methods and their corresponding events can be used to add data to the history stack which can be used to reconstruct a dynamically generated page, or to otherwise alter the state of the content being presented while remaining on the same document.
Window.routeEvent() - Web APIs
WebAPIWindowrouteEvent
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
Window.screenLeft - Web APIs
WebAPIWindowscreenLeft
initialleft = window.screenleft + canvaselem.offsetleft; initialtop = window.screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); c...
Window.screenTop - Web APIs
WebAPIWindowscreenTop
initialleft = window.screenleft + canvaselem.offsetleft; initialtop = window.screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); c...
Window.screenX - Web APIs
WebAPIWindowscreenX
initialleft = window.screenleft + canvaselem.offsetleft; initialtop = window.screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); c...
Window.screenY - Web APIs
WebAPIWindowscreenY
initialleft = window.screenleft + canvaselem.offsetleft; initialtop = window.screentop + canvaselem.offsettop; function positionelem() { let newleft = window.screenleft + canvaselem.offsetleft; let newtop = window.screentop + canvaselem.offsettop; let leftupdate = initialleft - newleft; let topupdate = initialtop - newtop; ctx.fillstyle = 'rgb(0, 0, 0)'; ctx.fillrect(0, 0, width, height); ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); c...
Worker: message event - Web APIs
bubbles no cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and listens to messages from it using addeventlistener(): const worker = new worker("static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); alternatively, it could listen using the onmessage event handler property: const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.log(`received message from worker: ${event.data}`) }; the worker posts messages using self.postmessage(): // static/scripts/worker.js self.postmessage('i\'m alive!'); specifications specification status ...
Worker - Web APIs
WebAPIWorker
this does not let worker finish its operations; it is halted at once.
XMLHttpRequestResponseType - Web APIs
you shouldn't use this non-standard (and, as of firefox 68, entirely removed) api; instead, consider using the fetch api with readable streams, which offers a standard alternative to accessing the response in a streaming fashion.
XMLSerializer.serializeToString() - Web APIs
this may mean that a previously-specified prefix or default namespace may be dropped or altered.
XRBoundedReferenceSpace.boundsGeometry - Web APIs
although some samples render a mesh or other shape to display the bounds to the user, in a real-world application, you shouldn't do this.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
this new reference space is one in which the viewer's position is unchanged, but their orientation has been altered based on the pitch and yaw values generated from the accumulated mouse inputs.
XRReferenceSpace.onreset - Web APIs
the xrreferencespace interface's onreset event handler property can be set to a function which is called when the xrreferencespace receives a reset event, signaling that the xr device has experienced a discontinuity large enough to require that the position and/or orientation of the origin be significantly altered to compensate.
XRReferenceSpace: reset event - Web APIs
manual resets if you've spent any time using a vr headset, you've had times when you've started it up and although you're facing straight ahead, the headset thinks you're looking at the sky or the floor; or times when you point the hand controller straight forward, but it thinks you're pointing it up and to the right somewhere.
XRReferenceSpaceEvent.transform - Web APIs
alternatively, you can just discard any cached positional information and recompute from scratch.
XRSession: end event - Web APIs
bubbles no cancelable no interface xrsessionevent event handler xrsession.onend example to be informed when a webxr session comes to an end, you can add a handler to your xrsession instance using addeventlistener(), like this: xrsession.addeventlistener("end", function(event) { /* the session has shut down */ }); alternatively, you can use the xrsession.onend event handler property to establish a handler for the end event: xrsession.onend = function(event) { /* the session has shut down */ } specifications specification status comment webxr device apithe definition of 'end event' in that specification.
XRView.transform - Web APIs
WebAPIXRViewtransform
currently, webxr doesn't support more than two views per pose, although room has been left to extend the specification to support that in the future with some additions to the api.
XRViewport.y - Web APIs
WebAPIXRViewporty
note: although other web apis typically consider the y axis to begin at the top and grow larger progressing downward, webgl reverses this, with y growing larger as it goes upward on the screen.
XRWebGLLayer - Web APIs
although xrwebgllayer is currently the only type of framebuffer layer supported by webgl, it's entirely possible that future updates to the webxr specification may allow for other layer types and corresponding image sources.
ARIA Screen Reader Implementors Guide - Accessibility
alternatively, implementations may choose to have a policy of clearing more polite items, e.g.
Using the aria-valuetext attribute - Accessibility
the aria-valuetext attribute is used to define the human readable text alternative of aria-valuenow for a range widget such as progressbar, spinbutton or slider.
Using the progressbar role - Accessibility
it is not possible for the user to alter the value of a progressbar because it is always readonly.
x-ms-aria-flowfrom - Accessibility
the x-ms-aria-flowfrom property specifies the id of the previous element in an alternative reading order, allowing assistive technology to override the general default of reading in document source order.
ARIA: tabpanel role - Accessibility
the aria tabpanel role indicates description an element with the tabpanel role associated roles and attributes aria- keyboard interaction key action tab → ← delete required javascript features include note about semantic alternatives to using this role or attribute.
ARIA: cell role - Accessibility
the aria roles are not necessary if the native semantics of the table, and therefore the table rows, have not been altered, such as through the display property.
ARIA: document role - Accessibility
this mode can be altered through various roles, including the widget and application roles.
ARIA: feed role - Accessibility
if a feed is nested within a feed, such as a comments feed within a feed of blog posts, the convention is to tab into the nested feed with the tab key and to provide another key, such as alt + page down, to navigate from an 'outer' article to the first item in that article's nested feed.
ARIA: form role - Accessibility
anything that is not a <form> cannot be submitted, therefore you would have to use javascript to build an alternative data submission mechanism, for example with xmlhttprequest.
ARIA: List role - Accessibility
a list must have one or more listitem children, or, alternatively, have one or more groups as children, with each group having one or more listitems as children.
ARIA: Main role - Accessibility
for those navigating via landmark roles, the main role is an alternative for "skip to main content" links.there should only be one main landmark role per document.
ARIA: button role - Accessibility
if the button alters the current context, then focus typically remains on the button, such as muting and unmuting an audio file.
ARIA: heading role - Accessibility
although theoretically you can go higher, and some screen readers may support it, the results can be unpredictable with other browser/screen reader combinations.
ARIA: textbox role - Accessibility
aria does not alter the behavior of the element; rather this feature must be controlled by the developer.
Web applications and ARIA FAQ - Accessibility
another alternative is to use the html5 doctype, which includes built-in support for aria.
Accessibility and Spacial Patterns - Accessibility
iterature colour constancy in context: roles for local adaptation and levels of reference gamma oscillations and photosensitive epilepsy characterizing the patterned images that precipitate seizures and optimizing guidelines to prevent them arnold wilkins, john emmett, and graham harding contributers: heartfelt thanks to jim allan of the diagram center for his discussions on the topic of alternative means of education.
Architecture - Accessibility
(e) to grab a subtree of content: although under windows text content is still exposed in leaf nodes of role_text, it is no longer necessary to visit those nodes.
HTML To MSAA - Accessibility
mit" n/a "press" n/a caption bstr role n/a n/a n/a description_for (0x100f), points to table element div bstr role n/a n/a n/a n/a n/a n/a fieldset role_system_ grouping text equivalent from child legend element n/a n/a labelled_by (1003), points to legend element n/a n/a hr role_system_ separator n/a n/a n/a n/a n/a n/a img, input @type=image role_system_ graphic from @alt attribute, empty @alt attribute means name can't be calculated at all n/a state_system_ animated if image has more than one frame n/a "showlongdesc" if @longdesc attribute is presented n/a if @usemap attribute is used then image accessible has children for each map item input @type=button, submit, reset role_system_ pushbutton from @value attribute, @alt attribute, default label, @src attribute...
Mobile accessibility checklist - Accessibility
use alt and title where appropriate (see steve faulkner's post about using the html title attribute for a good guide.) if the above attributes are not applicable, use appropriate aria states and properties such as aria-label, aria-labelledby, or aria-describedby.
Accessibility
accessible multimedia another category of content that can create accessibility problems is multimedia — video, audio, and image content need to be given proper textual alternatives so they can be understood by assistive technologies and their users.
:-moz-broken - CSS: Cascading Style Sheets
syntax :-moz-broken examples html <img src="broken.jpg" alt="this image is broken.
:-moz-window-inactive - CSS: Cascading Style Sheets
syntax :-moz-window-inactive examples this example alters the appearance of a box's background depending on whether its window is active or not.
::-moz-range-thumb - CSS: Cascading Style Sheets
the user can move the thumb along the input's track to alter its numerical value.
::-webkit-slider-thumb - CSS: Cascading Style Sheets
the ::-webkit-slider-thumb css pseudo-element represents the "thumb" that the user can move within the "groove" of an <input> of type="range" to alter its numerical value.
::backdrop - CSS: Cascading Style Sheets
normally that area is black, but its appearance has been altered by the css above.
::first-letter (:first-letter) - CSS: Cascading Style Sheets
allowable properties only a small subset of css properties can be used with the ::first-letter pseudo-element: all font properties : font, font-style, font-feature-settings, font-kerning, font-language-override, font-stretch, font-synthesis, font-variant, font-variant-alternates, font-variant-caps, font-variant-east-asian, font-variant-ligatures, font-variant-numeric, font-variant-position, font-weight, font-size, font-size-adjust, line-height and font-family all background properties : background, background-color, background-image, background-clip, background-origin, background-position, background-repeat, background-size, background-attachment, and background-...
::first-line (:first-line) - CSS: Cascading Style Sheets
allowable properties only a small subset of css properties can be used with the ::first-line pseudo-element: all font-related properties: font, font-kerning, font-style, font-variant, font-variant-numeric, font-variant-position, font-variant-east-asian, font-variant-caps, font-variant-alternates, font-variant-ligatures, font-synthesis, font-feature-settings, font-language-override, font-weight, font-size, font-size-adjust, font-stretch, and font-family all background-related properties: background-color, background-clip, background-image, background-origin, background-position, background-repeat, background-size, background-attachment, and background-blend-mode the color proper...
::part() - CSS: Cascading Style Sheets
WebCSS::part
ustom-element::part(tab):hover:active { background-color: #0c0c0d33; } tabbed-custom-element::part(tab):focus { box-shadow: 0 0 0 1px #0a84ff inset, 0 0 0 1px #0a84ff, 0 0 0 4px rgba(10, 132, 255, 0.3); } tabbed-custom-element::part(active) { color: #0060df; border-color: #0a84ff !important; } javascript let template = document.queryselector("#tabbed-custom-element"); globalthis.customelements.define(template.id, class extends htmlelement { constructor() { super(); this.attachshadow({ mode: "open" }); this.shadowroot.appendchild(template.content); } }); result specifications specification status comment shadow partsthe definition of '::part' in that specification.
::placeholder - CSS: Cascading Style Sheets
an alternate approach to providing placeholder information is to include it outside of the input in close visual proximity, then use aria-describedby to programmatically associate the <input> with its hint.
:nth-child() - CSS: Cascading Style Sheets
this selects the same elements as a simple p selector (although with a higher specificity).
:placeholder-shown - CSS: Cascading Style Sheets
you can use the text-overflow property to alter the way overflowing text is displayed.
:visited - CSS: Cascading Style Sheets
WebCSS:visited
although these styles can be change the appearance of colors to the end user, the window.getcomputedstyle method will lie and always return the value of the non-:visited color.
:where() - CSS: Cascading Style Sheets
WebCSS:where
you can see the result below (although bear in mind that currently :is() and :where() are currently only enabled by default in firefox nightly, version 77+.
negative - CSS: Cascading Style Sheets
when defining custom counter styles, the negative descriptor lets you alter the representations of negative counter values, by providing a way to specify symbols to be appended or prepended to the counter representation when the value is negative.
system - CSS: Cascading Style Sheets
extends allows authors to use the algorithm of another counter style, but alter its other aspects.
@counter-style - CSS: Cascading Style Sheets
however, although more styles were added to this set of predefined styles over the years, this system proved too restrictive to fulfill the needs of worldwide typography.
font-weight - CSS: Cascading Style Sheets
in earlier versions of the font-weight specification, the property accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g.
any-pointer - CSS: Cascading Style Sheets
note: more than one value can match if the available devices have different characteristics, although none only matches when none of them are pointing devices.
forced-colors - CSS: Cascading Style Sheets
user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating system in use.
prefers-color-scheme - CSS: Cascading Style Sheets
alternately, users can create the numeric preference ui.systemusesdarktheme to override the default behavior and return light (value: 0), dark (value: 1), or no-preference (value: 2).
prefers-reduced-motion - CSS: Cascading Style Sheets
alternatively, add gtk-enable-animations = false to the [settings] block of the gtk 3 configuration file.
prefers-reduced-transparency - CSS: Cascading Style Sheets
user preferences currently no user agent implements this feature, although various operating systems do support such preferences and if this media query is ever implemented user agents will likely rely on the settings provided by the operating systems.
scan - CSS: Cascading Style Sheets
WebCSS@mediascan
interlace the device draws odd lines and even lines alternately.
update - CSS: Cascading Style Sheets
examples html <p>if this text animates for you, you are using a fast-updating device.</p> css @keyframes jiggle { from { transform: translatey(0); } to { transform: translatey(25px); } } @media (update: fast) { p { animation: 1s jiggle linear alternate infinite; } } result specifications specification status comment media queries level 4the definition of 'update' in that specification.
@supports - CSS: Cascading Style Sheets
WebCSS@supports
pports ((perspective: 10px) or (-moz-perspective: 10px) or (-webkit-perspective: 10px) or (-ms-perspective: 10px) or (-o-perspective: 10px)) { … /* css applied when 3d transforms, prefixed or not, are supported */ } testing for the non-support of a specific css property @supports not ((text-align-last: justify) or (-moz-text-align-last: justify)) { … /* css to provide fallback alternative for text-align-last: justify */ } testing for the support of custom properties @supports (--foo: green) { body { color: var(--varname); } } testing for the support of a selector (eg.
orientation - CSS: Cascading Style Sheets
syntax values auto the user agent will set the document's orientation automatically, typically based on the device's orientation as determined by an accelerometer (if the device has such a hardware sensor), although there is often a user-controlled, os-level "lock orientation" setting that will trump the accelerometer reading.
At-rules - CSS: Cascading Style Sheets
WebCSSAt-rule
(at the candidate recommendation stage, but only implemented in gecko as of writing) @font-feature-values (plus @swash, @ornaments, @annotation, @stylistic, @styleset and @character-variant) — define common names in font-variant-alternates for feature activated differently in opentype.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
this means you should not rely on animation-direction: alternate.
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
this default behavior can be altered with the background-clip css property.
Using feature queries - CSS: Cascading Style Sheets
an alternate way to write the above code is to wrap all of the grid code in a feature query as follows.
CSS Containment - CSS: Cascading Style Sheets
if we give each <article> the contain property with a value of content, when new elements are inserted the browser understands it does not need to relayout or repaint any area outside of the containing element's subtree, although if the <article> is styled such that its size depends on its contents (e.g.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
with all the flex tools at your disposal you will find that most tasks can be achieved, although it might take a little bit of experimentation at first.
Flow Layout and Overflow - CSS: Cascading Style Sheets
block-axis overflow there is also a proposal for a block-overflow property, although at the time of writing the name is still up for discussion.
Variable fonts guide - CSS: Cascading Style Sheets
note the hover effect on the h2, which only alters the grade axis custom property value.
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
reference properties font font-family font-feature-settings font-kerning font-language-override font-optical-sizing font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-variation-settings font-weight line-height at-rules @font-face font-family font-feature-settings font-style font-variant font-weight font-stretch src unicode-range @font-feature-values guides fundamental text and font styling in t...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
adrian roselli has also posted regarding tab order in various browsers – although this was prior to grid support being fully implemented in firefox.
Grid template areas - CSS: Cascading Style Sheets
however, there is an alternate method to use for positioning items on the grid which you can use alone or in combination with line-based placement.
Layout using named grid lines - CSS: Cascading Style Sheets
then defined the centre block of the grid as content-start and content-end again, both for columns and rows although you do not need to name all of the lines on your grid.
Subgrid - CSS: Cascading Style Sheets
if we remove the grid-template-rows value we enable regular creation of implicit tracks and, although these won't line up with the tracks of the parent, as many as are required will be created.
CSS Motion Path - CSS: Cascading Style Sheets
basic example <div id="motion-demo"></div> #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } reference properties offset offset-anchor offset-distance offset-path offset-position offset-rotate specifications specification status comment motion path module level 1 working dra...
CSS Overflow - CSS: Cascading Style Sheets
basic example the following interactive example shows how changing the value of the overflow property, changes how the overflow of a fixed height box is dealt with.
Stacking without the z-index property - CSS: Cascading Style Sheets
when the z-index property is not specified on any element, elements are stacked in the following order (from bottom to top): the background and borders of the root element descendant non-positioned blocks, in order of appearance in the html descendant positioned elements, in order of appearance in the html keep in mind, when the order property alters rendering from the "order of appearance in the html" within flex containers, it similarly affects the order for stacking context.
Using CSS transforms - CSS: Cascading Style Sheets
examples here is an unaltered image of the mdn logo: rotating here is the mdn logo rotated 90 degrees from its bottom-left corner.
Comments - CSS: Cascading Style Sheets
WebCSSComments
however, when using the <style> element, you may use <!-- --> to hide css from older browsers, although this is not recommended.
Layout and the containing block - CSS: Cascading Style Sheets
some examples the html code for all our examples is: <body> <section> <p>this is a paragraph!</p> </section> </body> only the css is altered in each instance below.
Cookbook template - CSS: Cascading Style Sheets
useful fallbacks or alternative methods if there are useful alternative methods for building the recipe, or fallback recipes to use if you have to support non-supporting browsers, include them in separate sections down here.
Pagination - CSS: Cascading Style Sheets
alternative methods once the column-gap property has implementation in browsers this could be used instead of margins to space out the items.
Sticky footers - CSS: Cascading Style Sheets
alternate method if you need compatibility with browsers that do not support grid layout you can also use flexbox to create a sticky footer.
Using media queries - CSS: Cascading Style Sheets
although websites are commonly designed with screens in mind, you may want to create styles that target special devices such as printers or audio-based screenreaders.
Mozilla CSS extensions - CSS: Cascading Style Sheets
aemo-classic -moz-device-pixel-ratio -moz-os-version -moz-scrollbar-end-backward -moz-scrollbar-end-forward -moz-scrollbar-start-backward -moz-scrollbar-start-forward -moz-scrollbar-thumb-proportional -moz-touch-enabled -moz-windows-accent-color-in-titlebar -moz-windows-classic -moz-windows-compositor -moz-windows-default-theme -moz-windows-glass -moz-windows-theme other -moz-alt-content (see bug 11011) ...
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
sflex-directionflex-flowflex-growflex-shrinkflex-wrapfloat:focusfont@font-facefont-familyfont-family (@font-face)font-feature-settingsfont-feature-settings (@font-face)@font-feature-valuesfont-kerningfont-language-overridefont-optical-sizingfont-sizefont-size-adjustfont-stretchfont-stretch (@font-face)font-stylefont-style (@font-face)font-synthesisfont-variantfont-variant (@font-face)font-variant-alternatesfont-variant-capsfont-variant-east-asianfont-variant-ligaturesfont-variant-numericfont-variant-positionfont-variation-settingsfont-variation-settings (@font-face)font-weightfont-weight (@font-face)format()fr<frequency><frequency-percentage>:fullscreenggapgrad<gradient>grayscale()gridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid...
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
the 1:1 aspect ratio has been preserved, although with this source image, that can be difficult to see.
WebKit CSS extensions - CSS: Cascading Style Sheets
-webkit-alt* -webkit-color-correction -webkit-flow-from -webkit-flow-into -webkit-grid-columns (see grid-column) -webkit-grid-rows (see grid-row) -webkit-hyphenate-charset -webkit-image-set (see image-set()) -webkit-mask-attachment -webkit-match-nearest-mail-blockquote-color -webkit-overflow-scrolling -webkit-region-break-after -webkit-region-break-before -webkit-region-break-inside -webkit-reg...
background-color - CSS: Cascading Style Sheets
it is rendered behind any background-image that is specified, although the color will still be visible through any transparency in the image.
<basic-shape> - CSS: Cascading Style Sheets
html <div></div> css div { width: 300px; height: 300px; background: repeating-linear-gradient(red, orange 50px); clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%); animation: 4s poly infinite alternate ease-in-out; margin: 10px auto; } @keyframes poly { from { clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%); } to { clip-path: polygon(50% 30%, 100% 0%, 70% 50%, 100% 100%, 50% 70%, 0% 100%, 30% 50%, 0% 0%); } } result specifications specification status comment css shapes module level 1the defini...
border-image - CSS: Cascading Style Sheets
indeed, this is required according to the specification, although not all browsers implement this requirement.
box-sizing - CSS: Cascading Style Sheets
formal definition initial valuecontent-boxapplies toall elements that accept width or heightinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box examples box sizes with content-box and border-box this example shows how different box-sizing values alter the rendered size of two otherwise identical elements.
caret-color - CSS: Cascading Style Sheets
by default, it is black, but its color can be altered with this property.
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
th: 0; height: 0; margin: 0; } pre { margin-bottom: 0; } svg { margin: 1em; font-family: sans-serif; width: 192px; height: 192px; } svg rect { stroke: pink; stroke-width: 16px; } svg text { fill: pink; text-anchor: middle; } svg text.em { font-style: italic; } complete example html <img id="clipped" src="https://udn.realityripple.com/samples/db/4f9fbd7dfb.svg" alt="mdn logo"> <svg height="0" width="0"> <defs> <clippath id="cross"> <rect y="110" x="137" width="90" height="90"/> <rect x="0" y="110" width="90" height="90"/> <rect x="137" y="0" width="90" height="90"/> <rect x="0" y="0" width="90" height="90"/> </clippath> </defs> </svg> <select id="clippath"> <option value="none">none</option> <option value="circle(100...
cursor - CSS: Cascading Style Sheets
WebCSScursor
zoom-out usage notes although the specification does not define any size limitations for cursor, individual user agents may choose to do so.
<easing-function> - CSS: Cascading Style Sheets
steps(3, start)</option> <option>steps(4)</option> </select> </li> </ul> css body > div { position: relative; height: 100px; } div > div { position: absolute; width: 50px; height: 50px; background-color: blue; background-image: radial-gradient(circle at 10px 10px, rgba(25,255,255,0.8),rgba(25,255,255,0.4)); border-radius: 50%; top: 25px; animation: 1.5s infinite alternate; } @keyframes move-right { from { left: 10%; } to { left: 90%; } } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } javascript const selectelem = document.queryselector('select'); const startbtn = document.queryselector('button'); const divelem = document.queryselector('div > div'); startbtn.addeventlistener('click', () =...
font-family - CSS: Cascading Style Sheets
values are separated by commas to indicate that they are alternatives.
font-weight - CSS: Cascading Style Sheets
in earlier versions of the font-weight specification, the property accepts only keyword values and the numeric values 100, 200, 300, 400, 500, 600, 700, 800, and 900; non-variable fonts can only really make use of these set values, although fine-grained values (e.g.
font - CSS: Cascading Style Sheets
WebCSSfont
alternatively, it sets an element's font to a system font.
<frequency-percentage> - CSS: Cascading Style Sheets
0 although unitless zero is an allowable <length>, it's an invalid <frequency>.
image-orientation - CSS: Cascading Style Sheets
flip ] examples orienting image from image data css #image { image-orientation: from-image; /* can be changed in the live sample */ } html <img id="image" src="https://udn.realityripple.com/samples/db/4f9fbd7dfb.svg" alt="orientation taken from the image"> <select id="imageorientation"> <option value="from-image">from-image</option> <option value="none">none</option> </select> javascript var imageorientation = document.getelementbyid("imageorientation"); imageorientation.addeventlistener("change", function (evt) { document.getelementbyid("image").style.imageorientation = evt.target.value; }); result ...
image-rendering - CSS: Cascading Style Sheets
<div> <img class="auto" alt="auto" src="https://udn.realityripple.com/samples/de/cedd397be3.jpg" /> <img class="pixelated" alt="pixelated" src="https://udn.realityripple.com/samples/de/cedd397be3.jpg" /> <img class="crisp-edges" alt="crisp-edges" src="https://udn.realityripple.com/samples/de/cedd397be3.jpg" /> </div> img { height: 200px; } css .auto { image-rendering: auto; } .pixelated { -ms-interpolatio...
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
examples background-image: image-set( "cat.png" 1x, "cat-2x.png" 2x, "cat-print.png" 600dpi); this example shows how to use image-set() to provide two alternative background-image options, chosen depending on the resolution needed: a normal version and a high-resolution version.
<length> - CSS: Cascading Style Sheets
WebCSSlength
note: although <percentage> values are also css dimensions, and are usable in some of the same properties that accept <length> values, they are not themselves <length> values.
letter-spacing - CSS: Cascading Style Sheets
unlike a value of 0, this keyword allows the user agent to alter the space between characters in order to justify text.
max-block-size - CSS: Cascading Style Sheets
any time you would normally use max-height or max-width, you should instead use max-block-size to set the maximum "height" of the content (even though this may not be a vertical value) and max-inline-size to set the maximum "width" of the content (although this may instead be vertical rather than horizontal).
object-position - CSS: Cascading Style Sheets
<img id="object-position-1" src="https://udn.realityripple.com/samples/db/4f9fbd7dfb.svg" alt="mdn logo"/> <img id="object-position-2" src="https://udn.realityripple.com/samples/db/4f9fbd7dfb.svg" alt="mdn logo"/> css the css includes default styling for the <img> element itself, as well as separate styles for each of the two images.
offset-anchor - CSS: Cascading Style Sheets
html <section> <div class="offset-anchor1"></div> </section> <section> <div class="offset-anchor2"></div> </section> <section> <div class="offset-anchor3"></div> </section> css div { offset-path: path('m 0,20 l 200,20'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; } section { background-image: linear-gradient(to bottom, transparent, transparent 49%, #000 50%, #000 51%, transparent 52%); border: 1px solid #ccc; margin-bottom: 10px; } .offset-anchor1 { offset-anchor: auto; background: cyan; } .offset-anchor2 { offset-anchor: right top; background: purple; } .offset-anchor3 { offset-anchor:...
offset-distance - CSS: Cascading Style Sheets
html <div id="motion-demo"></div> css #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the definition of 'offset-distance' in that specification.
offset-position - CSS: Cascading Style Sheets
| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting initial offset position <div id="motion-demo"></div> #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); offset-position: left top; animation: move 3000ms infinite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } specifications specification status comment motion path module level 1the definition of 'offset-position' in that specification.
offset-rotate - CSS: Cascading Style Sheets
pecifiedanimation typeas <angle>, <basic-shape> or <path()> formal syntax [ auto | reverse ] | <angle> examples setting element orientation along its offset path html <div></div> <div></div> <div></div> css div { width: 40px; height: 40px; background: #2bc4a2; margin: 20px; clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%); animation: move 5000ms infinite alternate ease-in-out; offset-path: path('m20,20 c20,50 180,-10 180,20'); } div:nth-child(1) { offset-rotate: auto; } div:nth-child(2) { offset-rotate: auto 90deg; } div:nth-child(3) { offset-rotate: 30deg; } @keyframes move { 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the definition...
opacity - CSS: Cascading Style Sheets
WebCSSopacity
sy to see.</div> css div { background-color: yellow; } .light { opacity: 0.2; /* barely see the text over the background */ } .medium { opacity: 0.5; /* see the text more clearly over the background */ } .heavy { opacity: 0.9; /* see the text very clearly over the background */ } result setting opacity on hover html <img src="//developer.mozilla.org/static/img/opengraph-logo.png" alt="mdn logo" width="128" height="146" class="opacity"> css img.opacity { opacity: 1; filter: alpha(opacity=100); /* ie8 and lower */ zoom: 1; /* triggers "haslayout" in ie 7 and lower */ } img.opacity:hover { opacity: 0.5; filter: alpha(opacity=50); zoom: 1; } result specifications specification status comment css color module level 4the definitio...
outline-color - CSS: Cascading Style Sheets
the border, on the other hand, will actually alter the page's layout to ensure that it fits without overlapping anything else (unless you explicitly set it to overlap).
outline - CSS: Cascading Style Sheets
WebCSSoutline
according to the spec, outlines don't have to be rectangular, although they usually are.
<percentage> - CSS: Cascading Style Sheets
optionally, it may be preceded by a single + or - sign, although negative values are not valid for all properties.
repeating-linear-gradient() - CSS: Cascading Style Sheets
this can be altered with repeating the first color again as the last color.
<resolution> - CSS: Cascading Style Sheets
note: although the number 0 is always the same regardless of unit, the unit may not be omitted.
revert - CSS: Cascading Style Sheets
WebCSSrevert
examples revert vs unset although revert and unset are similar they differ for some properties for some elements.
symbols() - CSS: Cascading Style Sheets
WebCSSsymbols
although less powerful, it is shorter and easier to write than @counter-style.
text-decoration-line - CSS: Cascading Style Sheets
blink the text blinks (alternates between visible and invisible).
text-justify - CSS: Cascading Style Sheets
this has the same effect as not setting text-align at all, although it is useful if you need to turn justification on and off for some reason.
text-shadow - CSS: Cascading Style Sheets
if both values are 0, the shadow is placed directly behind the text, although it may be partly visible due to the effect of <blur-radius>.
transform-box - CSS: Cascading Style Sheets
svg{ width:80vh; border:1px solid #d9d9d9; position:absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; } #box{ transform-origin:50% 50%; /*+++++++++++++++++++++++++++*/ /* if i remove this rule the pen won't work properly on chrome for mac, ff, safari will still work properly on chrome for pc & opera*/ transform-box: fill-box; /*alternatively i can use transform-origin:15px 15px;*/ /*+++++++++++++++++++++++++++*/ animation: rotatebox 3s linear infinite; } @keyframes rotatebox { to { transform: rotate(360deg); } full credit for this example goes to pogany; see this codepen for a live version.
matrix3d() - CSS: Cascading Style Sheets
ht: 100vh; /* centering content */ display: flex; flex-flow: row wrap; justify-content: center; align-content: center; } .foo { width: 50%; padding: 1em; color: white; background: #ff8c66; border: 2px dashed black; text-align: center; font-family: system-ui, sans-serif; font-size: 14px; /* setting up animation for better demonstration */ animation: motionscale 2s alternate linear infinite; } @keyframes motionscale { from { /* identity matrix is used as basis here.
translateZ() - CSS: Cascading Style Sheets
the second is altered by applying perspective to create a 3d space, then moved towards the user.
transform-style - CSS: Cascading Style Sheets
in this alternative state, the cube faces are all flattened onto the plane of their parent, and you might not be able to see them at all, depending on the browser you are using.
url() - CSS: Cascading Style Sheets
WebCSSurl()
<url-modifier> in the future, the url() function may support specifying a modifier, an identifier or a functional notation, which alters the meaning of the url string.this is not supported and not fully defined in the specification.
visibility - CSS: Cascading Style Sheets
for xul elements, the computed size of the element is always zero, regardless of other styles that would normally affect the size, although margins still take effect.
Getting Started - Developer guides
alternatively, instead of giving a function name, you can use the javascript technique of defining functions on the fly (called "anonymous functions") to define the actions that will process the response, like this: httprequest.onreadystatechange = function(){ // process the server response here.
Ajax - Developer guides
WebGuideAJAX
although x in ajax stands for xml, json is used more than xml nowadays because of its many advantages such as being lighter and a part of javascript.
Adding captions and subtitles to HTML5 video - Developer guides
browser compatibility browser support for webvtt and the <track> element is fairly good, although some browsers differ slightly in their implementation.
Web Audio playbackRate explained - Developer guides
the pitch of the audio track does not change when playbackrate is altered.
Media buffering, seeking, and time ranges - Developer guides
in practice a good way to do this is use the seekable attribute, although as we have seen above seekable parts of the media are not neccessarily contiguous — they often are however and we can safely approximate this information to give the user an indication of which parts of the media can be played directly.
Challenge solutions - Developer guides
solution the following rule achieves this effect: ul { border: 10px solid lightblue; width: 100px; } layout default image position fixed image position challenge change your sample document, doc2.html, adding this tag to it near the end, just before </body>: <img id="fixed-pin" src="yellow-pin.png" alt="yellow map pin"> predict where the image will appear in your document.
Mutation events - Developer guides
mutation events list the following is a list of all mutation events, as defined in dom level 3 events specification: domattrmodified domattributenamechanged domcharacterdatamodified domelementnamechanged domnodeinserted domnodeinsertedintodocument domnoderemoved domnoderemovedfromdocument domsubtreemodified mutation observers alternatives examples domnoderemovedfromdocument var isdescendant = function (desc, root) { return !!desc && (desc === root || isdescendant(desc.parentnode, root)); }; var onremove = function (element, callback) { var observer = new mutationobserver(function (mutations) { _.foreach(mutations, function (mutation) { _.foreach(mutation.removednodes, function (removed) { ...
Touch events (Mozilla experimental) - Developer guides
although touch events were based on — and work similarly to — mouse events, each event included an identifier that allowed you to track multiple fingers moving on the screen at the same time.
Writing forward-compatible websites - Developer guides
there is a good chance of browsers changing behavior to converge with each other and hence breaking the site for those you've sent down one or more of the alternative paths.
Block-level elements - HTML: Hypertext Markup Language
elements the following is a complete list of all html "block-level" elements (although "block-level" is not technically defined for elements that are new in html5).
Date and time formats used in HTML - HTML: Hypertext Markup Language
although the calendar year is normally 365 days long, it actually takes the planet earth approximately 365.2422 days to complete a single orbit around the sun.
<address>: The Contact Address element - HTML: Hypertext Markup Language
WebHTMLElementaddress
<address> you can contact author at <a href="http://www.somedomain.com/contact"> www.somedomain.com</a>.<br> if you see any bugs, please <a href="mailto:webmaster@somedomain.com"> contact webmaster</a>.<br> you may also want to visit us:<br> mozilla foundation<br> 331 e evelyn ave<br> mountain view, ca 94041<br> usa </address> result although it renders text with the same default styling as the <i> or <em> elements, it is more appropriate to use <address> when dealing with contact information, as it conveys additional semantic information.
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
note: even though it's an <audio> element, it still has video and text track lists, and can in fact be used to present video, although the use interface implications can be odd.
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
<blockquote cite="https://tools.ietf.org/html/rfc1149"> <p>avian carriers can provide high delay, low throughput, and low altitude service.
<caption>: The Table Caption element - HTML: Hypertext Markup Language
WebHTMLElementcaption
tion</caption> <tr> <th>login</th> <th>email</th> </tr> <tr> <td>user1</td> <td>user1@sample.com</td> </tr> <tr> <td>user2</td> <td>user2@sample.com</td> </tr> </table> caption { caption-side: top; align: right; } table { border-collapse: collapse; border-spacing: 0px; } table, th, td { border: 1px solid black; } table {background: red;} do not alter caption.
<command>: The HTML Command element - HTML: Hypertext Markup Language
WebHTMLElementcommand
you should use the <menuitem> element instead, although that element is non-standard and only supported in edge and firefox.
<dl>: The Description List element - HTML: Hypertext Markup Language
WebHTMLElementdl
although it works, this is a bad practice and obscures the meaning of description lists.
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
use the <i> element to mark text that is in an alternate tone or mood, which covers many common situations for italics such as scientific names or words in other languages.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
WebHTMLElementfigure
examples images <!-- just an image --> <figure> <img src="https://udn.realityripple.com/samples/6c/98485e5d8a.png" alt="the beautiful mdn logo."> </figure> <!-- image with a caption --> <figure> <img src="https://udn.realityripple.com/samples/6c/98485e5d8a.png" alt="the beautiful mdn logo."> <figcaption>mdn logo</figcaption> </figure> code snippets <figure> <figcaption>get browser details using <code>navigator</code>.</figcaption> <pre> function navigatorexample() { var txt; txt = "browser c...
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
WebHTMLElementi
among the use cases for the <i> element are spans of text representing a different quality or mode of text, such as: alternative voice or mood taxonomic designations (such as the genus and species "homo sapiens") idiomatic terms from another language (such as "et cetera"); these should include the lang attribute to identify the language technical terms transliterations thoughts (such as "she wondered,what is this writer talking about, anyway?") ship or vessel names in western writing systems (such...
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
however, even though it has relatively broad support, it is still not standard and should not be used unless you have no alternative.
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
this specifically can't be edited or seen by the user via the user interface, although you could edit the value via browser developer tools.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
in browsers that don't support month inputs, the control degrades gracefully to a simple <input type="text">, although there may be automatic validation of the entered text to ensure it's formatted as expected.
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
<label for="userpassword">password: </label> <input id="userpassword" type="password" required> <input type="submit" value="submit"> specifying an input mode if your recommended (or required) password syntax rules would benefit from an alternate text entry interface than the standard keyboard, you can use the inputmode attribute to request a specific one.
<input type="reset"> - HTML: Hypertext Markup Language
WebHTMLElementinputreset
adding a tooltip to the button (using the title attribute) can also help, although it's not a complete solution for accessibility purposes.
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
using time inputs although among the date and time input types time has the widest browser support, it is not yet approaching universal, so it is likely that you'll need to provide an alternative method for entering the date and time, so that safari users (and users of other non-supporting browsers) can still easily enter time values.
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
alternatively, you can nest the <input> directly inside the <label>, in which case the for and id attributes are not needed because the association is implicit: <label>do you like peas?
<map> - HTML: Hypertext Markup Language
WebHTMLElementmap
examples <map name="primary"> <area shape="circle" coords="75,75,75" href="left.html"> <area shape="circle" coords="275,75,75" href="right.html"> </map> <img usemap="#primary" src="https://udn.realityripple.com/samples/6a/7e559101b3.png" alt="350 x 150 pic"> result expected live example output the live example above should appear similar to the following images (when using your keyboard tab key): for the left.html link: for the right.html link specifications specification status comment html living standardthe definition of '<map>' in that specification.
<mark>: The Mark Text element - HTML: Hypertext Markup Language
WebHTMLElementmark
although the death star has been destroyed, <mark class="match">imperial</mark> troops have driven the rebel forces from their hidden base and pursued them across the galaxy.</p> <p>evading the dreaded <mark class="match">imperial</mark> starfleet, a group of freedom fighters led by luke skywalker has established a new secret base on the remote ice world of hoth.</p> to help distinguish the use of ...
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
permitted content if the element is in the list menu state: flow content, or alternatively, zero or more occurrences of <li>, <script>, and <template>.
<menuitem> - HTML: Hypertext Markup Language
WebHTMLElementmenuitem
a command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element.
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnextid
this is the default and includes and permits all html level 2 functions and elements and attributes html version 2 strict level 2 this excludes these depreciated elements and also forbids such constructs as nesting a header (<h*> element) within a link (<a> element), or having a forms <input> element which is not within a block level element such as <p> html version 3.2 <nextid> has vanished altogether, never to be heard from again.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
the <ol> and <ul> elements may nest as deeply as desired, alternating between <ol> and <ul> however you like.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
alternate separation methods, such as first-line indentation, can be achieved with css: html <p>separating paragraphs with blank lines is easiest for readers to scan, but they can also be separated by indenting their first lines.
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
src this attribute specifies the uri of an external script; this can be used as an alternative to embedding a script directly within a document.
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
<picture> <source srcset="mdn-logo-wide.png" media="(min-width: 800px)"> <source srcset="mdn-logo-medium.png" media="(min-width: 600px)"> <img src="mdn-logo-narrow.png" alt="mdn web docs"> </picture> with the <picture> element, you must always include an <img> with a fallback image, with an alt attribute to ensure accessibility (unless the image is an irrelevant background decorative image).
<strike> - HTML: Hypertext Markup Language
WebHTMLElementstrike
although it may still work in some browsers, its use is discouraged since it could be removed at any time.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
WebHTMLElementstrong
it may help to realize that both are valid and semantic elements in html5 and that it's a coincidence that they both have the same default styling (boldface) in most browsers (although some older browsers actually underline <strong>).
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
title this attribute specifies alternative style sheet sets.
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
alternatively, you can put the abbreviated description inside the cell and place the long content in the title attribute.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
controlling whether a textarea is resizable in most browsers, <textarea>s are resizable — you'll notice the drag handle in the right hand corner, which can be used to alter the size of the element on the page.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
although this element wasn't officially deprecated in html 4.01, its use was discouraged in favor of the semantic elements and/or css.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
this is rendered by default as a simple solid underline, but may be altered using css.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
moreover, the nested lists may alternate between <ol> and <ul> without restriction.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
it's typically presented using an italicized version of the current typeface, although that behavior is browser-dependent.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
to remove autoplay, the attribute needs to be removed altogether.
class - HTML: Hypertext Markup Language
for example, attribute to describe an attribute rather than italics, although an element of this class may be presented by italics.
contenteditable - HTML: Hypertext Markup Language
note that although its allowed values include true and false, this attribute is an enumerated one and not a boolean one.
id - HTML: Hypertext Markup Language
this attribute's value is an opaque string: this means that web authors should not rely on it to convey human-readable information (although having your ids somewhat human-readable can be useful for code comprehension, e.g.
itemtype - HTML: Hypertext Markup Language
g product itemprop name executive anvil itemprop brand [thing] itemprop name acme example html <div itemscope itemtype="http://schema.org/product"> <span itemprop="brand">acme<br></span> <span itemprop="name">executive anvil<br></span> <img itemprop="image" src="https://udn.realityripple.com/samples/61/fa8ee62aba.png" width="50" height="50" alt="executive anvil logo" /><br> <span itemprop="description">sleeker than acme's classic anvil, the executive anvil is perfect for the business traveler looking for something to drop from a height.
translate - HTML: Hypertext Markup Language
although not all browsers recognize this attribute, it is respected by automatic translation systems such as google translate, and may also be respected by tools used by human translators.
Microdata - HTML: Hypertext Markup Language
commonly used vocabularies: creative works: creativework, book, movie, musicrecording, recipe, tvseries embedded non-text objects: audioobject, imageobject, videoobject event health and medical types: notes on the health and medical types under medicalentity organization person place, localbusiness, restaurant product, offer, aggregateoffer review, aggregaterating action thing intangible major search engine operators like google, microsoft, and yahoo!
Basics of HTTP - HTTP
separating identity and location of a resource: the alt-svc http header most of the time the identity and location of a web resource are shared, this can be changed with the alt-svc header.
Reason: CORS request did not succeed - HTTP
as of firefox 68, https pages are not permitted to access http://localhost, although this may be changed by bug 1488740.
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
01:34:52 gmt server: apache/2 access-control-allow-origin: https://foo.example access-control-allow-credentials: true cache-control: no-cache pragma: no-cache set-cookie: pageaccess=3; expires=wed, 31-dec-2008 01:34:53 gmt vary: accept-encoding, origin content-encoding: gzip content-length: 106 keep-alive: timeout=2, max=100 connection: keep-alive content-type: text/plain [text/plain payload] although line 10 contains the cookie destined for the content on http://bar.other, if bar.other did not respond with an access-control-allow-credentials: true (line 17) the response would be ignored and not made available to web content.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
(sometimes you may see mentions of the x-content-security-policy header, but that's an older version and you don't need to specify it anymore.) alternatively, the <meta> element can be used to configure a policy, for example: <meta http-equiv="content-security-policy" content="default-src 'self'; img-src https://*; child-src 'none';"> threats mitigating cross site scripting a primary goal of csp is to mitigate and report xss attacks.
HTTP caching - HTTP
WebHTTPCaching
cache-control: must-revalidate the pragma header pragma is a http/1.0 header, it is not specified for http responses and is therefore not a reliable replacement for the general http/1.1 cache-control header, although it does behave the same as cache-control: no-cache, if the cache-control header field is omitted in a request.
HTTP conditional requests - HTTP
although there is a response/request round-trip that consumes some resources, this is more efficient than to transmit the whole resource over the wire again.
Using HTTP cookies - HTTP
WebHTTPCookies
depending on the application, it may be desirable to use an opaque identifier which is looked-up by the server or to investigate alternative authentication/confidentiality mechanisms such as json web tokens.
Access-Control-Allow-Headers - HTTP
access-control-allow-headers: x-custom-header, upgrade-insecure-requests bypassing additional restrictions although cors-safelisted request headers are always allowed and don't usually need to be listed in access-control-allow-headers, listing them anyway will circumvent the additional restrictions that apply.
Cache-Control - HTTP
although other directives may be set, this alone is the only directive you need in preventing cached responses on modern browsers.
Content-Location - HTTP
the content-location header indicates an alternate location for the returned data.
CSP: img-src - HTTP
examples violation cases given this csp header: content-security-policy: img-src https://example.com/ the following <img> is blocked and won't load: <img src="https://not-example.com/foo.jpg" alt="example picture"> specifications specification status comment content security policy level 3the definition of 'img-src' in that specification.
CSP: script-src - HTTP
rity-policy: script-src 'unsafe-inline'; the above content security policy will allow inline <script> elements <script> var inline = 1; </script> you can use a nonce-source to only allow specific inline script blocks: content-security-policy: script-src 'nonce-2726c7f26c' you will have to set the same nonce on the <script> element: <script nonce="2726c7f26c"> var inline = 1; </script> alternatively, you can create hashes from your inline scripts.
CSP: style-src - HTTP
lement, and the style attribute on any element: <style> #inline-style { background: red; } </style> <div style="display:none">foo</div> you can use a nonce-source to only allow specific inline style blocks: content-security-policy: style-src 'nonce-2726c7f26c' you will have to set the same nonce on the <style> element: <style nonce="2726c7f26c"> #inline-style { background: red; } </style> alternatively, you can create hashes from your inline styles.
Pragma - HTTP
WebHTTPHeadersPragma
note: pragma is not specified for http responses and is therefore not a reliable replacement for the general http/1.1 cache-control header, although it does behave the same as cache-control: no-cache, if the cache-control header field is omitted in a request.
Referer - HTTP
WebHTTPHeadersReferer
important: although this header has many innocent uses it can have undesirable consequences for user security and privacy.
Referrer-Policy - HTTP
for example, you can set the referrer policy for the entire document with a <meta> element with a name of referrer: <meta name="referrer" content="origin"> or set it for individual requests with the referrerpolicy attribute on <a>, <area>, <img>, <iframe>, <script>, or <link> elements: <a href="http://example.com" referrerpolicy="origin"> alternatively, a noreferrer link relation on an a, area, or link element can be set: <a href="http://example.com" rel="noreferrer"> integration with css css can fetch resources referenced from stylesheets.
Save-Data - HTTP
a value of on indicates explicit user opt-in into a reduced data usage mode on the client, and when communicated to origins allows them to deliver alternative content to reduce the data downloaded such as smaller image and video resources, different markup and styling, disabled polling and automatic updates, and so on.
Firefox user agent string reference - HTTP
irefox os form factor gecko user agent string phone mozilla/5.0 (mobile; rv:26.0) gecko/26.0 firefox/26.0 tablet mozilla/5.0 (tablet; rv:26.0) gecko/26.0 firefox/26.0 tv mozilla/5.0 (tv; rv:44.0) gecko/44.0 firefox/44.0 device-specific mozilla/5.0 (mobile; nnnn; rv:26.0) gecko/26.0 firefox/26.0 device-specific user agent strings although it is strongly discouraged by mozilla, some handset manufacturers unfortunately include a token in their device's ua string that represents their device id.
X-XSS-Protection - HTTP
although these protections are largely unnecessary in modern browsers when sites implement a strong content-security-policy that disables the use of inline javascript ('unsafe-inline'), they can still provide protections for users of older web browsers that don't yet support csp.
Link prefetching FAQ - HTTP
some more examples follow: <link rel="prefetch alternate stylesheet" title="designed for mozilla" href="mozspecific.css"> <link rel="next" href="2.html"> are anchor (<a>) tags prefetched?
HTTP Messages - HTTP
WebHTTPMessages
the http/2 binary framing mechanism has been designed to not require any alteration of the apis or config files applied: it is broadly transparent to the user.
PATCH - HTTP
WebHTTPMethodsPATCH
a patch is not necessarily idempotent, although it can be.
HTTP request methods - HTTP
WebHTTPMethods
although they can also be nouns, these request methods are sometimes referred to as http verbs.
Proxy servers and tunneling - HTTP
a common way to disclose this information is by using the following http headers: the standardized header: forwarded contains information from the client-facing side of proxy servers that is altered or lost when a proxy is involved in the path of the request.
HTTP resources and specifications - HTTP
proposed standard rfc 2817 upgrading to tls within http/1.1 proposed standard rfc 7540 hypertext transfer protocol version 2 (http/2) proposed standard rfc 7541 hpack: header compression for http/2 on the standard track rfc 7838 http alternative services on the standard track rfc 7301 transport layer security (tls) application-layer protocol negotiation extension used to negotiate http/2 at the transport to save an extra request/response round trip.
301 Moved Permanently - HTTP
WebHTTPStatus301
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there.
302 Found - HTTP
WebHTTPStatus302
even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents conform here - you can still find this type of bugged software out there.
308 Permanent Redirect - HTTP
WebHTTPStatus308
the request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method.
HTTP response status codes - HTTP
WebHTTPStatus
401 unauthorized although the http standard specifies "unauthorized", semantically this response means "unauthenticated".
HTTP
WebHTTP
rudp — the reliable update of udp — is a suitable alternative.
A re-introduction to JavaScript (JS tutorial) - JavaScript
alternatively, such values can be called "truthy" and "falsy", respectively.
About JavaScript - JavaScript
the chakra engine used in internet explorer (although the language it implements is formally called "jscript" in order to avoid trademark issues).
Closures - JavaScript
another alternative could be to use foreach() to iterate over the helptext array and attach a listener to each <p>, as shown: function showhelp(help) { document.getelementbyid('help').innerhtml = help; } function setuphelp() { var helptext = [ {'id': 'email', 'help': 'your e-mail address'}, {'id': 'name', 'help': 'your full name'}, {'id': 'age', 'help': 'your age (you must be over 16)...
Equality comparisons and sameness - JavaScript
(alternatively, someone might say that double equals is the baseline, and triple equals is an enhanced version, because it requires the two operands to be the same type, so it adds an extra constraint.
Expressions and operators - JavaScript
it is thus the better alternative to provide defaults, when values like '' or 0 are valid values for the first expression, too.
Iterators and generators - JavaScript
generator functions provide a powerful alternative: they allow you to define an iterative algorithm by writing a single function whose execution is not continuous.
Loops and iteration - JavaScript
function dump_props(obj, obj_name) { let result = ''; for (let i in obj) { result += obj_name + '.' + i + ' = ' + obj[i] + '<br>'; } result += '<hr>'; return result; } for an object car with properties make and model, result would be: car.make = ford car.model = mustang arrays although it may be tempting to use this as a way to iterate over array elements, the for...in statement will return the name of your user-defined properties in addition to the numeric indexes.
JavaScript modules - JavaScript
the following is found in main.js, below the import lines: let mycanvas = create('mycanvas', document.body, 480, 320); let reportlist = createreportlist(mycanvas.id); let square1 = draw(mycanvas.ctx, 50, 50, 100, 'blue'); reportarea(square1.length, reportlist); reportperimeter(square1.length, reportlist); note: although imported features are available in the file, they are read only views of the feature that was exported.
Regular expression syntax cheatsheet - JavaScript
capturing groups have a performance penalty.
Groups and ranges - JavaScript
capturing groups have a performance penalty.
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
javascript execution won't be halted.
TypeError: cyclic object value - JavaScript
the json format per se doesn't support object references (although an ietf draft exists), hence json.stringify() doesn't try to solve them and fails accordingly.
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
javascript execution won't be halted.
ReferenceError: deprecated caller or arguments usage - JavaScript
javascript execution won't be halted.
SyntaxError: missing : after property id - JavaScript
var obj = { propertykey: 'value' }; // or alternatively var obj = { }; obj['propertykey'] = 'value'; empty properties you can't create empty properties like this: var obj = { propertykey; }; // syntaxerror: missing : after property id if you need to define a property without a value, you might use null as a value.
SyntaxError: missing = in const declaration - JavaScript
a constant is a value that cannot be altered by the program during normal execution.
SyntaxError: missing name after . operator - JavaScript
operator to fix this code, you need to access the object like this: obj.foo.bar; // "baz" // or alternatively obj["foo"]["bar"]; // "baz" // computed properties require square brackets obj.foo["bar" + i]; // "baz2" property access vs.
JavaScript error reference - JavaScript
operatorsyntaxerror: missing variable namesyntaxerror: missing } after function bodysyntaxerror: missing } after property listsyntaxerror: redeclaration of formal parameter "x"syntaxerror: return not in functionsyntaxerror: test for equality (==) mistyped as assignment (=)?syntaxerror: unterminated string literaltypeerror: "x" has no propertiestypeerror: "x" is (not) "y"typeerror: "x" is not a constructortypeerror: "x" is not a functiontypeerror: "x" is not a non-null objecttypeerror: "x" is read-onlytypeerror: 'x' is not iterabletypeerror: more arguments neededtypeerror: reduce of empty array with no initial valuetypeerror: x.prototype.y called on incompatible typetypeerror: can't access dead objecttypeer...
arguments.callee - JavaScript
function create() { return function(n) { if (n <= 1) return 1; return n * arguments.callee(n - 1); }; } var result = create()(5); // returns 120 (5 * 4 * 3 * 2 * 1) a use of arguments.callee with no good alternative however, in a case like the following, there are not alternatives to arguments.callee, so its deprecation could be a bug (see bug 725398): function createperson(sidentity) { var operson = new function('alert(arguments.callee.identity);'); operson.identity = sidentity; return operson; } var john = createperson('john smith'); john(); specifications specification ...
The arguments object - JavaScript
function foo(...args) { return args; } foo(1, 2, 3); // [1, 2, 3] while the presence of rest, default, or destructured parameters does not alter the behavior of the arguments object in strict mode code, there are subtle differences for non-strict code.
getter - JavaScript
it is not possible to simultaneously have a getter bound to a property and have that property actually hold a value, although it is possible to use a getter and a setter in conjunction to create a type of pseudo-property.
Functions - JavaScript
although a function expression creates a closure every time, the function body is not reparsed, so function expressions are still faster than "new function(...)".
Array.prototype[@@iterator]() - JavaScript
for...of loop html <ul id="letterresult"> </ul> javascript var arr = ['a', 'b', 'c']; var earr = arr[symbol.iterator](); var letterresult = document.getelementbyid('letterresult'); // your browser must support for..of loop // and let-scoped variables in for loops // const and var could also be used for (let letter of earr) { letterresult.innerhtml += "<li>" + letter + "</li>"; } result alternative iteration var arr = ['a', 'b', 'c', 'd', 'e']; var earr = arr[symbol.iterator](); console.log(earr.next().value); // a console.log(earr.next().value); // b console.log(earr.next().value); // c console.log(earr.next().value); // d console.log(earr.next().value); // e use case for brace notation the use case for this syntax over using the dot notation (array.prototype.values()) is in a ...
Array.prototype.concat() - JavaScript
the concat method does not alter this or any of the arrays provided as arguments but instead returns a shallow copy that contains copies of the same elements combined from the original arrays.
Array.prototype.copyWithin() - JavaScript
it does not alter the length of this, but it will change its content and create new properties, if necessary.
Array.prototype.flat() - JavaScript
alternatives reduce and concat const arr = [1, 2, [3, 4]]; // to flat single level array arr.flat(); // is equivalent to arr.reduce((acc, val) => acc.concat(val), []); // [1, 2, 3, 4] // or with decomposition syntax const flattened = arr => [].concat(...arr); reduce + concat + isarray + recursivity const arr = [1, 2, [3, 4, [5, 6]]]; // to enable deep level flatten use recursion with reduce a...
Array.prototype.flatMap() - JavaScript
alternative reduce() and concat() var arr = [1, 2, 3, 4]; arr.flatmap(x => [x, x * 2]); // is equivalent to arr.reduce((acc, x) => acc.concat([x, x * 2]), []); // [1, 2, 2, 4, 3, 6, 4, 8] note, however, that this is inefficient and should be avoided for large arrays: in each iteration, it creates a new temporary array that must be garbage-collected, and it copies elements from the current accumu...
Array.prototype.forEach() - JavaScript
the following example illustrates an alternative approach, using foreach().
Array.prototype.slice() - JavaScript
description slice does not alter the original array.
Array - JavaScript
but it's also possible to quote the array indexes as well (e.g., years['2'] instead of years[2]), although it's not necessary.
Date - JavaScript
in addition to methods to read and alter individual components of the local date and time (such as getday() and sethours()), there are also versions of the same methods that read and manipulate the date and time using utc (such as getutcday() and setutchours()).
Error.prototype.lineNumber - JavaScript
examples using linenumber var e = new error('could not parse input'); throw e; console.log(e.linenumber) // 2 alternative example using error event window.addeventlistener('error', function(e) { console.log(e.linenumber); // 5 }); var e = new error('could not parse input'); throw e; this is not a standard feature and lacks widespread support.
EvalError - JavaScript
although ecma-262 specifies that evalerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
Function.prototype.apply() - JavaScript
for alternative methods, please consider one of the following approaches: using object.__proto__: function.prototype.construct = function (aargs) { let onew = {}; onew.__proto__ = this.prototype; this.apply(onew, aargs); return onew; }; using closures: function.prototype.construct = function(aargs) { let fconstructor = this, fnewconstr = function() { fconstructor.apply(this, aargs); ...
Function.prototype.bind() - JavaScript
// example can be run directly in your javascript console // ...continued from above // can still be called as a normal function // (although usually this is undesired) yaxispoint(13); `${emptyobj.x},${emptyobj.y}`; // > '0,13' if you wish to support the use of a bound function only using new, or only by calling it, the target function must enforce that restriction.
Generator.prototype.next() - JavaScript
this is equivalent of not specifying the done property altogether.
Generator.prototype.throw() - JavaScript
this is equivalent of not specifying the done property altogether.
Math.clz32() - JavaScript
now, inversing the bits reveals the lowest bits return 32 - clz(~integer) |0; // `|0` ensures integer coercion } function ctron(integer){ // count trailing ones // no shift-filling-in-with-ones operator is available in // javascript, so the below code is the fastest return ctrz(~integer); /* alternate implementation for demonstrational purposes: // 1.
Object.prototype.__defineGetter__() - JavaScript
this method should not be used since better alternatives exist.
Object.assign() - JavaScript
ototype.hasownproperty.call(nextsource, nextkey)) { to[nextkey] = nextsource[nextkey]; } } } } return to; }, writable: true, configurable: true }); } examples cloning an object const obj = { a: 1 }; const copy = object.assign({}, obj); console.log(copy); // { a: 1 } warning for deep clone for deep cloning, we need to use alternatives, because object.assign() copies property values.
Object.freeze() - JavaScript
as an object, an array can be frozen; after doing so, its elements cannot be altered and no elements can be added to or removed from the array.
Object.seal() - JavaScript
attempting to delete or add properties to a sealed object, or to convert a data property to accessor or vice versa, will fail, either silently or by throwing a typeerror (most commonly, although not exclusively, when in strict mode code).
Object.setPrototypeOf() - JavaScript
in addition, the effects of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in the object.setprototypeof(...) statement, but may extend to any code that has access to any object whose [[prototype]] has been altered.
Promise.prototype.catch() - JavaScript
demonstration of the internal call: // overriding original promise.prototype.then/catch just to add some logs (function(promise){ var originalthen = promise.prototype.then; var originalcatch = promise.prototype.catch; promise.prototype.then = function(){ console.log('> > > > > > called .then on %o with arguments: %o', this, arguments); return originalthen.apply(this, arguments); }; promise.prototype.catch = function(){ console.error('> > > > > > called .catch on %o with arguments: %o', this, argum...
Promise.prototype.finally() - JavaScript
this provides a way for code to be run whether the promise was fulfilled successfully or rejected once the promise has been dealt with.
Promise - JavaScript
the alternative is to throw a special value (in this case "-999", but a custom error type would be more appropriate).
RangeError - JavaScript
although ecma-262 specifies that rangeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
ReferenceError - JavaScript
although ecma-262 specifies that referenceerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
Comparing Reflect and Object methods - JavaScript
although some of the methods appear to be similar in their behavior, there are often subtle differences between them.
Reflect - JavaScript
some of these methods are also the same as corresponding methods on object, although they do have some subtle differences between them.
RegExp() constructor - JavaScript
alternatively, if an object is supplied for the pattern, the flags string will replace any of that object's flags (and lastindex will be reset to 0) (as of es2015).
String.prototype.charAt() - JavaScript
urrogates as single characters) if (0xd800 > prev || prev > 0xdbff) { throw 'low surrogate without preceding high surrogate'; } // we can pass over low surrogates now as the second component // in a pair which we have already processed return false; } in an ecmascript 2016 environment which allows destructured assignment, the following is a more succinct and somewhat more flexible alternative in that it does increment for an incrementing variable automatically (if the character warrants it in being a surrogate pair).
String.prototype.substring() - JavaScript
let text = 'mozilla' console.log(text.substring(2,5)) // => "zil" console.log(text.substr(2,3)) // => "zil" differences between substring() and slice() the substring() and slice() methods are almost identical, but there are a couple of subtle differences between the two, especially in the way negative arguments are dealt with.
Symbol - JavaScript
a symbol value may be used as an identifier for object properties; this is the data type's primary purpose, although other use-cases exist, such as enabling opaque data types, or serving as an implementation-supported unique identifier in general.
SyntaxError - JavaScript
although ecma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
TypeError - JavaScript
although ecma-262 specifies that typeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
TypedArray.prototype[@@iterator]() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of arr) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr[symbol.iterator](); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prot...
TypedArray.prototype.entries() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.entries(); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.entries(); console.log(earr.next().value); // [0, 10] console.log(earr.next().value); // [1, 20] console.log(earr.next().value); // [2, 30] console.log(earr.next().value); // [3, 40] console.log(earr.next().value); // [4, 50] specifications specification ecmascript (ecma-262)the definition o...
TypedArray.prototype.keys() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.keys(); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.keys(); console.log(earr.next().value); // 0 console.log(earr.next().value); // 1 console.log(earr.next().value); // 2 console.log(earr.next().value); // 3 console.log(earr.next().value); // 4 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.keys()' in ...
TypedArray.prototype.map() - JavaScript
map() does not mutate the typed array on which it is called (although mapfn, if invoked, may do so).
TypedArray.prototype.slice() - JavaScript
description the slice method does not alter.
TypedArray.prototype.values() - JavaScript
examples iteration using for...of loop var arr = new uint8array([10, 20, 30, 40, 50]); var earray = arr.values(); // your browser must support for..of loop // and let-scoped variables in for loops for (let n of earray) { console.log(n); } alternative iteration var arr = new uint8array([10, 20, 30, 40, 50]); var earr = arr.values(); console.log(earr.next().value); // 10 console.log(earr.next().value); // 20 console.log(earr.next().value); // 30 console.log(earr.next().value); // 40 console.log(earr.next().value); // 50 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.valu...
URIError - JavaScript
although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
WebAssembly.CompileError - JavaScript
although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
WebAssembly.LinkError - JavaScript
although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
WebAssembly.RuntimeError - JavaScript
although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
escape() - JavaScript
warning: although escape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
parseInt() - JavaScript
octal interpretations with no radix although discouraged by ecmascript 3 and forbidden by ecmascript 5, many implementations interpret a numeric string beginning with a leading 0 as octal.
unescape() - JavaScript
warning: although unescape() is not strictly deprecated (as in "removed from the web standards"), it is defined in annex b of the ecma-262 standard, whose introduction states: … all of the language features and behaviours specified in this annex have one or more undesirable characteristics and in the absence of legacy usage would be removed from this specification.
Standard built-in objects - JavaScript
infinity nan undefined globalthis function properties these global functions—functions which are called globally, rather than on an object—directly return their results to the caller.
Iteration protocols - JavaScript
(this is equivalent to not specifying the done property altogether.) has the value true if the iterator has completed its sequence.
Destructuring assignment - JavaScript
let {a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40} a; // 10 b; // 20 rest; // { c: 30, d: 40 } invalid javascript identifier as a property name destructuring can be used with property names that are not valid javascript identifiers by providing an alternative identifier that is valid.
Object initializer - JavaScript
although they look similar, there are differences between them: json permits only property definition using "property": value syntax.
Unary plus (+) - JavaScript
syntax operator: +x description although unary negation (-) also can convert non-numbers, unary plus is the fastest and preferred way of converting something into a number, because it does not perform any other operations on the number.
instanceof - JavaScript
however, objects created with the object literal notation are an exception here: although the prototype is undefined, instanceof object returns true.
typeof - JavaScript
typeof document.all === 'undefined'; although the specification allows custom type tags for non-standard exotic objects, it requires those type tags to be different from the predefined ones.
void operator - JavaScript
for example: <a href="javascript:void(0);"> click here to do nothing </a> <a href="javascript:void(document.body.style.backgroundcolor='green');"> click here for green background </a> note: javascript: pseudo protocol is discouraged over other alternatives, such as unobtrusive event handlers.
yield - JavaScript
this halts execution of the generator entirely, and execution resumes in the caller (as is normally the case when an exception is thrown).
empty - JavaScript
an empty statement is used to provide no statement, although the javascript syntax would expect one.
async function - JavaScript
> { return processdatainworker(v) // returns a promise }) } it can be rewritten with a single async function as follows: async function getprocesseddata(url) { let v try { v = await downloaddata(url) } catch(e) { v = await downloadfallbackdata(url) } return processdatainworker(v) } in the above example, notice there is no await statement after the return keyword, although that would be valid too: the return value of an async function is implicitly wrapped in promise.resolve - if it's not already a promise itself (as in this example).
block - JavaScript
the opposite behavior is possible using an empty statement, where you provide no statement, although one is required.
const - JavaScript
for instance, in the case where the content is an object, this means the object's contents (e.g., its properties) can be altered.
Statements and declarations - JavaScript
empty an empty statement is used to provide no statement, although the javascript syntax would expect one.
Template literals (Template strings) - JavaScript
(alternatively, it can return something completely different, as described in one of the following examples.) the name of the function used for the tag can be whatever you want.
JavaScript reference - JavaScript
value properties infinity nan undefined globalthis function properties eval() isfinite() isnan() parsefloat() parseint() decodeuri() decodeuricomponent() encodeuri() encodeuricomponent() fundamental objects object function boolean symbol error objects error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers & dates number bigint math date text processing string regexp indexed collections array int8a...
related_applications - Web app manifests
such applications are intended to be alternatives to the manifest's website that provides similar/equivalent functionality — like the native app equivalent.
start_url - Web app manifests
note: the start_url member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards.
MathML attribute reference - MathML
unimplemented altimg altimg-width altimg-height altimg-valign alttext <math> visual and textual fall-back options.
<maction> - MathML
toggle: when there is a click on the subexpression, the rendering alternates the display of selected subexpressions.
<mi> - MathML
WebMathMLElementmi
that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<mn> - MathML
WebMathMLElementmn
that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<mo> - MathML
WebMathMLElementmo
that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<ms> - MathML
WebMathMLElementms
that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
<mstyle> - MathML
WebMathMLElementmstyle
src and alt on <mglyph> cannot be set on <mstyle>.
<mtext> - MathML
WebMathMLElementmtext
that is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography.
Digital audio concepts - Web media technologies
use cases for lossless audio include scenarios such as: any situation in which the listener expects precise audio reproduction and may have an ear for sound that's good enough to make out the intricate details of unaltered audio audio loops and samples used in music and sound effects production work situations in which audio clips or samples may be remixed and then compressed; using lossless audio for the mastering process avoids compressing previously compressed data, resulting in additional quality loss factors that may recommend the use of lossy compression include: very large source audio constraine...
The "codecs" parameter in common media types - Web media technologies
the base layer within the stream is provided at a high quality level, with some number of secondary substreams that offer alternative forms of the same video for use in various constrained environments.
Media type and format guide: image, audio, and video content - Web media technologies
WebMediaFormats
handling media support issues in web content in this guide, we look at how to build web content that maximizes quality or performance while providing the broadest possible compatibility, by choosing media formats wisely, and offering fallbacks and alternate formats where it would be helpful.
Using audio and video in HTML - Web media technologies
we don't have a particularly good guide to using these objects offscreen at this time, although audio and video manipulation may be a good start.
Guide to streaming audio and video - Web media technologies
hls may also be supported in other environments, although in some cases this support is conditional.
Using images in HTML - Web media technologies
WebMediaimages
it supports a wide range of attributes that control how the image behaves and allows you to add important information like alt text for people who don't see the image.
Web media technologies
this ranges from simply using the alt attribute on <img> elements to captions to tagging media for screen readers.
Lazy loading - Web Performance
<img src="image.jpg" loading="lazy" alt="..." /> <iframe src="video-player.html" loading="lazy"></iframe> the load event fires when the eagerly-loaded content has all been loaded; at that time, it's entirely possible (or even likely) that there may be lazily-loaded images that are within the visual viewport that haven't yet loaded.
Performance budgets - Web Performance
a large library with smaller alternatives is often picked to solve a common problem).
Introduction to progressive web apps - Progressive web apps (PWAs)
progressive enhancement suppport modern web apps can be developed to provide an excellent experience to fully capable browsers, and an acceptable (although not quite as shiny) experience to less capable browsers.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
value: <funciri>|none|inherit; animatable: yes mask it alters the visibility of an element by either masking or clipping the image at specific points.
alignment-baseline - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <tspan>, <tref>, <altglyph>, and <textpath> usage notes value auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | top | center | bottom default value auto animatable yes auto the value is the dominant-baseline of the script to which the character belongs - i.e., use the...
baseline-shift - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <tref>, and <tspan> usage notes value <length-percentage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscripts.
class - SVG: Scalable Vector Graphics
WebSVGAttributeclass
stroke: #006600; fill: #cc0000; } ]]> </style> <rect class="rectclass" x="10" y="10" width="100" height="100"/> <circle class="circleclass" cx="40" cy="50" r="26"/> </svg> </body> </html> elements the following elements can use the class attribute: <a> <altglyph> <circle> <clippath> <defs> <desc> <ellipse> <feblend> <fecolormatrix> <fecomponenttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <feflood> <fegaussianblur> <feimage> <femerge> <femorphology> <feoffset> <fespecularlighting> <fetile> <feturbulence> <filter> <font> <foreignobject> <g> <glyph> <glyphref> <image> <line> <lineargra...
direction - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <altglyph>, <textpath>, <text>, <tref>, and <tspan>.
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
it has implications for the <tspan>, <tref>, and <altglyph> elements, event processing, for bounding box calculations and for calculation of clipping paths: if display is set to none on a <tspan>, <tref>, or <altglyph> element, then the text string is ignored for the purposes of text layout.
dur - SVG: Scalable Vector Graphics
WebSVGAttributedur
note: the interpolation will not work if the simple duration is indefinite (although this may still be useful for <set> elements).
fill-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <circle>, <ellipse>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 400 100" xmlns="http://www.w3.org/2000/svg"> <!-- default fill opacity: 1 --> <circle cx="50" cy="50" r="40" /> <!-- fill opacity as a number --> <circle cx="150" cy="50" r="40" fill-opacity="0.7" /> <!-- fill opacity as a percentage --> <circle cx="250" cy="50" r="...
fill-rule - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <path>, <polygon>, <polyline>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="-10 -10 220 120" xmlns="http://www.w3.org/2000/svg"> <!-- default value for fill-rule --> <polygon fill-rule="nonzero" stroke="red" points="50,0 21,90 98,35 2,35 79,90"/> <!-- the center of the shape has two path segments (shown by the red stroke) between it and infinity.
font-family - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="arial, helvetica, sans-serif">sans serif</text> <text x="100" y="20" font-family="monospace">monospace</text> </svg> usage notes value [ <family-name> | <generic-family> ]#where <family-name> = <string>...
font-size-adjust - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg width="600" height="80" viewbox="0 0 500 80" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-family="times, serif" font-size="10px"> this text uses the times font (10px), which is hard to read in small sizes.
font-size - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-size="smaller">smaller</text> <text x="100" y="20" font-size="2em">2em</text> </svg> usage notes value <absolute-size> | <relative-size> | <length-percentage> default value medium animatabl...
font-stretch - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> usage notes value <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> default value normal animatable yes specifications specification status comment ...
font-style - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but only has an effect on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-style="normal">normal font style</text> <text x="150" y="20" font-style="italic">italic font style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of th...
font-weight - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 200 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" font-weight="normal">normal text</text> <text x="100" y="20" font-weight="bold">bold text</text> </svg> usage notes value normal | bold | bolder | lighter | <number> default value normal animata...
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value <angle> default value 0deg animatable no <angle> the value of the angle is restricted to 0, 90, 180, and 270 degrees.
kerning - SVG: Scalable Vector Graphics
WebSVGAttributekerning
as a presentation attribute, it can be applied to any element but it has effect only on the following four elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> html, body, svg { height: 100%; font: 36px verdana, helvetica, arial, sans-serif; } <svg viewbox="0 0 150 125" xmlns="http://www.w3.org/2000/svg"> <text x="10" y="30" kerning="auto">auto</text> <text x="10" y="70" kerning="0">number</text> <text x="10" y="110" kerning="20px">length</text> </svg> usage notes value auto ...
letter-spacing - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 400 30" xmlns="http://www.w3.org/2000/svg"> <text y="20" letter-spacing="2">bigger letter-spacing</text> <text x="200" y="20" letter-spacing="-0.5">smaller letter-spacing</text> </svg> usage notes value normal | <length> default value normal animatabl...
onclick - SVG: Scalable Vector Graphics
WebSVGAttributeonclick
thirty-seven elements are using this attribute: <a>, <altglyph>, <animate>, <animatemotion>, <animatetransform>, <circle>, <defs>, <desc>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <lineargradient>, <marker>, <metadata>, <mpath>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <script>, <set>, <stop>, <style>, <svg>, <switch>, <symbol>, <text>, <textpath>, <title>, <tref>, <tspan>, <use>, <view> html, body, svg { height: 100%; margin: 0; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" onclick="alert('you have clicked the circle.')" /> </svg> usage notes value <anything> default value none ...
overflow - SVG: Scalable Vector Graphics
although the initial value for overflow is auto, it is overwritten in the user agent style sheet for the <svg> element when it is not the root element of a stand-alone document, the <pattern> element, and the <marker> element to be hidden by default.
stroke-dashoffset - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <path>, <line>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="-3 0 33 10" xmlns="http://www.w3.org/2000/svg"> <!-- no dash array --> <line x1="0" y1="1" x2="30" y2="1" stroke="black" /> <!-- no dash offset --> <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="3 1" /> <!-- the start of the dash array computation is pulle...
stroke-linecap - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eight elements: <altglyph>, <path>, <polyline>, <line>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"> <!-- effect of the (default) "butt" value --> <line x1="1" y1="1" x2="5" y2="1" stroke="black" stroke-linecap="butt" /> <!-- effect of the "round" value --> <line x1="1" y1="3" x2="5" y2="3" stroke="black" stroke-linecap="round" /> <!-- effect of the "square"...
stroke-linejoin - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following nine elements: <altglyph>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 18 12" xmlns="http://www.w3.org/2000/svg"> <!-- upper left path: effect of the "miter" value --> <path d="m1,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2,3.5" stroke="black" fill="none" stroke-linejoin="miter" /> <!-- center path: effect of the "round" value --> <path d="m7,5 a2,2 0,0,0 2,-3 a3,3 0 0 1 2...
stroke-miterlimit - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following nine elements: <altglyph>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 38 30" xmlns="http://www.w3.org/2000/svg"> <!-- impact of the default miter limit --> <path stroke="black" fill="none" stroke-linejoin="miter" id="p1" d="m1,9 l7 ,-3 l7 ,3 m2,0 l3.5 ,-3 l3.5 ,3 m2,0 l2 ,-3 l2 ,3 ...
stroke-opacity - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <path>, <line>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 40 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke opacity: 1 --> <circle cx="5" cy="5" r="4" stroke="green" /> <!-- stroke opacity as a number --> <circle cx="15" cy="5" r="4" stroke="green" stroke-opacity="0.7" /> <!-- stroke op...
stroke-width - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it only has effect on shapes and text context elements, including: <altglyph>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <!-- default stroke width: 1 --> <circle cx="5" cy="5" r="3" stroke="green" /> <!-- stroke width as a number --> <circle cx="15" cy="5" r="3" stroke="green" stroke-width="3" /> <!-- stroke width as a percentage --> <circle cx="25" cy="5" r="3" stroke="green" stroke-width="2%" /> </svg> usage notes...
stroke - SVG: Scalable Vector Graphics
WebSVGAttributestroke
as a presentation attribute, it can be applied to any element but it has effect only on the following twelve elements: <altglyph>, <circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- simple color stroke --> <circle cx="5" cy="5" r="4" fill="none" stroke="green" /> <!-- stroke a circle with a gradient --> <defs> <lineargradient id="mygradient"> <stop offset="0%" stop-color="g...
text-decoration - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" text-decoration="underline">underlined text</text> <text x="0" y="40" text-decoration="line-through">struck-through text</text> </svg> usage notes value <'text-decoration-line'> || <'text-decoration-style'> || <'tex...
unicode-bidi - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following eleven elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css unicode-bidi property.
unicode - SVG: Scalable Vector Graphics
WebSVGAttributeunicode
if the attribute is not provided for a given <glyph>, then the only way to use this glyph is via an <altglyph> reference.
visibility - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following nineteen elements: <a>, <altglyph>, <audio>, <canvas>, <circle>, <ellipse>, <foreignobject>, <iframe>, <image>, <line>, <path>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, <tspan>, <video> html, body, svg { height: 100%; } <svg viewbox="0 0 220 120" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="200" height="100" stroke="black" stroke-width="5" fill="transparent" /> <g stroke="...
word-spacing - SVG: Scalable Vector Graphics
as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 250 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" word-spacing="2">bigger spacing between words</text> <text x="0" y="40" word-spacing="-0.5">smaller spacing between words</text> </svg> usage notes value normal | <length> animatable yes default...
xlink:arcrole - SVG: Scalable Vector Graphics
for example, a resource might generically represent a "person," but in the context of a particular arc it might have the role of "mother" and in the context of a different arc it might have the role of "daughter." twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, <use> usage notes value <iri> default value none animatable no <iri> this value specifies an iri refe...
xlink:title - SVG: Scalable Vector Graphics
these elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage context value <anything> default value none animatable no <anything> this value speci...
xlink:type - SVG: Scalable Vector Graphics
twentytwo elements are using this attribute: <a>, <altglyph>, <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <color-profile>, <cursor>, <feimage>, <filter>, <font-face-uri>, <glyphref>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage notes value simple default value simple animatable no simple this value specifies that the referred resource is a simple link.
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
elevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<a>' in that specification.
<defs> - SVG: Scalable Vector Graphics
WebSVGElementdefs
-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<defs>' in that specification.
<g> - SVG: Scalable Vector Graphics
WebSVGElementg
ed, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<g>' in that specification.
<glyph> - SVG: Scalable Vector Graphics
WebSVGElementglyph
usage context categoriestext content elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y unicode glyph-name orientation arabic-form lang dom interface this element implements the svgglyphelement interface.
<glyphRef> - SVG: Scalable Vector Graphics
WebSVGElementglyphRef
the glyphref element provides a single possible glyph to the referencing <altglyph> substitution.
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
elevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment svg markersthe definition of '<marker>' in that specification.
<mask> - SVG: Scalable Vector Graphics
WebSVGElementmask
mask, opacity, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment css masking module level 1the definition of '<mask>' in that specification.
<missing-glyph> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface.
<pattern> - SVG: Scalable Vector Graphics
WebSVGElementpattern
e-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title usage notes categoriescontainer elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<pattern>' in that specification.
<style> - SVG: Scalable Vector Graphics
WebSVGElementstyle
value type: <string>; default value: all; animatable: no title this attribute the title of the style sheet which can be used to switch between alternate style sheets.
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
ed, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the definition of '<svg>' in that specification.
<symbol> - SVG: Scalable Vector Graphics
WebSVGElementsymbol
ed, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> note: a <symbol> element itself is not meant to be rendered.
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the definition of '<textpath>' in that specification.
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
a-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the definition of '<tspan>' in that specification.
Namespaces crash course - SVG: Scalable Vector Graphics
in other words, although the parameters belong to the namespace of the element, you do not use the tag's namespace name.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
mplemented (bug 1446617) reference basic shapes to <textpath> implementation status unknown side attribute for <textpath> implemented (bug 1446650) render characters for one loop of a single closed path, effected by the startoffset attribute and text-anchor property implementation status unknown <tref> removed implementation status unknown <altglyph>, <altglyphdef>, <altglyphitem> and <glyphref> removed <altglyph>, <altglyphdef> and <altglyphitem> removed (bug 1260032), <glyphref> never really implemented (bug 1302693) svgtextcontentelement.selectsubstring() deprecated implementation status unknown getcomputedtextlength() not including dx and dy values implementation status unknown text in non-rendere...
SVG animation with SMIL - SVG: Scalable Vector Graphics
although chrome 45 deprecated smil in favor of css animations and web animations, the chrome developers have since suspended that deprecation.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
although the adobe svg viewer plugin allows the use of functionname(), it's not the preferred way to do things.
Gradients in SVG - SVG: Scalable Vector Graphics
<lineargradient id="gradient1"> <stop id="stop1" offset="0%"/> <stop id="stop2" offset="50%"/> <stop id="stop3" offset="100%"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#gradient1"/> i've included the xlink namespace here directly on the node, although usually you would define it at the top of your document.
Referer header: privacy and security concerns - Web security
this can for example be set to no-referrer to stop the referer header being sent altogether.
Tutorials
css first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.
Using custom elements - Web Components
over in our html, we use it like so: <popup-info img="img/alt.png" data-text="your card validation code (cvc) is an extra security feature — it is the last 3 or 4 numbers on the back of your card."></popup-info> note: you can see the full javascript source code here.
Using templates and slots - Web Components
let's look at a trivial quick example: <template id="my-paragraph"> <p>my paragraph</p> </template> this won't appear in your page until you grab a reference to it with javascript and then append it to the dom, using something like the following: let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; document.body.appendchild(templatecontent); although trivial, you can already start to see how this could be useful.
XPath snippets - XPath
although walking the dom tree can achieve similar results, using xpath expressions is much quicker and more powerful.
<xsl:choose> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementchoose
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:choose> element defines a choice among a number of alternatives.
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
note: the import is live, meaning that if you alter the stylesheet dom after importing it, this will be reflected in the processing.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
the example allows sorting the content multiple times, alternating between ascending and descending order.
Setting Parameters - XSLT: Extensible Stylesheet Language Transformations
the sorting would have to alternate between ascending and descending sorting.
XSLT: Extensible Stylesheet Language Transformations
WebXSLT
although the process is referred to as "transformation," the original document is not changed; rather, a new xml document is created based on the content of an existing document.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
you could then build your custom html completely from scratch, although this is an advanced approach; it is usually easier to use the provided html template.
Compiling an Existing C Module to WebAssembly - WebAssembly
emscripten provides most of these features, although there are some limitations.