Search completed in 1.67 seconds.
7027 results for "set":
Your results are loading. Please wait...
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
the html <fieldset> element is used to group several controls as well as labels (<label>) within a web form.
... as the example above shows, the <fieldset> element provides a grouping for a part of an html form, with a nested <legend> element providing a caption for the <fieldset>.
... it takes few attributes, the most notable of which are form, which can contain the id of a <form> on the same page, allowing you to make the <fieldset> part of that <form> even if it is not nested inside it, and disabled, which allows you to disable the <fieldset> and all its contents in one go.
...And 16 more matches
Sets (set) - EXSLT
WebEXSLTset
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt sets package offers functions that let you perform set manipulation.
... the namespace for these functions is http://exslt.org/sets.
... set:difference()set:difference() returns the difference between two node-sets.
...And 2 more matches
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
the fontfacesetloadevent constructor creates a new fontfaceloadevent object which is fired whenever a fontfaceset loads.
... syntax var fontfacesetloadevent = new fontfacesetloadevent(type[, options]) parameters type the literal value 'type' (quotation marks included).
... specifications specification status comment css font loading module level 3the definition of 'fontfacesetloadevent()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetfontfacesetloadevent() constructor experimentalchrome full support 57edge full support ≤79firefox ?
Capabilities, constraints, and settings - Web APIs
this article discusses capabilities and constraints, as well as media settings, and includes an example we call the constraint exerciser.
... the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and video tracks coming from the computer's a/v input devices (such as its webcam and microphone).
... the track's getconstraints() method returns the set of constraints passed into the most recent call to applyconstraints().
...And 45 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
the setinterval() method, offered on the window and worker interfaces, repeatedly calls a function or executes a code snippet, with a fixed time delay between each call.
... syntax var intervalid = scope.setinterval(func, [delay, arg1, arg2, ...]); var intervalid = scope.setinterval(function[, delay]); var intervalid = scope.setinterval(code, [delay]); parameters func a function to be executed every delay milliseconds.
... note: passing additional arguments to setinterval() in the first syntax does not work in internet explorer 9 and earlier.
...And 38 more matches
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
the settimeout() method of the windoworworkerglobalscope mixin (and successor to window.settimeout()) sets a timer which executes a function or specified piece of code once the timer expires.
... syntax var timeoutid = scope.settimeout(function[, delay, arg1, arg2, ...]); var timeoutid = scope.settimeout(function[, delay]); var timeoutid = scope.settimeout(code[, delay]); parameters function a function to be executed after the timer expires.
... return value the returned timeoutid is a positive integer value which identifies the timer created by the call to settimeout(); this value can be passed to cleartimeout() to cancel the timeout.
...And 38 more matches
Set - JavaScript
the set object lets you store unique values of any type, whether primitive values or object references.
... description set objects are collections of values.
... you can iterate through the elements of a set in insertion order.
...And 25 more matches
Eclipse CDT Manual Setup
mach setup most people should be reading the eclipse cdt page instead of this one, now that mach ide eclipse is a thing.
...for now it's stored here until that integration happens in order that the eclipse cdt page isn't hugely cluttered with mostly redundant information, make setting up eclipse look much more complicated than it is nowadays.
... 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).
...And 22 more matches
HTMLFieldSetElement - Web APIs
the htmlfieldsetelement interface provides special properties and methods (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating the layout and presentation of <fieldset> elements.
...ndale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/htmlfieldsetelement" target="_top"><rect x="301" y="65" width="190" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlfieldsetelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherit...
... htmlfieldsetelement.disabled a boolean reflecting the disabled html attribute, indicating whether the user can interact with the control.
...And 19 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
the rtcpeerconnection method setremotedescription() sets the specified session description as the remote peer's current offer or answer.
...keep in mind that if setremotedescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions).
... because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setremotedescription() does not immediately take effect.
...And 19 more matches
JS_SetProperty
syntax bool js_setproperty(jscontext *cx, js::handleobject obj, const char *name, js::handlevalue v); bool js_setucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlevalue v); bool js_setpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::handlevalue v); // added in spidermonkey 1.8.1 name type description cx jscontext * pointer to a js context from which to derive runtime information.
... obj js::handlevalue object to which the property to set belongs.
... name or id const char * or const char16_t *or js::handleid name of the property to set.
...And 17 more matches
Setting up the Gecko SDK
« previousnext » this chapter provides basic setup information for the gecko software development kit (sdk) used to build the weblock component in this tutorial.
... downloading and setting the sdk the gecko sdk provides all of the tools, headers, and libraries that you need to build xpcom components.
...in this appendix, we set up the windows gecko sdk in c:\gecko-sdk\.
...And 17 more matches
Settings - Firefox Developer Tools
opening settings beginning with firefox 62, the icon to open developer tools settings has been moved into a menu accessed by clicking/touching ...
... the menu includes settings to control the location of the developer tools.
... you can choose between the default setting at the bottom of the windows, or move the tools to the left or right side of the screen.
...And 17 more matches
Setting up an extension development environment - Archive of obsolete content
this article provides suggestions for how to set up your mozilla application for extension development.
... development profile the use of a separate user profile for development can be advantageous, averting performance degradation from development related settings, and further isolating personal data (such as bookmarks, extensions, and settings) from your testing environment.
... note: for an extended guide on how to set up even more user profiles, take a look at multiple firefox profiles.
...And 16 more matches
WeakSet - JavaScript
the weakset object lets you store weakly held objects in a collection.
... description weakset objects are collections of objects.
... just as with sets, each object in a weakset may occur only once; all objects in a weakset's collection are unique.
...And 16 more matches
Setting up your own test automation environment - Learn web development
objective: to show how to set up a selenium testing environment locally and run tests with it, and how to integrate it with tools like lambdatest, sauce labs, and browserstack.
...see setting up a selenium-webdriver project for more details of selenium setups for different languages.
... setting up selenium in node to start with, set up a new npm project, as discussed in setting up node and npm in the last chapter.
...And 15 more matches
RTCPeerConnection.setLocalDescription() - Web APIs
the rtcpeerconnection method setlocaldescription() changes the local description associated with the connection.
... if setlocaldescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions).
... because descriptions will be exchanged until the two peers agree on a configuration, the description submitted by calling setlocaldescription() does not immediately take effect.
...And 15 more matches
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
the xrreferencespace interface's getoffsetreferencespace() method returns a new reference space object which describes the relative difference in position between the object on which the method is called and a given point in 3d space.
... the object returned by getoffsetreferencespace() is an xrreferencespace if called on an xrreferencespace, or an xrboundedreferencespace if called on an object of that type.
... in other words, when you have an object in 3d space and need to position another object relative to that one, you can call getoffsetreferencespace(), passing into it the position and orientation you want the second object to have relative to the position and orientation of the object on which you call getoffsetreferencespace().
...And 13 more matches
Set-Cookie - HTTP
the set-cookie http response header is used to send a cookie from the server to the user agent, so the user agent can send it back to the server later.
... to send multiple cookies, multiple set-cookie headers should be sent in the same response.
... browsers block frontend javascript code from accessing the set cookie header, as required by the fetch spec, which defines set-cookie as a forbidden response-header name that must be filtered out from any response exposed to frontend code.
...And 13 more matches
KeyframeEffect.setKeyframes() - Web APIs
the setkeyframes() method of the keyframeeffect interface replaces the keyframes that make up the affected keyframeeffect with a new set of keyframes.
... syntax existingkeyframeeffect.setkeyframes(keyframes); parameters keyframes a keyframe object or null.
... if set to null, the keyframes are replaced with a sequence of empty keyframes.
...And 12 more matches
XRReferenceSpace: reset event - Web APIs
the reset event is sent to an xrreferencespace object when a discontinuity is detected in either the native origin or the effective origin, causing a jump in the position or orientation of objects oriented using the reference space.
... in the case of xrboundedreferencespace objects, the reset event can also be fired when the boundsgeometry changes.
... bubbles yes cancelable no interface xrreferencespaceevent event handler property onreset usage notes the reset event indicates that the coordinate system has been reset or reconfigured by changing the reference space's origin, moving and rotating it as indicated by the event's transform property.
...And 12 more matches
JS_SetPropertyAttributes
set the attributes for a specified property.
... syntax jsbool js_setpropertyattributes(jscontext *cx, jsobject *obj, const char *name, unsigned int attrs, jsbool *foundp); jsbool js_setucpropertyattributes(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int attrs, jsbool *foundp); name type description cx jscontext * the context in which to set the property attributes.
... obj jsobject * object for which to set property attributes.
...And 11 more matches
handler.set() - JavaScript
the handler.set() method is a trap for setting a property value.
... syntax const p = new proxy(target, { set: function(target, property, value, receiver) { } }); parameters the following parameters are passed to the set() method.
... property the name or symbol of the property to set.
...And 11 more matches
Setting Up a Development Environment - Archive of obsolete content
after setting up make, you should be able to open a command line window, run "make -ver", and get the installed version of make as output.
... we recommend you set up make in your system, since our examples come with all the necessary files to build and install the resulting xpi using this tool.
...the "bash -c" part forces komodo to use bash, which for some reason can't be set properly as the default command shell.
...And 9 more matches
DataTransfer.setDragImage() - Web APIs
however, if a custom image is desired, the datatransfer.setdragimage() method can be used to set the custom image to be used.
...these coordinates define the offset into the image where the mouse cursor should be.
... syntax void datatransfer.setdragimage(img | element, xoffset, yoffset); arguments img | element an image element element to use for the drag feedback image.
...And 9 more matches
FontFaceSet - Web APIs
the fontfaceset interface of the css font loading api manages the loading of font-faces and querying of their download status.
... properties fontfaceset.status read only indicates the font-face's loading status.
... fontfaceset.ready read only promise which resolves once font loading and layout operations have completed.
...And 9 more matches
RTCPeerConnection.setConfiguration() - Web APIs
the rtcpeerconnection.setconfiguration() method sets the current configuration of the rtcpeerconnection based on the values included in the specified rtcconfiguration object.
... the most common use case for this method (and even then, probably not a very common use case) is to replace the set of ice servers to be used.
...if, for example, the rtcpeerconnection() constructor was called with no parameters, you would have to then call setconfiguration() to add ice servers before ice negotiation could begin.
...And 9 more matches
Window.pageYOffset - Web APIs
the read-only window property pageyoffset is an alias for scrolly; as such, it returns the number of pixels the document is currently scrolled along the vertical axis (that is, up or down) with a value of 0.0, indicating that the top edge of the document is currently aligned with the top edge of the window's content area.
... there is slightly better support for pageyoffset than for scrolly in older browsers, but if you're not concerned about browsers more than a handful of years old, you can use either one.
... the corresponding pagexoffset property, which returns the number of pixels scrolled along the horizontal axis (left and right), is an alias for scrollx.
...And 9 more matches
offset-path - CSS: Cascading Style Sheets
the offset-path css property specifies a motion path for an element to follow and defines the element's positioning within the parent container or svg coordinate system.
... syntax /* default */ offset-path: none; /* function values */ offset-path: ray(45deg closest-side contain); /* url */ offset-path: url(#path); /* shapes */ offset-path: circle(50% at 25% 25%); offset-path: inset(50% 50% 50% 50%); offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%); offset-path: path('m 0,200 q 200,200 260,80 q 290,20 400,0 q 300,100 400,200'); /* geometry boxes */ offset-path: margin-box; offset-path: stroke-box; /* global values */ offset-path: inherit; offset-path: initial; offset-path: unset; values ray() taking up to three values, defines a path that is a line segment starting from the position of the box and proceeds in the direction defined by the specified angle similar to the css gradient angle where 0deg is up, with positive angle...
... <basic-shape> specifies a css shape including circle(), ellipse(), inset(), polygon(), or path().
...And 9 more matches
<input type="reset"> - HTML: Hypertext Markup Language
WebHTMLElementinputreset
<input> elements of type "reset" are rendered as buttons, with a default click event handler that resets all of the inputs in the form to their initial values.
... you should usually avoid including reset buttons in your forms.
... value a domstring used as the button's label events click supported common attributes type and value idl attributes value methods none value an <input type="reset"> element's value attribute contains a domstring that is used as the button's label.
...And 9 more matches
Settings - Archive of obsolete content
the jetpack.storage.settings namespace allows jetpacks to specify user-configurable settings.
...the settings persist across browser sessions and are stored using the jetpack [simple storage api][].
... settings are private to each jetpack and are not accessible by other jetpacks.
...And 8 more matches
Settings - Archive of obsolete content
the jetpack.storage.settings namespace allows jetpacks to specify user-configurable settings.
...the settings persist across browser sessions and are stored using the jetpack simple storage api.
... settings are private to each jetpack and are not accessible by other jetpacks.
...And 8 more matches
JS_SetArrayLength
set the length property of an object.
... syntax bool js_setarraylength(jscontext *cx, js::handle<jsobject*> obj, uint32_t length); name type description cx jscontext * the context in which to change the length of the array.
... length uint32_t number of array elements to set.
...And 8 more matches
JS_SetOperationCallback
this article covers features introduced in spidermonkey 1.8.5 set a callback function that is automatically called periodically while javascript code runs.
... these methods/types are renamed to js_setinterruptcallback, js_getinterruptcallback, js_requestinterruptcallback and jsinterruptcallback in spidermonkey 30.
... syntax void js_setoperationcallback(jscontext *cx, jsoperationcallback callback); jsoperationcallback js_getoperationcallback(jscontext *cx); void js_triggeroperationcallback(jsruntime *rt); name type description cx jscontext * a context.
...And 8 more matches
nsICharsetResolver
intl/chardet/public/nsicharsetresolver.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 method overview void notifyresolvedcharset(in acstring charset, in nsisupports closure); acstring requestcharset(in nsiwebnavigation awebnavigation, in nsichannel achannel, out boolean awantcharset, out nsisupports aclosure); methods notifyresolvedcharset() some implementations may request that they be notified when the charset is actually detected.
... void notifyresolvedcharset( in acstring charset, in nsisupports closure ); parameters charset the detected charset.
...And 8 more matches
Setting HTTP request headers
the nsihttpchannel interface has a number of properties and methods, but the method that is of interest to us is setrequestheader.
... this method allows us to set an http request header.
... below is some sample code where we set an http header.
...And 8 more matches
PannerNode.setPosition() - Web APIs
the setposition() method of the pannernode interface defines the position of the audio source relative to the listener (represented by an audiolistener object stored in the audiocontext.listener attribute.) the three parameters x, y and z are unitless and describe the source's position in 3d space using the right-hand cartesian coordinate system.
... the setposition() method's default value of the position is (0, 0, 0).
... syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setposition(0,0,0); returns void.
...And 8 more matches
Range.setStart() - Web APIs
WebAPIRangesetStart
the range.setstart() method sets the start position of a range.
... if the startnode is a node of type text, comment, or cdatasection, then startoffset is the number of characters from the start of startnode.
... for other node types, startoffset is the number of child nodes between the start of the startnode.
...And 8 more matches
Selection.setBaseAndExtent() - Web APIs
the setbaseandextent() method of the selection interface sets the selection to be a range including all or parts of two specified dom nodes, and any content located between them.
... syntax sel.setbaseandextent(anchornode,anchoroffset,focusnode,focusoffset) parameters anchornode the node at the start of the selection.
... anchoroffset the number of child nodes from the start of the anchor node that should be excluded from the selection.
...And 8 more matches
text-underline-offset - CSS: Cascading Style Sheets
the text-underline-offset css property sets the offset distance of an underline text decoration line (applied using text-decoration) from its original position.
... text-underline-offset is not part of the text-decoration shorthand.
... while an element can have multiple text-decoration lines, text-underline-offset only impacts underlining, and not other possible line decoration options such as overline or line-through.
...And 8 more matches
setter - JavaScript
the set syntax binds an object property to a function to be called when there is an attempt to set that property.
... syntax {set prop(val) { .
...}} {set [expression](val) { .
...And 8 more matches
Set.prototype.delete() - JavaScript
the delete() method removes the specified element from a set object.
... syntax myset.delete(value); parameters value the value to remove from myset.
... return value returns true if value was successfully removed from myset; otherwise false.
...And 8 more matches
Rosetta - Archive of obsolete content
for a fast overview on the code proposed here you can git clone https://github.com/madmurphy/rosetta.js, or, at your choice, directly download this .zip file.
... rosetta.js: library "use strict"; /*\ |*| |*| :: rosetta.js :: |*| |*| a possible, extensible collection of compilers to native ecmascript.
... |*| |*| november 12, 2014 |*| |*| https://developer.mozilla.org/add-ons/code_snippets/rosetta |*| https://developer.mozilla.org/user:fusionchess |*| |*| this framework is released under the gnu public license, version 3 or later.
...And 7 more matches
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
a xulrunner application has no installer by default; however, these instructions can help you to easily create a windows installer with inno setup.
... step 1: installing inno setup download inno setup from inno setup downloads.
...however, if you don't get the quickstart pack, you can later get istool from inno setup third-party files.
...And 7 more matches
NPN_SetValue - Archive of obsolete content
syntax #include <npapi.h> nperror npn_setvalue(npp instance, nppvariable variable, void *value); parameters the function has the following parameters: instance pointer to the plugin instance setting the variable.
... variable values the function can set: nppvpluginwindowbool: sets windowed/windowless mode for plugin display; true=windowed, false=windowless nppvplugintransparentbool: sets transparent mode for display of a plugin; true=transparent, false=opaque nppvjavaclass nppvpluginwindowsize nppvplugintimerinterval nppvpluginscriptableinstance nppvpluginscriptableiid nppvjavascriptpushcallerbool: specifies whether you are pushing or popping the jscontext off the stack nppvpluginkeeplibraryinmemory: tells browser that the plugin dll should live longer than usual nppvpluginneedsxembed nppvpluginscriptablenpobject nppvformvalue nppvplugindrawingmodel value the value of the specified variable to be set.
... description a good place to set plugin operation mode such as windowless mode is npp_new, so the browser knows right away what mode the plugin is designed to operate in.
...And 7 more matches
JS_GetPropertyAttrsGetterAndSetter
retrieve the attributes, getter, and setter of a specified property.
... syntax jsbool js_getpropertyattrsgetterandsetter(jscontext *cx, jsobject *obj, const char *name, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, jspropertyop *setterp); jsbool js_getucpropertyattrsgetterandsetter(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, jspropertyop *setterp); jsbool js_getpropertyattrsgetterandsetterbyid(jscontext *cx, jsobject *obj, jsid id, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, jspropertyop *setterp); // added in spidermonkey 1.8.1 name type description cx jscontext * the context in which to perform the property lookup.
... namelen size_t (only in js_getucpropertyattrsgetterandsetter) the length of name in characters; or (size_t) -1 to indicate that name is null-terminated.
...And 7 more matches
JS_SetElement
syntax /* added in spidermonkey 31 */ bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlevalue v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlestring v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, int32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, uint32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t index, double v); /* obsolete since jsapi 29 */ bool js_setelement(jscontext *cx, js::handleobjec...
...t obj, uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to set the element.
... index uint32_t index number of the element to set.
...And 7 more matches
JS_SetOptions
enables and disables options on a jscontext, replacing all previously set options.
... syntax uint32 js_setoptions(jscontext *cx, uint32 options); name type description cx jscontext * a context on which to set options.
... options uint32 the new set of options.
...And 7 more matches
JS_SetParent
sets the parent for an object.
... syntax bool js_setparent(jscontext *cx, js::handleobject obj, js::handleobject parent); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... obj js::handleobject pointer to the object for which to set the parent.
...And 7 more matches
AudioListener.setPosition() - Web APIs
the setposition() method of the audiolistener interface defines the position of the listener.
... syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.setposition(1,1,1); returns void.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
...And 7 more matches
HTMLElement.offsetHeight - Web APIs
the htmlelement.offsetheight read-only property returns the height of an element, including vertical padding and borders, as an integer.
... typically, offsetheight is a measurement in pixels of the element's css height, including any borders, padding, and horizontal scrollbars (if rendered).
... if the element is hidden (for example, by setting style.display on the element or one of its ancestors to "none"), then 0 is returned.
...And 7 more matches
HTMLImageElement.srcset - Web APIs
the htmlimageelement property srcset is a string which identifies one or more image candidate strings, separated using commas (,) each specifying image resources to use under given circumstances.
... the srcset property, along with the sizes property, are a crucial component in designing responsive web sites, as they can be used together to make pages that use appropriate images for the rendering situation.
... syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more image candidate strings to be used when determining which image resource to present inside the <img> element represented by the htmlimageelement.
...And 7 more matches
HTMLOrForeignElement.dataset - Web APIs
the dataset read-only property of the htmlorforeignelement interface provides read/write access to all the custom data attributes (data-*) set on the element.
...note that the dataset property itself can be read, but not directly written.
... instead, all writes must be to the individual properties within the dataset, which in turn represent the data attributes.
...And 7 more matches
PannerNode.setOrientation() - Web APIs
the setorientation() method of the pannernode interface defines the direction the audio source is playing in.
... syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setorientation(1,0,0); returns void.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
...And 7 more matches
Lighting a WebXR setting - Web APIs
because the webxr device api relies on other technologies—namely, webgl and frameworks based upon it—to perform all rendering, texturing, and lighting of a scene, the same general lighting concepts apply to webxr settings or scenes as to any other webgl-generated display.
... components of a light source a light source has three major components; each component is in essence a type of light there are three kinds of light that can affect the color and brightness of objects and their pixels as displayed on the viewer's screen or headset.
...while some of these are also useful in any other 3d setting, most are specific to virtual reality and, in some cases even more so, to augmented reality.
...And 7 more matches
@charset - CSS: Cascading Style Sheets
WebCSS@charset
the @charset css at-rule specifies the character encoding used in the style sheet.
...if several @charset at-rules are defined, only the first one is used, and it cannot be used inside a style attribute on an html element or inside the <style> element where the character set of the html page is relevant.
... @charset "utf-8"; this at-rule is useful when using non-ascii characters in some css properties, like content.
...And 7 more matches
mask-border-outset - CSS: Cascading Style Sheets
the mask-border-outset css property specifies the distance by which an element's mask border is set out from its border box.
... syntax /* <length> value */ mask-border-outset: 1rem; /* <number> value */ mask-border-outset: 1.5; /* vertical | horizontal */ mask-border-outset: 1 1.2; /* top | horizontal | bottom */ mask-border-outset: 30px 2 45px; /* top | right | bottom | left */ mask-border-outset: 7px 12px 14px 5px; /* global values */ mask-border-outset: inherit; mask-border-outset: initial; mask-border-outset: unset; the mask-border-outset property may be specified as one, two, three, or four values.
... when one value is specified, it applies the same outset to all four sides.
...And 7 more matches
handler.setPrototypeOf() - JavaScript
the handler.setprototypeof() method is a trap for object.setprototypeof().
... syntax const p = new proxy(target, { setprototypeof: function(target, prototype) { } }); parameters the following parameters are passed to the setprototypeof() method.
... return value the setprototypeof() method returns true if the [[prototype]] was successfully changed, otherwise false.
...And 7 more matches
Reflect.set() - JavaScript
the static reflect.set() method works like setting a property on an object.
... syntax reflect.set(target, propertykey, value[, receiver]) parameters target the target object on which to set the property.
... propertykey the name of the property to set.
...And 7 more matches
NPP_SetWindow - Archive of obsolete content
syntax #include <npapi.h> nperror npp_setwindow(npp instance, npwindow *window); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... description the browser calls npp_setwindow after creating the instance to allow drawing to begin.
... subsequent calls to npp_setwindow indicate changes in size or position; these calls pass the same npwindow object each time, but with different values.
...And 6 more matches
Set a breakpoint - Firefox Developer Tools
there are many different types of breakpoint that can be set in the debugger; this article covers standard (unconditional) breakpoints and conditional breakpoints.
... breakpoints in brief breakpoints are very useful when debugging javascript — you basically set a point in your code where you would like execution of the code to pause.
... the source pane context menu in the source pane, you can handle setting breakpoints by bringing up the context menu over a line number.
...And 6 more matches
AudioListener.setOrientation() - Web APIs
the setorientation() method of the audiolistener interface defines the orientation of the listener.
... syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.setorientation(0,0,-1,0,1,0); returns void.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
...And 6 more matches
Element.setAttribute() - Web APIs
sets the value of an attribute on the specified element.
... syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set.
... the attribute name is automatically converted to all lower-case when setattribute() is called on an html element in an html document.
...And 6 more matches
PannerNode.setVelocity() - Web APIs
the setvelocity() method of the pannernode interface defines the velocity vector of the audio source — how fast it is moving and in what direction.
... syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setvelocity(0,0,17); returns void.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
...And 6 more matches
Range.setEnd() - Web APIs
WebAPIRangesetEnd
the range.setend() method sets the end position of a range to be located at the given offset into the specified node x.setting the end point above (higher in the document) than the start point will result in a collapsed range with the start and end points both set to the specified end position.
... syntax range.setend(endnode, endoffset); parameters endnode the node inside which the range should end.
... endoffset an integer greater than or equal to zero representing the offset for the end of the range from the start of endnode.
...And 6 more matches
WebGLRenderingContext.polygonOffset() - Web APIs
the webglrenderingcontext.polygonoffset() method of the webgl api specifies the scale factors and units to calculate depth values.
... the offset is added before the depth test is performed and before the value is written into the depth buffer.
... syntax void gl.polygonoffset(factor, units); parameters factor a glfloat which sets the scale factor for the variable depth offset for each polygon.
...And 6 more matches
XMLHttpRequest.responseType - Web APIs
the xmlhttprequest property responsetype is an enumerated string value specifying the type of data contained in the response.
...if an empty string is set as the value of responsetype, the default value of text is used.
... syntax var type = xmlhttprequest.responsetype; xmlhttprequest.responsetype = type; value a string taken from the xmlhttprequestresponsetype enum which specifies what type of data the response contains.
...And 6 more matches
border-image-outset - CSS: Cascading Style Sheets
the border-image-outset css property sets the distance by which an element's border image is set out from its border box.
... the parts of the border image that are rendered outside the element's border box with border-image-outset do not trigger overflow scrollbars and don't capture mouse events.
... syntax /* <length> value */ border-image-outset: 1rem; /* <number> value */ border-image-outset: 1.5; /* vertical | horizontal */ border-image-outset: 1 1.2; /* top | horizontal | bottom */ border-image-outset: 30px 2 45px; /* top | right | bottom | left */ border-image-outset: 7px 12px 14px 5px; /* global values */ border-image-outset: inherit; border-image-outset: initial; border-image-outset: unset; the border-image-outset property may be specified as one, two, three, or four values.
...And 6 more matches
counter-reset - CSS: Cascading Style Sheets
the counter-reset css property resets a css counter to a given value.
... syntax /* set "my-counter" to 0 */ counter-reset: my-counter; /* set "my-counter" to -1 */ counter-reset: my-counter -1; /* set "counter1" to 1, and "counter2" to 4 */ counter-reset: counter1 1 counter2 4; /* cancel any reset that could have been set in less specific rules */ counter-reset: none; /* global values */ counter-reset: inherit; counter-reset: initial; counter-reset: unset; the counter-reset property is specified as either one of the following: a <...
...you may specify as many counters to reset as you want, with each name or name-number pair separated by a space.
...And 6 more matches
counter-set - CSS: Cascading Style Sheets
the counter-set css property sets a css counter to a given value.
... syntax /* set "my-counter" to 0 */ counter-set: my-counter; /* set "my-counter" to -1 */ counter-set: my-counter -1; /* set "counter1" to 1, and "counter2" to 4 */ counter-set: counter1 1 counter2 4; /* cancel any counter that could have been set in less specific rules */ counter-set: none; /* global values */ counter-set: inherit; counter-set: initial; counter-set: unset; the counter-set property is specified as either one of the following: a <custom-ident> naming the counter, followed optionally by an <integer>.
... you may specify as many counters to reset as you want, with each name or name-number pair separated by a space.
...And 6 more matches
image-set() - CSS: Cascading Style Sheets
WebCSSimage-set
the image-set() css function notation is a method of letting the browser pick the most appropriate css image from a given set, primarily for high pixel density screens.
...the image-set() function delivers the most appropriate image resolution for a user’s device, providing a set of image options — each with an associated resolution declaration — from which the browser picks the most appropriate for the device and settings.
... image-set() allows the author to provide options rather than determining what each individual user needs.
...And 6 more matches
offset-anchor - CSS: Cascading Style Sheets
the offset-anchor css property specifies the point inside the box of an element travelling along an offset-path that is actually moving along the path.
... syntax /* keyword values */ offset-anchor: top; offset-anchor: bottom; offset-anchor: left; offset-anchor: right; offset-anchor: center; offset-anchor: auto; /* <percentage> values */ offset-anchor: 25% 75%; /* <length> values */ offset-anchor: 0 0; offset-anchor: 1cm 2cm; offset-anchor: 10ch 8em; /* edge offsets values */ offset-anchor: bottom 10px right 20px; offset-anchor: right 3em bottom 10px; /* global values */ offset-anchor: inherit; offset-anchor: initial; offset-anchor: unset; values auto offset-anchor is given the same value as the element's transform-origin, unless offset-path is none, in which case it takes its value from offset-position.
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting various offset-anchor values in the following example, we have three <div> elements nested in <section> elements.
...And 6 more matches
Object.setPrototypeOf() - JavaScript
the object.setprototypeof() method sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or null.
...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.
...until engine developers address this issue, if you are concerned about performance, you should avoid setting the [[prototype]] of an object.
...And 6 more matches
Reflect.setPrototypeOf() - JavaScript
the static reflect.setprototypeof() method is the same method as object.setprototypeof(), except for its return type.
... it sets the prototype (i.e., the internal [[prototype]] property) of a specified object to another object or to null, and returns true if the operation was successful, or false otherwise.
... syntax reflect.setprototypeof(target, prototype) parameters target the target object of which to set the prototype.
...And 6 more matches
JS_SetGCCallback
syntax void js_setgccallback(jsruntime *rt, jsgccallback cb, void *data); jsgccallback js_setgccallback(jscontext *cx, jsgccallback cb); // obsolete since jsapi 13 jsgccallback js_setgccallbackrt(jsruntime *rt, jsgccallback cb); // obsolete since jsapi 13 name type description cx jscontext * (for the old js_setgccallback) any jscontext.
... the gc callback of the associated jsruntime is set.
... rt jsruntime * the jsruntime for which to set the gc callback.
...And 5 more matches
CSSStyleDeclaration.setProperty() - Web APIs
the cssstyledeclaration.setproperty() method interface sets a new value for a property on a css style declaration object.
... syntax style.setproperty(propertyname, value, priority); parameters propertyname is a domstring representing the css property name (hyphen case) to be modified.
... note: value must not contain "!important" -- that should be set using the priority parameter.
...And 5 more matches
CanvasRenderingContext2D.lineDashOffset - Web APIs
the canvasrenderingcontext2d.linedashoffset property of the canvas 2d api sets the line dash offset, or "phase." note: lines are drawn by calling the stroke() method.
... syntax ctx.linedashoffset = value; value a float specifying the amount of the line dash offset.
... examples offsetting a line dash this example draws two dashed lines.
...And 5 more matches
CanvasRenderingContext2D.setTransform() - Web APIs
the canvasrenderingcontext2d.settransform() method of the canvas 2d api resets (overrides) the current transformation to the identity matrix, and then invokes a transformation described by the arguments of this method.
... syntax ctx.settransform(a, b, c, d, e, f); ctx.settransform(matrix); the transformation matrix is described by: [acebdf001]\left[ \begin{array}{ccc} a & c & e \\ b & d & f \\ 0 & 0 & 1 \end{array} \right] parameters settransform() has two types of parameter that it can accept.
... the older type consists of several parameters representing the individual components of the transformation matrix to set: a (m11) horizontal scaling.
...And 5 more matches
ConstantSourceNode.offset - Web APIs
the read-only offset property of the constantsourcenode interface returns a audioparam object indicating the numeric a-rate value which is always returned by the source when asked for the next sample.
... while the audioparam named offset is read-only, the value property within is not.
... so you can change the value of offset by setting the value of constantsourcenode.offset.value: myconstantsourcenode.offset.value = newvalue; syntax let offsetparameter = constantaudionode.offset; let offset = constantsourcenode.offset.value; constantsourcenode.offset.value = newvalue; value an audioparam object indicating the a-rate value returned for every sample by this node.
...And 5 more matches
MediaTrackSettings - Web APIs
the mediatracksettings dictionary is used to return the current values configured for each of a mediastreamtrack's settings.
... these values will adhere as closely as possible to any constraints previously described using a mediatrackconstraints object and set using applyconstraints(), and will adhere to the default constraints for any properties whose constraints haven't been changed, or whose customized constraints couldn't be matched.
... to learn more about how constraints and settings work, see capabilities, constraints, and settings.
...And 5 more matches
Transcoding assets for Media Source Extensions - Web APIs
when working with media source extensions, it is likely that you need to condition your assets before you can stream them.
... this article takes you through the requirements and shows you a toolchain you can use to encode your assets appropriately.
... (optional) if you decide to use dynamic adaptive streaming over http (dash) for adaptive bitrate streaming, you need to transcode your assets into multiple resolutions.
...And 5 more matches
XMLHttpRequest.setRequestHeader() - Web APIs
the xmlhttprequest method setrequestheader() sets the value of an http request header.
... when using setrequestheader(), you must call it after calling open(), but before calling send().
... each time you call setrequestheader() after the first time you call it, the specified text is appended to the end of the existing header's content.
...And 5 more matches
font-feature-settings - CSS: Cascading Style Sheets
the font-feature-settings css property controls advanced typographic features in opentype fonts.
... syntax /* use the default settings */ font-feature-settings: normal; /* set values for opentype feature tags */ font-feature-settings: "smcp"; font-feature-settings: "smcp" on; 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-var...
... these lead to more effective, predictable, understandable results than font-feature-settings, which is a low-level feature designed to handle special cases where no other way exists to enable or access an opentype font feature.
...And 5 more matches
Date.prototype.setYear() - JavaScript
the setyear() method sets the year for a specified date according to local time.
... because setyear() does not set full years ("year 2000 problem"), it is no longer used and has been replaced by the setfullyear() method.
... syntax dateobj.setyear(yearvalue) parameters yearvalue an integer.
...And 5 more matches
Set.prototype.forEach() - JavaScript
the foreach() method executes a provided function once for each value in the set object, in insertion order.
... syntax myset.foreach(callback[, thisarg]) parameters callback function to execute for each element, taking three arguments: currentvalue, currentkey the current element being processed in the set.
... as there are no keys in set, the value is passed for both arguments.
...And 5 more matches
mousethrough - Archive of obsolete content
« xul reference home mousethrough type: one of the values below determines whether mouse events are passed to the element or not.
...if no ancestor has the mousethrough attribute set, the default value is never.
...child elements may override this if they specify mousethrough="never".
...And 4 more matches
HTMLIFrameElement.setVisible()
the setvisible() method of the htmliframeelement is used to change the visibility state of the browser <iframe>.
...if the visible state is set to true, it means that the browser <iframe> should have high priority over the resources needed to render and handle its content.
... on the contrary, if its visible state is set to false, it has low priority over the resources it needs.
...And 4 more matches
JS_SetCheckObjectAccessCallback
set the runtime-wide check-object-access callback.
...in spidermonkey 1.8.1 and later, use js_setruntimesecuritycallbacks instead.
... syntax jscheckaccessop js_setcheckobjectaccesscallback( jsruntime *rt, jscheckaccessop acb); name type description rt jsruntime * the runtime to configure.
...And 4 more matches
JS_SetErrorReporter
syntax jserrorreporter js_geterrorreporter(jsruntime *rt); jserrorreporter js_seterrorreporter(jsruntime *rt, jserrorreporter er); name type description cx jsruntime * pointer to a js runtime whose errors should be reported via your function.
... description js_seterrorreporter enables you to define and use your own error reporting mechanism in your applications.
...js_seterrorreporter js_geterrorreporter returns the value set by js_seterrorreporter.
...And 4 more matches
JS_SetGlobalObject
set a context's global object.
... syntax void js_setglobalobject(jscontext *cx, jsobject *obj); name type description cx jscontext * the context to configure.
... obj jsobject * pointer to the object to set as the global object, or null.
...And 4 more matches
JS_SetInterruptCallback
this article covers features introduced in spidermonkey 31 set a callback function that is automatically called periodically while javascript code runs.
... syntax jsinterruptcallback js_setinterruptcallback(jsruntime *rt, jsinterruptcallback callback); jsinterruptcallback js_getinterruptcallback(jsruntime *rt); void js_requestinterruptcallback(jsruntime *rt); name type description rt jsruntime * the runtime.
...the callback may use this context to call jsapi functions, but it should first use js_setinterruptcallback to set the context's interrupt callback to null.
...And 4 more matches
JS_SetNativeStackQuota
syntax void js_setnativestackquota(jsruntime *cx, size_t systemcodestacksize, size_t trustedscriptstacksize = 0, size_t untrustedscriptstacksize = 0); name type description rt jsruntime * the runtime.
... systemcodestacksize size_t the desired stack quota setting, in bytes.
... trustedscriptstacksize size_t the desired stack quota setting, in bytes for trusted script.
...And 4 more matches
JS_SetPrototype
set a javascript object's prototype.
... syntax bool js_setprototype(jscontext *cx, js::handleobject obj, js::handleobject proto); name type description cx jscontext * the context in which to set the object's prototype.
... proto js::handleobject the object to set as the new prototype of obj.
...And 4 more matches
CanvasPattern.setTransform() - Web APIs
the canvaspattern.settransform() method uses an svgmatrix or dommatrix object as the pattern's transformation matrix and invokes it on the pattern.
... syntax void pattern.settransform(matrix); parameters matrix an svgmatrix or dommatrix to use as the pattern's transformation matrix.
... examples using the settransform method this is just a simple code snippet which uses the settransform method to create a canvaspattern with the specified pattern transformation from an svgmatrix.
...And 4 more matches
CanvasRenderingContext2D.setLineDash() - Web APIs
the setlinedash() method of the canvas 2d api's canvasrenderingcontext2d interface sets the line dash pattern used when stroking lines.
... note: to return to using solid lines, set the line dash list to an empty array.
... 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).
...And 4 more matches
CanvasRenderingContext2D.shadowOffsetX - Web APIs
the canvasrenderingcontext2d.shadowoffsetx property of the canvas 2d api specifies the distance that shadows will be offset horizontally.
... note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
... one of the shadowblur, shadowoffsetx, or shadowoffsety properties must be non-zero, as well.
...And 4 more matches
CanvasRenderingContext2D.shadowOffsetY - Web APIs
the canvasrenderingcontext2d.shadowoffsety property of the canvas 2d api specifies the distance that shadows will be offset vertically.
... note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
... one of the shadowblur, shadowoffsetx, or shadowoffsety properties must be non-zero, as well.
...And 4 more matches
Console.countReset() - Web APIs
the console.countreset() method resets counter used with console.count().
... syntax console.countreset([label]); parameters label optional a string.
... if supplied, countreset() resets the count for that label to 0.
...And 4 more matches
DataTransfer.setData() - Web APIs
the datatransfer.setdata() method sets the drag operation's drag data to the specified data and type.
... syntax void datatransfer.setdata(format, data); arguments format a domstring representing the type of the drag data to add to the drag object.
... return value void example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods.
...And 4 more matches
Element.setPointerCapture() - Web APIs
the setpointercapture() method of the element interface is used to designate a specific element as the capture target of future pointer events.
... note: when pointer capture is set, pointerover, pointerout, pointerenter, and pointerleave events are only generated when crossing the boundary of the capture target.
... syntax targetelement.setpointercapture(pointerid); parameters pointerid the pointerid of a pointerevent object.
...And 4 more matches
HTMLElement.offsetLeft - Web APIs
the htmlelement.offsetleft read-only property returns the number of pixels that the upper left corner of the current element is offset to the left within the htmlelement.offsetparent node.
... for block-level elements, offsettop, offsetleft, offsetwidth, and offsetheight describe the border box of an element relative to the offsetparent.
... however, for inline-level elements (such as span) that can wrap from one line to the next, offsettop and offsetleft describe the positions of the first border box (use element.getclientrects() to get its width and height), while offsetwidth and offsetheight describe the dimensions of the bounding border box (use element.getboundingclientrect() to get its position).
...And 4 more matches
HTMLElement.offsetParent - Web APIs
the htmlelement.offsetparent read-only property returns a reference to the element which is the closest (nearest in the containment hierarchy) positioned ancestor element.
... note: offsetparent returns null in the following situations: the element or its parent element has the display property set to none.
... the element has the position property set to fixed (firefox returns <body>).
...And 4 more matches
HTMLElement.offsetWidth - Web APIs
the htmlelement.offsetwidth read-only property returns the layout width of an element as an integer.
... typically, offsetwidth is a measurement in pixels of the element's css width, including any borders, padding, and vertical scrollbars (if rendered).
... if the element is hidden (for example, by setting style.display on the element or one of its ancestors to "none"), then 0 is returned.
...And 4 more matches
HTMLFormElement: reset event - Web APIs
the reset event fires when a <form> is reset.
... 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.
... html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="reset">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset!
...And 4 more matches
HTMLInputElement.setSelectionRange() - Web APIs
the htmlinputelement.setselectionrange() method sets the start and end positions of the current text selection in an <input> or <textarea> element.
...this lets you indicate, for example, that the selection was set by the user clicking and dragging from the end of the selected text toward the beginning.
... note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password.
...And 4 more matches
Headers.set() - Web APIs
WebAPIHeadersset
the set() method of the headers interface sets a new value for an existing header inside a headers object, or adds the header if it does not already exist.
... the difference between set() and headers.append is that if the specified header already exists and accepts multiple values, set() overwrites the existing value with the new one, whereas headers.append appends the new value to the end of the set of values.
... syntax myheaders.set(name, value); parameters name the name of the http header you want to set to a new value.
...And 4 more matches
ImageCapture.getPhotoSettings() - Web APIs
the getphotosettings() method of the imagecapture interface returns a promise that resolves with a photosettings object containing the current photo configuration settings.
... syntax const settingspromise = imagecapture.getphotosettings() return value a promise that resolves with a photosettings object containing the following properties: filllightmode: the flash setting of the capture device, one of "auto", "off", or "on".
...the user agent selects the closest width value to this setting if it only supports discrete heights.
...And 4 more matches
MediaSession.setActionHandler() - Web APIs
the setactionhandler() property of the mediasession interface sets an event handler for a media session action.
... syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for.
... description to remove a previously-established action handler, call setactionhandler() again, specifying null as the callback.
...And 4 more matches
Node.setUserData() - Web APIs
WebAPINodesetUserData
the node.setuserdata() method allows a user to attach (or remove) data to an element, without needing to modify the dom.
... the node.getuserdata and node.setuserdata methods are no longer available from web content.
... htmlelement.dataset or weakmap can be used instead.
...And 4 more matches
OscillatorNode.setPeriodicWave() - Web APIs
the setperiodicwave() method of the oscillatornode interface is used to point to a periodicwave defining a periodic waveform that can be used to shape the oscillator's output, when type is custom.
... this replaces the now-obsolete oscillatornode.setwavetable().
... syntax oscillatornode.setperiodicwave(wave); parameters wave a periodicwave object representing the waveform to use as the shape of the oscillator's output.
...And 4 more matches
RTCRtpSender.setParameters() - Web APIs
the setparameters() method of the rtcrtpsender interface applies changes the configuration of sender's track, which is the mediastreamtrack for which the rtcrtpsender is responsible.
... in other words, setparameters() updates the configuration of the rtp transmission as well as the encoding configuration for a specific media track on the webrtc connection.
... syntax var promise = rtcrtpsender.setparameters(parameters) parameters parameters an object conforming with the rtcrtpsendparameters dictionary, specifying options for the rtcrtpsender; these include potential codecs that could be use for encoding the sender's track.
...And 4 more matches
RTCRtpTransceiver.setCodecPreferences() - Web APIs
the rtcrtptransceiver method setcodecpreferences() configures the transceiver's codecs given a list of rtcrtpcodeccapability objects specifying the new preferences for each codec.
... the specified set of codecs and configurations will be used for all future connections including this transceiver until this method is called again.
... when preparing to open an rtcpeerconnection, you can change the codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer().
...And 4 more matches
SVGFEOffsetElement - Web APIs
the svgfeoffsetelement interface corresponds to the <feoffset> element.
...,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgelement</text></a><polyline points="481,25 491,20 491,30 481,25" stroke="#d4dde4" fill="none"/><line x1="491" y1="25" x2="499" y2="25" stroke="#d4dde4"/><line x1="499" y1="25" x2="499" y2="90" stroke="#d4dde4"/><line x1="499" y1="90" x2="482" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svgfeoffsetelement" target="_top"><rect x="301" y="65" width="180" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="391" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgfeoffsetelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this int...
... svgfeoffsetelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element.
...And 4 more matches
font-variation-settings - CSS: Cascading Style Sheets
the font-variation-settings css property provides low-level control over variable font characteristics, by specifying the four letter axis names of the characteristics you want to vary, along with their values.
... syntax /* use the default settings */ font-variation-settings: normal; /* set values for variable font axis names */ font-variation-settings: "xhgt" 0.7; /* global values */ font-variation-settings: inherit; font-variation-settings: initial; font-variation-settings: unset; values this property's value can take one of two forms: normal text is laid out using default settings.
...each setting is always one or more pairs consisting of a <string> of 4 ascii characters followed by a <number> indicating the axis value to set.
...And 4 more matches
offset - CSS: Cascading Style Sheets
WebCSSoffset
the offset css shorthand property sets all the properties required for animating an element along a defined path.
... constituent properties this property is a shorthand for the following css properties: offset-anchor offset-distance offset-path offset-position offset-rotate syntax /* offset position */ offset: auto; offset: 10px 30px; offset: none; /* offset path */ offset: ray(45deg closest-side); offset: path('m 100 100 l 300 100 l 200 300 z'); offset: url(arc.svg); /* offset path with distance and/or rotation */ offset: url(circle.svg) 100px; offset: url(circle.svg) 40%; offset: url(circle.svg) 30deg; offset: url(circle.svg) 50px 20deg; /* including offset anchor */ offset: ray(45deg closest-side) / 40px 20px; offset: url(arc.svg) 2cm / 0.5cm 3cm; offset: url(arc.svg) 30deg / 50px 100px; formal definition initial valueas ...
...each of the properties of the shorthand:offset-position: autooffset-path: noneoffset-distance: 0offset-anchor: autooffset-rotate: autoapplies totransformable elementsinheritednopercentagesas each of the properties of the shorthand:offset-position: refertosizeofcontainingblockoffset-distance: refer to the total path lengthoffset-anchor: relativetowidthandheightcomputed valueas each of the properties of the shorthand:offset-position: for <length> the absolute value, otherwise a percentageoffset-path: as specifiedoffset-distance: for <length> the absolute value, otherwise a percentageoffset-anchor: for <length> the absolute value, otherwise a percentageoffset-rotate: as specifiedanimation typeas each of the properties of the shorthand:offset-position: a positionoffset-path: as <angle>, <basic-sh...
...And 4 more matches
set:difference() - EXSLT
WebEXSLTsetdifference
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:difference() returns the difference between two node-sets.
... in other words, it returns a node-set whose nodes are in one node-set but not in the other.
... the template version of set:difference applies templates to these nodes in set:difference mode, copying the nodes so that a result tree fragment consisting of the nodes is returned.
...And 4 more matches
set:leading() - EXSLT
WebEXSLTsetleading
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:leading() returns the nodes in one node-set that come before the first node in the other node-set.
... syntax set:leading(nodeset1, nodeset2) parameters nodeset1 the node set to find nodes in that precede the first node in the second node set.
... nodeset2 the node set to compare against.
...And 4 more matches
set:trailing() - EXSLT
WebEXSLTsettrailing
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:trailing() returns the nodes in one node-set that come after the first node in the other node-set.
... syntax set:trailing(nodeset1, nodeset2) parameters nodeset1 the node set to find nodes in that follow the first node in the second node set.
... nodeset2 the node set to compare against.
...And 4 more matches
Setting up adaptive streaming media sources - Developer guides
let's say you want to set up an adaptive streaming media source on a server, to be consumed inside an html5 media element.
... ondemand profile this profile will allow switching between streams 'on demand' - that is to say that you only need provide a set of contiguous files and specify the bandwidth for each one and the appropriate file will be chosen automatically.
...pd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011 dash-mpd.xsd" type="static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <baseurl>http://example.com/ondemand/</baseurl> <period> <!-- english audio --> <adaptationset mimetype="audio/mp4" codecs="mp4a.40.5" lang="en" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="1" bandwidth="64000"> <baseurl>elephantsdream_aac48k_064.mp4.dash</baseurl> </representation> </adaptationset> <!-- video --> <adaptationset mimetype="video/mp4" codecs="avc1.42401e" subsegmentalignment="true" subsegmentstartswithsap="1"> ...
...And 4 more matches
Accept-Charset - HTTP
the accept-charset request http header advertises which character encodings the client understands.
... using content negotiation, the server selects one of the encodings, uses it, and informs the client of its choice within the content-type response header, usually in a charset= parameter.
...but for a better user experience, this is rarely done and the accept-charset header is ignored.
...And 4 more matches
Date.prototype.getTimezoneOffset() - JavaScript
the gettimezoneoffset() method returns the time zone difference, in minutes, from current locale (host system settings) to utc.
... syntax dateobj.gettimezoneoffset() return value a number representing the time-zone offset, in minutes, from the date based on current host system settings to utc.
... description the time-zone offset is the difference, in minutes, from local time to utc.
...And 4 more matches
Date.prototype.setDate() - JavaScript
the setdate() method sets the day of the date object relative to the beginning of the currently set month.
... syntax dateobj.setdate(dayvalue) parameters dayvalue an integer representing the day of the month.
... description if the dayvalue is outside of the range of date values for the month, setdate() will update the date object accordingly.
...And 4 more matches
stroke-dashoffset - SVG: Scalable Vector Graphics
the stroke-dashoffset attribute is a presentation attribute defining an offset on the rendering of the associated dash array.
... note: as a presentation attribute stroke-dashoffset can be used as a css property.
...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 pulled by 3 user units --> <line x1="0" y1="5" x2="30" y2="5" stroke="black" stroke-dasharray="3 1" stroke-dashoffset="3" /> <!-- the start of the dash array computation is pushed by 3 user units --> <line x1="0" y1="7" x...
...And 4 more matches
setValue - Archive of obsolete content
setvalue netscape 6 and mozilla do not currently support this method.
... sets the value of an arbitrary key.
... method of winreg object syntax string setvalue ( string subkey, string valname, winregvalue value); parameters the setvalue method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...And 3 more matches
NPSetWindowCallbackStruct - Archive of obsolete content
syntax typedef struct { int32 type; display* display; visual* visual; colormap colormap; unsigned int depth; } npsetwindowcallbackstruct; fields the data structure has the following fields: type always contains np_setwindow.
...the npsetwindowcallbackstruct object, allocated by the browser, contains information required for the ws_info field of an npwindow.
... the npp_setwindow() function passes a pointer to this structure to the plug-in.
...And 3 more matches
JS_SetBranchCallback
replaced with js_setoperationcallback.
... syntax jsbranchcallback js_setbranchcallback(jscontext *cx, jsbranchcallback cb); name type description cx jscontext * the context to hook.
...this is guaranteed to be non-null, unless the jsoption_native_branch_callback option has been enabled for the context cx using js_setoptions().
...And 3 more matches
JS_SetObjectPrincipalsFinder
set the runtime-wide object-principals-finder callback.
...in spidermonkey 1.8.1 or later, use js_setruntimesecuritycallbacks instead.
... syntax jsobjectprincipalsfinder js_setobjectprincipalsfinder(jsruntime *rt, jsobjectprincipalsfinder fop); name type description rt jsruntime * the runtime to configure.
...And 3 more matches
JS_SetPrincipalsTranscoder
set the runtime-wide principals transcoder callback.
...in spidermonkey 1.8.1 or later, use js_setruntimesecuritycallbacks instead.
... syntax jsprincipalstranscoder js_setprincipalstranscoder(jsruntime *rt, jsprincipalstranscoder px); name type description rt jsruntime * the runtime to configure.
...And 3 more matches
JS_SetPrivate
sets the private data field of an object.
... syntax void js_setprivate(jsobject *obj, void *data); name type description obj jsobject * object for which to set private data.
...js_setprivate sets an object's private data field.
...And 3 more matches
JS_SetRegExpInput
set the pending regexp input.
... syntax bool js_setregexpinput(jscontext *cx, js::handleobject obj, js::handlestring input, bool multiline); name type description cx jscontext * the context.
... description js_setregexpinput sets the pending input string of the built-in regexp object to the specified input string.
...And 3 more matches
JS_SetScriptStackQuota
set the maximum amount of memory a context will use for certain data structures.
... syntax void js_setscriptstackquota(jscontext *cx, size_t quota); name type description cx jscontext * the context to configure.
... quota size_t the desired stack quota setting, in bytes.
...And 3 more matches
Tutorial: Set a breakpoint - Firefox Developer Tools
we use debugger to set a breakpoint in a function, and then evaluate an expression whenever it is hit.
...var reportdo = windowdo.getownpropertydescriptor('report').value; // set a breakpoint at the entry point of `report`.
... reportdo.script.setbreakpoint(0, { hit: function (frame) { console.log('hit breakpoint in ' + frame.callee.name); console.log('what = ' + frame.eval('what').return); } }); console.log('finished setting breakpoint!'); in the scratchpad, ensure that no text is selected, and press the “run” button.
...And 3 more matches
AudioParam.setTargetAtTime() - Web APIs
the settargetattime() method of the audioparam interface schedules the start of a gradual change to the audioparam value.
... syntax var paramref = param.settargetattime(target, starttime, timeconstant); parameters target the value the parameter will start to transition towards at the given start time.
... depending on your use case, getting 95% toward the target value may already be enough; in that case, you could set timeconstant to one third of the desired duration.
...And 3 more matches
AudioParam.setValueCurveAtTime() - Web APIs
the setvaluecurveattime() method of the audioparam interface schedules the parameter's value to change following a curve defined by a list of values.
... syntax var paramref = param.setvaluecurveattime(values, starttime, duration); parameters values an array of floating-point numbers representing the value curve the audioparam will change through along the specified duration.
... usage notes when the parameter's value finishes following the curve, its value is guaranteed to match the last value in the set of values specified in the values parameter.
...And 3 more matches
Document.lastStyleSheetSet - Web APIs
the document.laststylesheetset property returns the last enabled style sheet set.
... this property's value changes whenever the document.selectedstylesheetset property is changed.
... syntax var laststylesheetset = document.laststylesheetset on return, laststylesheetset indicates the style sheet set that was most recently set.
...And 3 more matches
FontFaceSetLoadEvent - Web APIs
the fontfacesetloadevent interface of the the css font loading api is fired whenever a fontfaceset loads.
... constructor fontfacesetloadevent() creates a new fontfacesetloadevent object.
... properties fontfacesetloadevent.fontfacesread only returns an array of fontface instances each of which represents a single usable font.
...And 3 more matches
GlobalEventHandlers.onreset - Web APIs
the onreset property of the globaleventhandlers mixin is an eventhandler that processes reset events.
... the reset event fires when the user clicks a reset button in a form (<input type="reset">).
... syntax target.onreset = functionref; value functionref is a function name or a function expression.
...And 3 more matches
HTMLElement.offsetTop - Web APIs
the htmlelement.offsettop read-only property returns the distance of the current element relative to the top of the offsetparent node.
... syntax toppos = element.offsettop; parameters toppos is the number of pixels from the top of the closest relatively positioned parent element.
... example var d = document.getelementbyid("div1"); var toppos = d.offsettop; if (toppos > 10) { // object is offset more // than 10 pixels from its parent } specification specification status comment css object model (cssom) view modulethe definition of 'offsettop' in that specification.
...And 3 more matches
MediaSettingsRange - Web APIs
the mediasettingsrange interface of the the mediastream image capture api provides the possible range and value size of photocapabilities.imageheight and photocapabilities.imagewidth.
... properties mediasettingsrange.max returns the maximum value of this settings.
... mediasettingsrange.min returns the minimum value of this setting.
...And 3 more matches
RTCRtpSender.setStreams() - Web APIs
the rtcrtpsender method setstreams() associates the sender's track with the specified mediastream or array of mediastream objects.
... syntax rtcrtpsender.setstreams(mediastream); rtcrtpsender.setstreams([mediastream...]); parameters mediastream or [mediastream...] optional an mediastream object—or an array of multiple mediastream objects—identifying the streams to which the rtcrtpsender's track belongs.
... description setstreams() is purely additive.
...And 3 more matches
Range.endOffset - Web APIs
WebAPIRangeendOffset
the range.endoffset read-only property returns a number representing where in the range.endcontainer the range ends.
... if the endcontainer is a node of type text, comment, or cdatasection, then the offset is the number of characters from the start of the endcontainer to the boundary point of the range.
... for other node types, the endoffset is the number of child nodes between the start of the endcontainer and the boundary point of the range.
...And 3 more matches
Range.startOffset - Web APIs
WebAPIRangestartOffset
the range.startoffset read-only property returns a number representing where in the startcontainer the range starts.
... if the startcontainer is a node of type text, comment, or cdatasection, then the offset is the number of characters from the start of the startcontainer to the boundary point of the range.
... for other node types, the startoffset is the number of child nodes between the start of the startcontainer and the boundary point of the range.
...And 3 more matches
Storage.setItem() - Web APIs
WebAPIStoragesetItem
the setitem() method of the storage interface, when passed a key name and value, will add that key to the given storage object, or update that key's value if it already exists.
... syntax storage.setitem(keyname, keyvalue); parameters keyname a domstring containing the name of the key you want to create/update.
... exceptions setitem() may throw an exception if the storage is full.
...And 3 more matches
URLSearchParams.set() - Web APIs
the set() method of the urlsearchparams interface sets the value associated with a given search parameter to the given value.
... syntax urlsearchparams.set(name, value) parameters name the name of the parameter to set.
... value the value of the parameter to set.
...And 3 more matches
Window.setImmediate() - Web APIs
syntax var immediateid = setimmediate(func, [param1, param2, ...]); var immediateid = setimmediate(func); where immediateid is the id of the immediate which can be used later with window.clearimmediate.
... notes the clearimmediate method can be used to clear the immediate actions, just like cleartimeout for settimeout.
... this method can be used instead of the settimeout(fn, 0) method to execute heavy operations.
...And 3 more matches
XMLHttpRequest.responseText - Web APIs
the read-only xmlhttprequest property responsetext returns the text received from a server following a request being sent.
... syntax var resulttext = xmlhttprequest.responsetext; value a domstring which contains either the textual data received using the xmlhttprequest or null if the request failed or "" if the request has not yet been sent by calling send().
... while handling an asynchronous request, the value of responsetext always has the current content received from the server, even if it's incomplete because the data has not been completely received yet.
...And 3 more matches
offset-distance - CSS: Cascading Style Sheets
the offset-distance css property specifies a position along an offset-path for an element to be placed.
... syntax /* default value */ offset-distance: 0; /* the middle of the offset-path */ offset-distance: 50%; /* a fixed length positioned along the path */ offset-distance: 40px; <length-percentage> a length that specifies how far the element is along the path (defined with offset-path).
... 100% represents the total length of the path (when the offset-path is defined as a basic shape or path()).
...And 3 more matches
set:intersection() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:intersection() returns the intersection of two node-sets.
... in other words, it returns a node-set containing all the nodes that exits in both nodeset1 and nodeset2.
... syntax set:intersection(nodeset1, nodeset2) arguments nodeset1 the first node-set.
...And 3 more matches
TypeError: setting getter-only property "x" - JavaScript
the javascript strict mode-only exception "setting getter-only property" occurs when there is an attempt to set a new value to a property for which only a getter is specified.
... message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: setting getter-only property "x" (firefox) typeerror: cannot set property "prop" of #<object> which has only a getter (chrome) error type typeerror in strict mode only.
... there is an attempt to set a new value to a property for which only a getter is specified.
...And 3 more matches
Object.prototype.__defineSetter__() - JavaScript
this feature is deprecated in favor of defining setters using the object initializer syntax or the object.defineproperty() api.
... the __definesetter__ method binds an object's property to a function to be called when an attempt is made to set that property.
... syntax obj.__definesetter__(prop, fun) parameters prop a string containing the name of the property to be bound to the given function.
...And 3 more matches
Object.prototype.__lookupSetter__() - JavaScript
the __lookupsetter__ method returns the function bound as a setter to the specified property.
... syntax obj.__lookupsetter__(sprop) parameters sprop a string containing the name of the property whose setter should be returned.
... return value the function bound as a setter to the specified property.
...And 3 more matches
TypedArray.prototype.set() - JavaScript
the set() method stores multiple values in the typed array, reading input values from a specified array.
... syntax typedarray.set(array[, offset]) typedarray.set(typedarray[, offset]) parameters array the array from which to copy values.
... all values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown.
...And 3 more matches
startOffset - SVG: Scalable Vector Graphics
the startoffset attribute defines an offset from the start of the path for the initial current text position along the path after converting the path to the <textpath> element's coordinate system.
...{ height:100% } <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <path id="path1" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <path id="path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <textpath href="#path1" startoffset="0"> quick brown fox jumps over the lazy dog.
... </textpath> </text> <text> <textpath href="#path2" startoffset="40"> quick brown fox jumps over the lazy dog.
...And 3 more matches
setPackageFolder - Archive of obsolete content
setpackagefolder sets the default package folder.
... method of install object syntax void setpackagefolder ( object folder); parameters the setpackagefolder method has the following parameter: folder an object representing a directory.
...description the setpackagefolder method to set the default package folder that is saved with the root node.
...And 2 more matches
setRootKey - Archive of obsolete content
setrootkey changes the root key being accessed.
... method of winreg object syntax void setrootkey ( int key ); parameters the method has the following parameter: key an integer representing a root key in the registry.
...description the setrootkey changes the root key.
...And 2 more matches
setValueNumber - Archive of obsolete content
summary sets the value of a key, when that value is a number.
... method of winreg object syntax int setvaluenumber ( string subkey, string valname, number value ); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
... description the setvaluenumber method sets the value of a key when that value is a number.
...And 2 more matches
setValueString - Archive of obsolete content
setvaluestring sets the value of a key, when that value is a string.
... method of winreg object syntax int setvaluestring ( string subkey, string valname, string value); parameters the method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
...description the setvaluestring method sets the value of a key when that value is a string.
...And 2 more matches
keyset - Archive of obsolete content
the keyset and its descendants are not displayed.
... attributes disabled examples <keyset> <key id="sample-key" modifiers="shift" key="r"/> </keyset> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width disabled type: boolean indicates whether the element is ...
...if this attribute is set, the element is disabled.
...And 2 more matches
NPN_SetProperty - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary sets the value of a property on the specified npobject.
... syntax #include <npruntime.h> bool npn_setproperty(npp npp, npobject *npobj, npidentifier propertyname, const npvariant *value); parameters the function has the following parameters: <tt>npp</tt> the npp indicating which plugin instance's is making the request.
... <tt>npobj</tt> the object on which a value is to be set.
...And 2 more matches
Debug.setNonUserCodeExceptions - Archive of obsolete content
the debug.setnonusercodeexceptions property determines whether any try-catch blocks in this scope are to be treated by the debugger as user-unhandled.
... syntax debug.setnonusercodeexceptions [= bool]; remarks if this property is set to true within a given scope, the debugger can then choose whether to take some specified action on exceptions thrown inside that scope: for instance, if the developer wishes to break on user-unhandled exceptions.
... setting this property to false is the same as never having set the property.
...And 2 more matches
Setting up the infrastructure
first, make your project's file type decision (see localization formats for details): html/php .lang gettext (.po) assuming you chose gettext, you'll need to follow the steps below to set up the infrastructure for localizing your web application.
...on the staging server you can also choose to set up a cronjob that will run compile-mo.sh every n minutes.
... set up the staging server.
...And 2 more matches
FC_SetAttributeValue
name fc_setattributevalue - set the values of attributes of an object.
... syntax ck_rv fc_setattributevalue( ck_session_handle hsession, ck_object_handle hobject, ck_attribute_ptr ptemplate, ck_ulong uscount ); parameters hsession [in] session handle.
... description fc_setattributevalue sets the value of one or more attributes of an object.
...And 2 more matches
FC_SetOperationState
name fc_setoperationstate - restore the cryptographic operation state of a session.
... syntax ck_rv fc_setoperationstate( ck_session_handle hsession, ck_byte_ptr poperationstate, ck_ulong uloperationstatelen, ck_object_handle hencryptionkey, ck_object_handle hauthenticationkey ); parameters hsession [in] handle of the open session.
... description fc_setoperationstate restores the cryptographic operations state of a session from an array of bytes obtained with fc_getoperationstate.
...And 2 more matches
FC_SetPIN
name fc_setpin - modify the user's pin.
... syntax ck_rv fc_setpin( ck_session_handle hsession, ck_char_ptr poldpin, ck_ulong uloldlen, ck_char_ptr pnewpin, ck_ulong ulnewlen ); parameters fc_setpin takes five parameters: hsession [input] the session's handle poldpin [input] points to the old pin.
... description fc_setpin modifies the pin of the user.
...And 2 more matches
JS::SetLargeAllocationFailureCallback
syntax void js::setlargeallocationfailurecallback(jsruntime *rt, js::largeallocationfailurecallback afc, void *data); name type description rt jsruntime * the jsruntime for which to set the gc callback.
...added in spidermonkey 38 callback syntax typedef void (* js::largeallocationfailurecallback)(void *data); name type description data void * data parameter passed to js::setlargeallocationfailurecallback.
... added in spidermonkey 38 description if a large allocation fails when calling pod_{calloc,realloc}cangc, the js engine may call the large-allocation- failure callback, if set, to allow the embedding to flush caches, possibly perform shrinking gcs, etc.
...And 2 more matches
JSObjectOps.setProto
the jsobjectops.setproto and setparent callbacks implement the js_setprototype and js_setparent functions.
... these callbacks share the same type, jssetobjectslotop.
... syntax typedef jsbool (*jssetobjectslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsobject *pobj); name type description cx jscontext * pointer to the js context in which the object's prototype or parent is being modified.
...And 2 more matches
JS_SetContextCallback
syntax void js_setcontextcallback(jsruntime *rt, jscontextcallback cxcallback, void *data); name type description rt jsruntime * pointer to a js runtime.
...for example, the callback my call js_getcontextprivate(cx) in order to free up resources previously allocated by js_setcontextprivate.
... data void * data specified in js_setcontextcallback.
...And 2 more matches
JS_SetDefaultLocale
this article covers features introduced in spidermonkey 24 set and reset the default locale for the ecmascript internationalization api.
... syntax bool js_setdefaultlocale(jsruntime *rt, const char *locale); void js_resetdefaultlocale(jsruntime *rt); name type description rt jsruntime * pointer to a js runtime locale const char * string represents locale.
... description js_setdefaultlocale sets the default locale for the ecmascript internationalization api (intl.collator, intl.numberformat, intl.datetimeformat).
...And 2 more matches
JS_SetFunctionCallback
sets a callback to be run whenever a javascript function is invoked or exited.
... syntax void js_setfunctioncallback(jscontext *cx, jsfunctioncallback fcb); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... description js_setfunctioncallback sets a c function to be called each time a javascript function is invoked or exits.
...And 2 more matches
JS_SetThreadStackLimit
this is deprecated, use js_setnativestackquota instead.
... syntax void js_setthreadstacklimit(jscontext *cx, jsuword limitaddr) name type description cx jscontext * the context to configure.
... description js_setthreadstacklimit sets the maximum (if stack grows upward) or minimum (downward) legal stack byte address in limitaddr for the thread or process stack used by cx.
...And 2 more matches
JS_SetVersion
syntax jsversion js_setversion(jscontext *cx, jsversion version); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... version jsversion version of javascript to set context to.
... description js_setversion attempts to set the version of javascript to version for a specified executable script context, cx.
...And 2 more matches
AudioParam.setValueAtTime() - Web APIs
the setvalueattime() method of the audioparam interface schedules an instant change to the audioparam value at a precise time, as measured against audiocontext.currenttime.
... syntax var audioparam = audioparam.setvalueattime(value, starttime) parameters value a floating point number representing the value the audioparam will change to at the given time.
...when the buttons are pressed, the currgain variable is incremented/decremented by 0.25, then the setvalueattime() method is used to set the gain value equal to currgain, one second from now (audioctx.currenttime + 1.) // create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.query...
...And 2 more matches
CanvasRenderingContext2D.resetTransform() - Web APIs
the canvasrenderingcontext2d.resettransform() method of the canvas 2d api resets the current transform to the identity matrix.
... syntax void ctx.resettransform(); examples resetting the matrix this example draws a rotated rectangle after modifying the matrix, and then resets the matrix using the resettransform() method.
... const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // draw a rotated rectangle ctx.rotate(45 * math.pi / 180); ctx.fillrect(60, 0, 100, 30); // reset transformation matrix to the identity matrix ctx.resettransform(); result continuing with a regular matrix whenever you're done drawing transformed shapes, you should call resettransform() before rendering anything else.
...And 2 more matches
DataTransfer.mozSetDataAt() - Web APIs
the datatransfer.mozsetdataat() method is used to add data to a specific index in the drag event's data transfer object.
...mozsetdataat() may only be called with an index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one.
... syntax void datatransfer.mozsetdataat([type], data, index); arguments type a string representing the type of the drag data to add to the drag data object.
...And 2 more matches
Document.characterSet - Web APIs
the document.characterset read-only property returns the character encoding of the document that it's currently rendered with.
... (a character encoding is a set of characters and how to interpret bytes into those characters.) a “character set” and a “character encoding” are related, but different.
... users can override the developer-specified encoding inside the content-type header or inline like <meta charset="utf-8">, such as with firefox's view → text encoding menu.
...And 2 more matches
Document.mozSetImageElement() - Web APIs
the document.mozsetimageelement() method changes the element being used as the css background for a background with a given background element id.
... syntax document.mozsetimageelement(imageelementid, imageelement); parameters imageelementid is a string indicating the name of an element that has been specified as a background image using the -moz-element css function.
... var c = 0x00; function clicked() { var canvas = document.createelement("canvas"); canvas.setattribute("width", 100); canvas.setattribute("height", 100); var ctx = canvas.getcontext('2d'); ctx.fillstyle = "#" + c.tostring(16) + "0000"; ctx.fillrect(25, 25, 75, 75); c += 0x11; if (c > 0xff) { c = 0x00; } document.mozsetimageelement("canvasbg", canvas); } the code here is called each time the user clicks the <div> element.
...And 2 more matches
Document.selectedStyleSheetSet - Web APIs
the selectedstylesheetset property indicates the name of the style sheet set that's currently in use.
... syntax currentstylesheetset = document.selectedstylesheetset; document.selectedstylesheet = newstylesheetset; on return, currentstylesheetset indicates the name of the style sheet set currently in use.
... you can also set the current style sheet set using this property.
...And 2 more matches
Element.setAttributeNS() - Web APIs
setattributens adds a new attribute or changes the value of an attribute with the given namespace and name.
... syntax element.setattributens(namespace, name, value) namespace is a string specifying the namespace of the attribute.
... example let d = document.getelementbyid('d1'); d.setattributens('http://www.mozilla.org/ns/specialspace', 'spec:align', 'center'); notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (...
...And 2 more matches
Element.setAttributeNode() - Web APIs
the setattributenode() method adds a new attr node to the specified element.
... syntax var replacedattr = element.setattributenode(attribute); attribute is the attr node to set on the element.
... html <div id="one" align="left">one</div> <div id="two">two</div> javascript let d1 = document.getelementbyid('one'); let d2 = document.getelementbyid('two'); let a = d1.getattributenode('align'); d2.setattributenode(a.clonenode(true)); // returns: 'left' alert(d2.attributes[1].value); notes if the attribute named already exists on the element, that attribute is replaced with the new one and the replaced one is returned.
...And 2 more matches
Element.setAttributeNodeNS() - Web APIs
setattributenodens adds a new namespaced attribute node to an element.
... syntax replacedattr = element.setattributenodens(attributenode) replacedattr is the replaced attribute node, if any, returned by this function.
... example // <div id="one" xmlns:myns="http://www.mozilla.org/ns/specialspace" // myns:special-align="utterleft">one</div> // <div id="two">two</div> var myns = "http://www.mozilla.org/ns/specialspace"; var d1 = document.getelementbyid("one"); var d2 = document.getelementbyid("two"); var a = d1.getattributenodens(myns, "special-align"); d2.setattributenodens(a.clonenode(true)); alert(d2.attributes[1].value) // returns: `utterleft' notes if the specified attribute already exists on the element, then that attribute is replaced with the new one and the replaced one is returned.
...And 2 more matches
HTMLFormElement.reset() - Web APIs
the htmlformelement.reset() method restores a form element's default values.
... this method does the same thing as clicking the form's reset button.
... if a form control (such as a reset button) has a name or id of reset it will mask the form's reset method.
...And 2 more matches
HTMLFrameSetElement - Web APIs
the htmlframesetelement interface provides special properties (beyond those of the regular htmlelement interface they also inherit) for manipulating <frameset> elements.
... htmlframesetelement.cols is a domstring structured as a comma-seperated list specifing the width of each column inside a frameset.
... htmlframesetelement.rows is a domstring structured as a comma-seperated list specifing the height of each column inside a frameset.
...And 2 more matches
HTMLInputElement.setRangeText() - Web APIs
the htmlinputelement.setrangetext() method replaces a range of text in an <input> or <textarea> element with a new string.
... syntax element.setrangetext(replacement); element.setrangetext(replacement, start, end [, selectmode]); parameters replacement the string to insert.
... selectmode optional a string defining how the selection should be set after the text has been replaced.
...And 2 more matches
HTMLObjectElement.setCustomValidity - Web APIs
the setcustomvalidity() method of the htmlobjectelement interface sets a custom validity message for the element.
... syntax htmlobjectelement.setcustomvalidity(message); parameters error the message to use for validity errors.
... examples in this example, we pass the id of an input element, and set different error messages depending on whether the value is missing, too low or too high.
...And 2 more matches
MediaSession.setPositionState() - Web APIs
the mediasession method setpositionstate() is used to update the current document's media playback position and speed for presentation by user's device in any kind of interface that provides details about ongoing media.
... syntax navigator.mediasession.setpositionstate(statedict); parameters statedict optional an object conforming to the mediapositionstate dictionary, providing updated information about the playback position and speed of the document's ongoing media.
... example in this example, a player for a non-standard media file format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position information by calling setpositionstate().
...And 2 more matches
MediaStreamTrack.getSettings() - Web APIs
the getsettings() method of the mediastreamtrack interface returns a mediatracksettings object containing the current values of each of the constrainable properties for the current mediastreamtrack.
... see capabilities, constraints, and settings for details on how to work with constrainable properties.
... syntax const settings = track.getsettings() returns a mediatracksettings object describing the current configuration of the track's constrainable properties.
...And 2 more matches
MediaTrackSettings.groupId - Web APIs
the mediatracksettings dictionary's groupid property is a browsing-session unique domstring which identifies the group of devices which includes the source for the mediastreamtrack.
... syntax var groupid = mediatracksettings.groupid; value a domstring whose value is a browsing-session unique identifier for a group of devices which includes the source of the track's contents.
...for example, a headset has two devices on it: a microphone which can serve as a source for audio tracks and a speaker which can serve as an output for audio.
...And 2 more matches
performance.setResourceTimingBufferSize() - Web APIs
the setresourcetimingbuffersize() method sets the browser's resource timing buffer size to the specified number of "resource" performance entry type objects.
... syntax performance.setresourcetimingbuffersize(maxsize); arguments maxsize a number representing the maximum number of performance entry objects the browser should hold in its performance entry buffer.
... example function setresourcetimingbuffersize(maxsize) { if (performance === undefined) { log("browser does not support web performance"); return; } var supported = typeof performance.setresourcetimingbuffersize == "function"; if (supported) { log("...
...And 2 more matches
SourceBuffer.timestampOffset - Web APIs
the timestampoffset property of the sourcebuffer interface controls the offset applied to timestamps inside media segments that are appended to the sourcebuffer.
... the initial value of timestampoffset is 0.
... syntax var myoffset = sourcebuffer.timestampoffset; sourcebuffer.timestampoffset = 2.5; value a double, with the offset amount expressed in seconds.
...And 2 more matches
WebGL2RenderingContext.pauseTransformFeedback() - Web APIs
the webgl2renderingcontext.pausetransformfeedback() method of the webgl 2 api pauses a transform feedback operation.
... syntax void gl.pausetransformfeedback(); parameters none.
... examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.pausetransformfeedback(); //...
...And 2 more matches
offset-position - CSS: Cascading Style Sheets
the offset-position css property defines the initial position of the offset-path.
... syntax /* keyword values */ offset-position: auto; offset-position: top; offset-position: bottom; offset-position: left; offset-position: right; offset-position: center; /* <percentage> values */ offset-position: 25% 75%; /* <length> values */ offset-position: 0 0; offset-position: 1cm 2cm; offset-position: 10ch 8em; /* edge offsets values */ offset-position: bottom 10px right 20px; offset-position: right 3em bottom 10px; offset-position: bottom 10px right; offset-position: top right 10px; /* global values */ offset-position: inherit; offset-position: initial; offset-position: unset; values auto the initial position is the position of the box specified by the position property.
...if three or four values are used, the length-percentage values are offsets for the preceding keyword value(s).
...And 2 more matches
exsl:node-set() - EXSLT
WebEXSLTexslnode-set
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value.
... you can also use exsl:node-set() to turn strings into text nodes.
... syntax exsl:node-set(object) parameters object the object for which to return the corresponding node-set.
...And 2 more matches
set:has-same-node() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:has-same-node() determines whether two node-sets have any nodes in common.
... syntax set:has-same-node(nodeset1, nodeset2) parameters nodeset1 the first node set to check.
... nodeset2 the second node set to check.
...And 2 more matches
Set-Cookie2 - HTTP
the obsolete set-cookie2 http response header used to send cookies from the server to the user agent, but has been deprecated by the specification.
... use set-cookie instead.
... header type response header forbidden header name no syntax set-cookie2: <cookie-name>=<cookie-value> set-cookie2: <cookie-name>=<cookie-value>; comment=<value> set-cookie2: <cookie-name>=<cookie-value>; commenturl=<http-url> set-cookie2: <cookie-name>=<cookie-value>; discard set-cookie2: <cookie-name>=<cookie-value>; domain=<domain-value> set-cookie2: <cookie-name>=<cookie-value>; max-age=<non-zero-digit> set-cookie2: <cookie-name>=<cookie-value>; path=<path-value> set-cookie2: <cookie-name>=<cookie-value>; port=<port-number> set-cookie2: <cookie-name>=<cookie-value>; secure set-cookie2: <cookie-name>=<cookie-value>; version=<version-number> // multiple directives are also possible, for example: set-cookie2: <cookie-name>=<cookie-value>; domain=<domain-valu...
...And 2 more matches
DataView.prototype.setBigInt64() - JavaScript
the setbigint64() method stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setbigint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from.
... value the value to set as a bigint.
...And 2 more matches
DataView.prototype.setBigUint64() - JavaScript
the setbiguint64() method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setbiguint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from.
... value the value to set as a bigint.
...And 2 more matches
DataView.prototype.setFloat32() - JavaScript
the setfloat32() method stores a signed 32-bit float (float) value at the specified byte offset from the start of the dataview.
... syntax dataview.setfloat32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
DataView.prototype.setFloat64() - JavaScript
the setfloat64() method stores a signed 64-bit float (double) value at the specified byte offset from the start of the dataview.
... syntax dataview.setfloat64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
DataView.prototype.setInt16() - JavaScript
the setint16() method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the dataview.
... syntax dataview.setint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
DataView.prototype.setInt32() - JavaScript
the setint32() method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
DataView.prototype.setInt8() - JavaScript
the setint8() method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... syntax dataview.setint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
DataView.prototype.setUint16() - JavaScript
the setuint16() method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the dataview.
... syntax dataview.setuint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
DataView.prototype.setUint32() - JavaScript
the setuint32() method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setuint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
DataView.prototype.setUint8() - JavaScript
the setuint8() method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... syntax dataview.setuint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
... value the value to set.
...And 2 more matches
Date.prototype.setMonth() - JavaScript
the setmonth() method sets the month for a specified date according to the currently set year.
... syntax dateobj.setmonth(monthvalue[, dayvalue]) versions prior to javascript 1.3 dateobj.setmonth(monthvalue) parameters monthvalue a zero-based integer representing the month of the year offset from the start of the year.
... if a parameter you specify is outside of the expected range, setmonth() attempts to update the date information in the date object accordingly.
...And 2 more matches
Promise.allSettled() - JavaScript
the promise.allsettled() method returns a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describes the outcome of each promise.
... syntax promise.allsettled(iterable); parameters iterable an iterable object, such as an array, in which each member is a promise.
...at that time, the returned promise's handler is passed as input an array containing the outcome of each promise in the original set of promises.
...And 2 more matches
get Set[@@species] - JavaScript
the set[symbol.species] accessor property returns the set constructor.
... description the species accessor property returns the default constructor for set objects.
... examples species in ordinary objects the species property returns the default constructor function, which is the set constructor for set objects: set[symbol.species]; // function set() species in derived objects in a derived collection object (e.g.
...And 2 more matches
Set() constructor - JavaScript
the set constructor lets you create set objects that store unique values of any type, whether primitive values or object references.
... syntax new set([iterable]) parameters iterable optional if an iterable object is passed, all of its elements will be added to the new set.
... if you don't specify this parameter, or its value is null, the new set is empty.
...And 2 more matches
WeakSet() constructor - JavaScript
the weakset constructor lets you create weakset objects that store weakly held objects in a collection.
... syntax new weakset([iterable]); parameters iterable if an iterable object is passed, all of its elements will be added to the new weakset.
... examples using the weakset object var ws = new weakset(); var foo = {}; var bar = {}; ws.add(foo); ws.add(bar); ws.has(foo); // true ws.has(bar); // true ws.delete(foo); // removes foo from the set ws.has(foo); // false, foo has been removed ws.has(bar); // true, bar is retained note that foo !== bar.
...And 2 more matches
WeakSet.prototype.delete() - JavaScript
the delete() method removes the specified element from a weakset object.
...the object remove from the weakset object.
... examples using the delete method var ws = new weakset(); var obj = {}; ws.add(window); ws.delete(obj); // returns false.
...And 2 more matches
WebAssembly.Table.prototype.set() - JavaScript
the set() prototype method of the webassembly.table object mutates a reference stored at a given index to a different value.
... syntax table.set(index, value); parameters index the index of the function reference you want to mutate.
... examples using table.set the following example (see table2.html source code and live version) creates a new webassembly table instance with an initial size of 2 references.
...And 2 more matches
<feOffset> - SVG: Scalable Vector Graphics
WebSVGElementfeOffset
the <feoffset> svg filter primitive allows to offset the input image.
... the input image as a whole is offset by the values specified in the dx and dy attributes.
... usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dx dy dom interface this element implements the svgfeoffsetelement interface.
...And 2 more matches
<set> - SVG: Scalable Vector Graphics
WebSVGElementset
the svg <set> element provides a simple means of just setting the value of an attribute for a specified duration.
... note: the <set> element is non-additive.
... html,body,svg { height:100%; margin:0; padding:0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> rect { cursor: pointer } .round { rx: 5px; fill: green; } </style> <rect id="me" width="10" height="10"> <set attributename="class" to="round" begin="me.click" dur="2s" /> </rect> </svg> attributes to this attribute defines the value to be applied to the target attribute for the duration of the animation.
...And 2 more matches
NSC_SetPIN - Archive of obsolete content
name nsc_setpin - modify the user's pin.
... syntax ck_rv nsc_setpin( ck_session_handle hsession, ck_char_ptr poldpin, ck_ulong uloldlen, ck_char_ptr pnewpin, ck_ulong ulnewlen ); parameters nsc_setpin takes five parameters: hsession [input] poldpin [input] .
... description nsc_setpin modifies the pin of user that is currently logged in.
... return value ckr_ok examples #include <assert.h> see also fc_setpin ...
resetError - Archive of obsolete content
reseterror resets a saved error code to zero.
... method of install object syntax void reseterror (); parameters none.
...description the reseterror method resets any saved error code to zero.
...example to reset the last error code to zero: reseterror(); ...
currentSet - Archive of obsolete content
« xul reference currentset not in seamonkey 1.x type: comma-separated list of strings holds a comma-separated list of the ids of the items currently on the toolbar.
...an empty toolbar has a currentset value of "__empty".
... you may change the current set of items by setting this property.
... be careful, as setting this property doesn't automatically update the currentset attribute.
commandset - Archive of obsolete content
attributes commandupdater, events, oncommandupdate, targets example <commandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> attributes commandupdater type: boolean if true, the commandset is used for updating commands.
...if this attribute is not specified, or you set it to the value '*', all events are valid.
...if this attribute is not specified, or you set it to the value '*', all elements are valid.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
NPP_SetValue - Archive of obsolete content
syntax #include <npapi.h> nperror npp_setvalue(void *instance, npnvariable variable, void *value); parameters the function has the following parameters: instance pointer to plugin instance on which to set the variable.
... variable the variable being set.
... value value for the variable being set.
... description none see also npp_new, npp_getvalue, npn_setvalue, npn_getvalue ...
@set - Archive of obsolete content
the @set statement creates variables used with conditional compilation statements.
... syntax @set @varname = term parameters varname valid javascript variable name.
...variables created using @set are generally used in conditional compilation statements, but can be used anywhere in javascript code.
... examples of variable declarations look like this: @set @myvar1 = 12 @set @myvar2 = (@myvar1 * 20) @set @myvar3 = @_jscript_version the following operators are supported in parenthesized expressions: !
Load the assets and print them on screen - Game development
to load the asset, we will use the game object created by phaser, executing its load.image() method.
... game.load.image('ball', 'img/ball.png'); } the first parameter we want to give the asset is the name that will be used across our game code — for example, in our ball variable name — so we need to make sure it is the same.
... the second parameter is the relative path to the graphic asset.
...the first two parameters are the x and y coordinates of the canvas where you want it added, and the third one is the name of the asset we defined earlier.
Character set - MDN Web Docs Glossary: Definitions of Web-related terms
a character set is an encoding system to let computers know how to recognize character, including letters, numbers, punctuation marks, and whitespace.
... in earlier times, countries developed their own character sets due to their different languages used, such as kanji jis codes (e.g.
...however, unicode gradually became most acceptable character set for its universal language support.
... if a character set is used incorrectly (for example, unicode for an acticle encoded in big5), you may see nothing but broken characters, which are called mojibake.
HTMLIFrameElement.setVolume()
the setvolume() method of the htmliframeelement sets the current volume of the browser <iframe>.
... syntax instanceofhtmliframeelement.setvolume(number); returns void.
... parameters number a floating point number representing the volume you want to set — this can have a value between 0 and 1.
... example var browser = document.queryselector('iframe'); browser.setvolume(0.5); specification not part of any specification.
PR_AtomicSet
atomically sets a 32-bit value and return its previous contents.
... syntax #include <pratom.h> print32 pr_atomicset( print32 *val, print32 newval); parameters the function has the following parameter: val a pointer to the value to be set.
... description pr_atomicset first reads the value of var, then updates it with the supplied value.
...the memory modification is unconditional--that is, it isn't a test and set operation.
PR_SetErrorText
sets the text associated with an error.
... syntax #include <prerror.h> void pr_seterrortext(printn textlength, const char *text) parameters the function has these parameters: textlength the length of the text in the text.
... description the text is copied into the thread structure and remains there until the next call to pr_seterror.
...the new value is copied into storage allocated and owned by nspr and remains there until the next call to pr_seterror or another call to pr_seterrortext.
PR_SetSocketOption
retrieves the socket options set for a specified socket.
... syntax #include <prio.h> prstatus pr_setsocketoption( prfiledesc *fd, prsocketoptiondata *data); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing the socket whose options are to be set.
... data a pointer to a structure of type prsocketoptiondata specifying the options to set.
... description on input, the caller must set both the option and value fields of the prsocketoptiondata object pointed to by the data parameter.
PR_SetThreadPriority
sets the priority of a specified thread.
... syntax #include <prthread.h> void pr_setthreadpriority( prthread *thread, prthreadpriority priority); parameters pr_setthreadpriority has the following parameters: thread a valid identifier for the thread whose priority you want to set.
... priority the priority you want to set.
...it is preferable for a thread to specify itself in the thread parameter when it calls pr_setthreadpriority.
PR_SetThreadPrivate
sets per-thread private data.
... syntax #include <prthread.h> prstatus pr_setthreadprivate(pruintn index, void *priv); parameters pr_setthreadprivate has the following parameters: index an index into the per-thread private data table.
... description if the thread already has non-null private data associated with it, and if the destructor function for the index is known (not null), nspr calls the destructor function associated with the index before setting the new data value.
... the only way to eliminate thread private data at an index prior to the thread's termination is to call pr_setthreadprivate with a null argument.
JS::SetOutOfMemoryCallback
syntax void js::setoutofmemorycallback(jsruntime *rt, js::outofmemorycallback cb, void *data); name type description rt jsruntime * the jsruntime for which to set the gc callback.
...added in spidermonkey 38 callback syntax typedef void (* outofmemorycallback)(jscontext *cx, void *data); name type description data void * data parameter passed to js::setoutofmemorycallback.
... js::setoutofmemorycallback sets a callback function for it.
... see also mxr id search for js::setoutofmemorycallback mxr id search for js::outofmemorycallback bug 969415 bug 987995 - added data parameter ...
JS_SET_TRACING_DETAILS
this article covers features introduced in spidermonkey 1.8 set debugging information about the next thing to be traced by a jstracer.
... syntax js_set_tracing_details(trc, printer, arg, index) name type description trc jstracer * the tracer whose debugging hooks are to be set.
... description set debugging information about a reference to a traceable thing to prepare for the following call to js_calltracer.
...mxr id search for js_set_tracing_details ...
JS_SetCompartmentNameCallback
this article covers features introduced in spidermonkey 17 set callback function to name each compartment.
... syntax void js_setcompartmentnamecallback(jsruntime *rt, jscompartmentnamecallback callback); name type description cx jsruntime * the runtime to set the callback function.
... description js_setcompartmentnamecallback sets callback function which will be called to name the compartment.
... see also mxr id search for js_setcompartmentnamecallback mxr id search for jscompartmentnamecallback bug 777528 ...
JS_SetDestroyCompartmentCallback
this article covers features introduced in spidermonkey 17 set the callback function for each compartment being destroyed.
... syntax void js_setdestroycompartmentcallback(jsruntime *rt, jsdestroycompartmentcallback callback); name type description cx jsruntime * the runtime to set the callback function.
... description js_setdestroycompartmentcallback sets callback function which will be called when sweeping each compartment of the runtime, before deleting the compartment.
... see also mxr id search for js_setdestroycompartmentcallback mxr id search for jsdestroycompartmentcallback bug 737365 ...
JS_SetGCZeal
syntax void js_setgczeal(jscontext *cx, uint8_t zeal, uint32_t frequency); name type description cx jscontext * a context.
... the gc zeal level of the associated jsruntime is set.
... description js_setgczeal sets the level of additional garbage collection to perform for a runtime, for the purpose of finding or reproducing bugs.
...(in a debug build of gecko, you can also set the current gc zeal level using the javascript.options.gczeal preference.) see also mxr id search for js_setgczeal mxr id search for js_gc_zeal js_schedulegc bug 308429 bug 650978 ...
JS_SetICUMemoryFunctions
sets the memory allocation and deallocation functions used by the icu internationalization library.
... syntax bool js_seticumemoryfunctions(js_icuallocfn allocfn, js_icureallocfn reallocfn, js_icufreefn freefn); type description allocfn js_icuallocfn an allocation function.
... description js_seticumemoryfunctions sets the allocator functions used by the icu internationalization library.
...mxr id search for js_seticumemoryfunctions.
JS_SetPendingException
sets the current exception being thrown within a context.
... syntax void js_setpendingexception(jscontext *cx, js::handlevalue v); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... description js_setpendingexception sets the current exception being thrown within a context.
...see also mxr id search for js_setpendingexception js_isexceptionpending js_getpendingexception js_clearpendingexception js_reportpendingexception ...
JS_SetVersionForCompartment
syntax void js_setversionforcompartment(jscompartment *compartment, jsversion version); name type description compartment jscompartment * pointer to a js compartment.
... version jsversion version of javascript to set compartment to.
... description js_setversionforcompartment attempts to set the version of javascript to version for a specified compartment, compartment.
... see also mxr id search for js_setversionforcompartment jsversion js_getversion js_versiontostring js_stringtoversion bug 880917 ...
Setting up CDT to work on SpiderMonkey
there is a guide for setting up cdt to work with the mozilla codebase, but it does not cover setting things up for just spidermonkey instead of the whole mozilla codebase.
... step 2 - installing eclipse and setting up the project the following run-down is a condensed and updated version of what is explained in much more detail for the entire mozilla codebase.
... step 3 - index all the code to let cdt know about the build, it has to invoke make itself (or, as is done in the guide for the whole mozilla codebase on mdn, read a log of the build), which can be setup with these simple steps: open the project's properties by selecting its root and clicking "properties" in the "file" menu and select "c/c++ build".
... under the "builder settings" group tab, deactivate "use default build command".
mozIStorageResultSet
the mozistorageresultset interface represents a set of results from a storage statement.
... storage/public/mozistorageresultset.idlscriptable please add a summary to this article.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview mozistoragerow getnextrow(); methods getnextrow() returns the next row from the result set.
...return value a mozistoragerow object containing the next row from the result set, or null if there are no more results.
nsIMicrosummarySet
toolkit/components/places/public/nsimicrosummaryservice.idlscriptable this interface provides access to sets of microsummaries returned from the nsimicrosummaryservice.
....0) warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void addobserver(in nsimicrosummaryobserver observer); nsisimpleenumerator enumerate(); void removeobserver(in nsimicrosummaryobserver observer); methods addobserver() add a microsummary observer to this microsummary set.
... adding an observer to a set is the equivalent of adding it to each constituent microsummary.
... enumerate() retrieve an nsisimpleenumerator of microsummaries in the set.
NS_CStringSetData
« xpcom api reference summary the ns_cstringsetdata function copies data into the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_cstringsetdata( nsacstring& astring, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to modify.
... return values the ns_cstringsetdata function returns ns_ok if successful.
... example nscstringcontainer str; rv = ns_cstringcontainerinit(str); if (ns_succeeded(rv)) { rv = ns_cstringsetdata(str, "hello world"); if (ns_succeeded(rv)) { // now, pass |str| to some function expecting a |const nsacstring&| parameter.
NS_CStringSetDataRange
« xpcom api reference summary the ns_cstringsetdatarange function copies data into a section of the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_cstringsetdatarange( nsacstring& astring, pruint32 acutstart, pruint32 acutlength, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to modify.
... return values the ns_cstringsetdatarange function returns ns_ok if successful.
...g& str, const nsacstring& matchval, const nsacstring& newval) { const char* sp, *mp, *np; pruint32 sl, ml, nl; sl = ns_cstringgetdata(str, &sp); ml = ns_cstringgetdata(matchval, &mp); nl = ns_cstringgetdata(newval, &np); for (const char* iter = sp; iter <= sp + sl - ml; ++iter) { if (memcmp(iter, mp, ml) == 0) { pruint32 offset = iter - sp; ns_cstringsetdatarange(str, offset, ml, np, nl); sl = ns_cstringgetdata(str, &sp); iter = sp + offset + nl - 1; } } } history this function was frozen for mozilla 1.7.
NS_StringSetData
« xpcom api reference summary the ns_stringsetdata function copies data into the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_stringsetdata( nsastring& astring, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to modify.
... return values the ns_stringsetdata function returns ns_ok if successful.
... example code nsstringcontainer str; rv = ns_stringcontainerinit(str); if (ns_succeeded(rv)) { rv = ns_stringsetdata(str, "hello world"); if (ns_succeeded(rv)) { // now, pass |str| to some function expecting a |const nsastring&| parameter.
NS_StringSetDataRange
« xpcom api reference summary the ns_stringsetdatarange function copies data into a section of the string's internal buffer.
... #include "nsstringapi.h" nsresult ns_stringsetdatarange( nsastring& astring, pruint32 acutstart, pruint32 acutlength, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to modify.
... return values the ns_stringsetdatarange function returns ns_ok if successful.
... const nsastring& matchval, const nsastring& newval) { const prunichar* sp, *mp, *np; pruint32 sl, ml, nl; sl = ns_stringgetdata(str, &sp); ml = ns_stringgetdata(matchval, &mp); nl = ns_stringgetdata(newval, &np); for (const prunichar* iter = sp; iter <= sp + sl - ml; ++iter) { if (memcmp(iter, mp, ml) == 0) { pruint32 offset = iter - sp; ns_stringsetdatarange(str, offset, ml, np, nl); sl = ns_stringgetdata(str, &sp); iter = sp + offset + nl - 1; } } } history this function was frozen for mozilla 1.7.
AbstractRange.endOffset - Web APIs
the endoffset property of the abstractrange interface returns the offset into the end node of the range's end position.
... syntax var endoffset = range.endoffset; value an integer value indicating the number of characters into the node indicated by endcontainer at which the final character of the range is located.
... specifications specification status comment domthe definition of 'endoffset' in that specification.
... living standard static rangethe definition of 'endoffset' in that specification.
AbstractRange.startOffset - Web APIs
the read-only startoffset property of the abstractrange interface returns the offset into the start node of the range's start position.
... syntax var startoffset = range.startoffset value an integer value indicating the number of characters into the node indicated by startcontainer at which the first character of the range is located.
... specifications specification status comment domthe definition of 'startoffset' in that specification.
... living standard static rangethe definition of 'startoffset' in that specification.
Document.enableStyleSheetsForSet() - Web APIs
enables the style sheets matching the specified name in the current style sheet set, and disables all other style sheets (except those without a title, which are always enabled).
... syntax document.enablestylesheetsforset(name); parameters name the name of the style sheets to enable.
... this method never affects the values of document.laststylesheetset or document.preferredstylesheetset.
... example document.enablestylesheetsforset("some style sheet set name"); ...
Document.preferredStyleSheetSet - Web APIs
the preferredstylesheetset property returns the preferred style sheet set as set by the page author.
... syntax preferredstylesheetset = document.preferredstylesheetset on return, preferredstylesheetset indicates the author's preferred style sheet set.
... if there isn't a preferred style sheet set defined by the author, the empty string ("") is returned.
... example if (document.preferredstylesheetset) { console.log("the preferred style sheet set is: " + document.preferredstylesheetset); } else { console.log("there is no preferred style sheet."); } ...
FontFace.featureSettings - Web APIs
the featuresettings property of the fontface interface retrieves or sets infrequently used font features that are not available from a font's variant properties.
... it is equivalent to the font-feature-settings descriptor.
... syntax var featuresettingdescriptor = fontface.featuresettings; fontface.featuresettings = featuresettingdescriptor; value a cssomstring containing a descriptor.
... specifications specification status comment css font loading module level 3the definition of 'featuresettings' in that specification.
FontFaceSet.ready - Web APIs
WebAPIFontFaceSetready
the ready readonly property of the fontfaceset interface returns a promise that resolves to the given fontfaceset.
... syntax fontfaceset.ready.then(function(fontfaceset) { // ...
... }); returns a promise that resolves to the given fontfaceset.
... specifications specification status comment css font loading module level 3the definition of 'fontfaceset' in that specification.
FormData.set() - Web APIs
WebAPIFormDataset
the set() method of the formdata interface sets a new value for an existing key inside a formdata object, or adds the key/value if it does not already exist.
... the difference between set() and formdata.append is that if the specified key does already exist, set() will overwrite all existing values with the new one, whereas formdata.append will append the new value onto the end of the existing set of values.
... syntax there are two versions of this method: a two and a three parameter version: formdata.set(name, value); formdata.set(name, value, filename); parameters name the name of the field whose data is contained in value.
... example the following line creates an empty formdata object: var formdata = new formdata(); // currently empty you can set key/value pairs on this using formdata.set: formdata.set('username', 'chris'); formdata.set('userpic', myfileinput.files[0], 'chris.jpg'); if the sent value is different than string or blob it will be automatically converted to string: formdata.set('name', 72); formdata.get('name'); // "72" specifications specification status comment xmlhttprequestthe definition of 's...
HTMLMediaElement.setMediaKeys() - Web APIs
the setmediakeys() property of the htmlmediaelement interface returns a promise that resolves to the passed mediakeys, which are those used to decrypt media during playback.
... syntax var promise = htmlmediaelement.setmediakeys(mediakeys); parameters mediakeys a reference to a mediakeys object that the htmlmediaelement can use for decryption of media data during playback.
... specifications specification status comment encrypted media extensionsthe definition of 'setmediakeys()' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsetmediakeyschrome full support yesedge full support 13firefox full support yesie ?
HTMLSelectElement.setCustomValidity() - Web APIs
the htmlselectelement.setcustomvalidity() method sets the custom validity message for the selection element to the specified message.
... syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message.
... specifications specification status comment html living standardthe definition of 'htmlselectelement.setcustomvalidity()' in that specification.
... html5the definition of 'htmlselectelement.setcustomvalidity()' in that specification.
MediaSessionActionDetails.seekOffset - Web APIs
the mediasessionactiondetails dictionary's seekoffset property is an optional value passed into the action handler callback to provide the number of seconds the seekforward and seekbackward actions should move the playback time by.
... syntax let mediasessionactiondetails = { seekoffset: deltatimeinseconds }; let deltatime = mediasessionactiondetails.seekoffset; value a floating-point value indicating the time delta in seconds by which to move the playback position relative to its current timestamp.
... if the offset isn't specified, the user agent will choose an appropriate offset automatically.
... specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.seekoffset' in that specification.
MediaSource.setLiveSeekableRange() - Web APIs
the setliveseekablerange() method of the mediasource interface sets the range that the user can seek to in the media element.
... syntax mediasource.setliveseekablerange(start, end) parameters start the start of the seekable range to set in seconds measured from the beginning of the source.
... end the end of the seekable range to set in seconds measured from the beginning of the source.
... return value undefined example // tbd specifications specification status comment media source extensionsthe definition of 'setliveseekablerange()' in that specification.
RTCPeerConnection.setIdentityProvider() - Web APIs
the rtcpeerconnection.setidentityprovider() method sets the identity provider (idp) to the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username.
... if the signalingstate is set to "closed", an invalidstateerror is raised.
... syntax pc.setidentityprovider(domainname [, protocol] [, username]); there is no return value for this method.
... example var pc = new peerconnection(); pc.setidentityassertion("developer.mozilla.org"); specifications specification status comment identity for webrtcthe definition of 'rtcpeerconnection.setidentityprovider()' in that specification.
Range.setEndAfter() - Web APIs
WebAPIRangesetEndAfter
the range.setendafter() method sets the end position of a range relative to another node.
... syntax range.setendafter(referencenode); parameters referencenode the node to end the range after.
... example var range = document.createrange(); var referencenode = document.getelementsbytagname('div').item(0); range.setendafter(referencenode); specifications specification status comment domthe definition of 'range.setendafter()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendafter()' in that specification.
Range.setEndBefore() - Web APIs
the range.setendbefore() method sets the end position of a range relative to another node.
... syntax range.setendbefore(referencenode); parameters referencenode the node to end the range before.
... example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setendbefore(referencenode); specifications specification status comment domthe definition of 'range.setendbefore()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setendbefore()' in that specification.
Range.setStartAfter() - Web APIs
the range.setstartafter() method sets the start position of a range relative to a node.
... syntax range.setstartafter(referencenode); parameters referencenode the node to start the range after.
... example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartafter(referencenode); specifications specification status comment domthe definition of 'range.setstartafter()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstartafter()' in that specification.
Range.setStartBefore() - Web APIs
the range.setstartbefore() method sets the start position of a range relative to another node.
... syntax range.setstartbefore(referencenode); parameters referencenode the node before which the range should start.
... example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartbefore(referencenode); specifications specification status comment domthe definition of 'range.setstartbefore()' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.setstartbefore()' in that specification.
SVGSetElement - Web APIs
the svgsetelement interface corresponds to the <set> element.
..."#fff" stroke="#d4dde4" stroke-width="2px" /><text x="386" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svganimationelement</text></a><polyline points="291,89 281,84 281,94 291,89" stroke="#d4dde4" fill="none"/><line x1="281" y1="89" x2="251" y2="89" stroke="#d4dde4"/><a xlink:href="/docs/web/api/svgsetelement" target="_top"><rect x="121" y="65" width="130" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="186" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgsetelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interfac...
... specifications specification status comment svg animations level 2the definition of 'svgsetelement' in that specification.
... editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgsetelement' in that specification.
StaticRange.endOffset - Web APIs
the endoffset property of the staticrange interface returns the offset into the end node of the range's end position.
... syntax var endoffset = staticrange.endoffset value an integer value indicating the number of characters into the node indicated by endcontainer at which the final character of the range is located.
... specifications specification status comment domthe definition of 'endoffset' in that specification.
... living standard static rangethe definition of 'endoffset' in that specification.
StaticRange.startOffset - Web APIs
the read-only startoffset property of the staticrange interface returns the offset into the start node of the range's start position.
... syntax var startoffset = staticrange.startoffset value an integer value indicating the number of characters into the node indicated by startcontainer at which the first character of the range is located.
... specifications specification status comment domthe definition of 'startoffset' in that specification.
... living standard static rangethe definition of 'startoffset' in that specification.
Window.setCursor() - Web APIs
WebAPIWindowsetCursor
the window.setcursor() method sets the cursor for the current window.
... example function setbusycursor(enable) { window.setcursor(enable ?
... "wait" : "auto"); } notes the cursor isn't reset until it's set back to auto.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsetcursor non-standardchrome no support noedge no support nofirefox no support noie ?
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.
... syntax xrreferencespace.onreset = eventhandler; eventhandler = xrreferencespace.onreset; value an event handler function which will be called whenever the reset event is received by the xrreferencespace.
... usage notes see the reset event documentation for further details.
... specifications specification status comment webxr device apithe definition of 'onreset' in that specification.
font-variation-settings - CSS: Cascading Style Sheets
the font-variation-settings css descriptor allows authors to specify low-level opentype or truetype font variations in the @font-face rule.
... syntax /* use the default settings */ font-variation-settings: normal; /* set values for opentype axis names */ font-variation-settings: "xhgt" 0.7; values normal text is laid out using default settings.
...each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value.
... formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the definition of 'font-variation-settings' in that specification.
inset-inline-end - CSS: Cascading Style Sheets
the inset-inline-end css property defines the logical inline end inset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-inline-end: 3px; inset-inline-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-inline-end: 10%; /* keyword value */ inset-inline-end: auto; /* global values */ inset-inline-end: inherit; inset-inline-end: initial; inset-inline-end: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline.
... syntax values the inset-inline-end property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting inline end offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; position: relative; inset-inline-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-inline-end' in that specification.
inset-inline-start - CSS: Cascading Style Sheets
the inset-inline-start css property defines the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-inline-start: 3px; inset-inline-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-inline-start: 10%; /* keyword value */ inset-inline-start: auto; /* global values */ inset-inline-start: inherit; inset-inline-start: initial; inset-inline-start: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline.
... syntax values the inset-inline-start property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting inline start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-inline-start' in that specification.
offset-rotate - CSS: Cascading Style Sheets
the offset-rotate css property defines the orientation/direction of the element as it is positioned along the offset-path.
... syntax /* follow the path direction, with optional additional angle */ offset-rotate: auto; offset-rotate: auto 45deg; /* follow the path direction but facing the opposite direction of `auto` */ offset-rotate: reverse; /* keep a constant rotation regardless the position on the path */ offset-rotate: 90deg; offset-rotate: .5turn; auto the element is rotated by the angle of the direction of the offset-path, relative to the positive x-axis.
... formal definition initial valueautoapplies totransformable elementsinheritednocomputed valueas specifiedanimation 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 of 'offset-rotate' in that specification.
outline-offset - CSS: Cascading Style Sheets
the outline-offset css property sets the amount of space between an outline and the edge or border of an element.
... syntax /* <length> values */ outline-offset: 3px; outline-offset: 0.2em; /* global values */ outline-offset: inherit; outline-offset: initial; outline-offset: unset; values <length> the width of the space between the element and its outline.
... formal definition initial value0applies toall elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length formal syntax <length> examples setting outline offset in pixels html <p>gallia est omnis divisa in partes tres.</p> css p { outline: 1px dashed red; outline-offset: 10px; background: yellow; border: 1px solid blue; margin: 15px; } result specifications specification status comment css basic user interface module level 3the definition of 'outline-offset' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetoutline-offsetchrome full support 1edge full support 15firefox full support 1.5ie no support noopera full support 9.5safari full support 1.2webv...
unset - CSS: Cascading Style Sheets
WebCSSunset
the unset css keyword resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.
... unset can be applied to any css property, including the css shorthand all.
... examples color html <p>this text is red.</p> <div class="foo"> <p>this text is also red.</p> </div> <div class="bar"> <p>this text is green (default inherited value).</p> </div> css .foo { color: blue; } .bar { color: green; } p { color: red; } .bar p { color: unset; } result border html <p>this text has a red border.</p> <div> <p>this text has a red border.</p> </div> <div class="bar"> <p>this text has a black border (initial default, not inherited).</p> </div> css div { border: 1px solid green; } p { border: 1px solid red; } .bar p { border-color: unset; } result specifications specification status comment css cascading and inheritance level 4the definition of 'unset' in that specification.
... css cascading and inheritance level 3the definition of 'unset' in that specification.
set:distinct() - EXSLT
WebEXSLTsetdistinct
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:distinct() returns a subset of the nodes in the specified node-set, returning only nodes with unique string values.
... syntax set:distinct(nodeset) parameters nodeset the node-set in which to find unique nodes.
... returns a node-set containing the nodes that have unique string values.
... specifications exslt - set:distinct ...
<frameset> - HTML: Hypertext Markup Language
WebHTMLElementframeset
the html <frameset> element is used to contain <frame> elements.
... cols this attribute specifies the number and size of horizontal spaces in a frameset.
... rows this attribute specifies the number and size of vertical spaces in a frameset.
... example <frameset cols="50%,50%"> <frame src="https://udn.realityripple.com/docs/web/html/element/frameset" /> <frame src="https://udn.realityripple.com/docs/web/html/element/frame" /> </frameset> ...
Date.prototype.setFullYear() - JavaScript
the setfullyear() method sets the full year for a specified date according to local time.
... syntax dateobj.setfullyear(yearvalue[, monthvalue[, datevalue]]) parameters yearvalue an integer specifying the numeric value of the year, for example, 1995.
... if a parameter you specify is outside of the expected range, setfullyear() attempts to update the other parameters and the date information in the date object accordingly.
... examples using setfullyear() var thebigday = new date(); thebigday.setfullyear(1997); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setfullyear' in that specification.
Date.prototype.setHours() - JavaScript
the sethours() method sets the hours for a specified date according to local time, and returns the number of milliseconds since january 1, 1970 00:00:00 utc until the time represented by the updated date instance.
... syntax dateobj.sethours(hoursvalue[, minutesvalue[, secondsvalue[, msvalue]]]) versions prior to javascript 1.3 dateobj.sethours(hoursvalue) parameters hoursvalue ideally, an integer between 0 and 23, representing the hour.
... if a parameter you specify is outside of the expected range, sethours() attempts to update the date information in the date object accordingly.
... examples using sethours() var thebigday = new date(); thebigday.sethours(7); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.sethours' in that specification.
Date.prototype.setMinutes() - JavaScript
the setminutes() method sets the minutes for a specified date according to local time.
... syntax dateobj.setminutes(minutesvalue[, secondsvalue[, msvalue]]) versions prior to javascript 1.3 dateobj.setminutes(minutesvalue) parameters minutesvalue an integer between 0 and 59, representing the minutes.
... if a parameter you specify is outside of the expected range, setminutes() attempts to update the date information in the date object accordingly.
... examples using setminutes() var thebigday = new date(); thebigday.setminutes(45); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setminutes' in that specification.
Date.prototype.setSeconds() - JavaScript
the setseconds() method sets the seconds for a specified date according to local time.
... syntax dateobj.setseconds(secondsvalue[, msvalue]) versions prior to javascript 1.3 dateobj.setseconds(secondsvalue) parameters secondsvalue an integer between 0 and 59, representing the seconds.
... if a parameter you specify is outside of the expected range, setseconds() attempts to update the date information in the date object accordingly.
... examples using setseconds() var thebigday = new date(); thebigday.setseconds(30); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setseconds' in that specification.
Date.prototype.setTime() - JavaScript
the settime() method sets the date object to the time represented by a number of milliseconds since january 1, 1970, 00:00:00 utc.
... syntax dateobj.settime(timevalue) parameters timevalue an integer representing the number of milliseconds since 1 january 1970, 00:00:00 utc.
... description use the settime() method to help assign a date and time to another date object.
... examples using settime() var thebigday = new date('july 1, 1999'); var sameasbigday = new date(); sameasbigday.settime(thebigday.gettime()); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.settime' in that specification.
Date.prototype.setUTCDate() - JavaScript
the setutcdate() method sets the day of the month for a specified date according to universal time.
... syntax dateobj.setutcdate(dayvalue) parameters dayvalue an integer from 1 to 31, representing the day of the month.
... description if a parameter you specify is outside of the expected range, setutcdate() attempts to update the date information in the date object accordingly.
... examples using setutcdate() var thebigday = new date(); thebigday.setutcdate(20); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcdate' in that specification.
Date.prototype.setUTCFullYear() - JavaScript
the setutcfullyear() method sets the full year for a specified date according to universal time.
... syntax dateobj.setutcfullyear(yearvalue[, monthvalue[, dayvalue]]) parameters yearvalue an integer specifying the numeric value of the year, for example, 1995.
... if a parameter you specify is outside of the expected range, setutcfullyear() attempts to update the other parameters and the date information in the date object accordingly.
... examples using setutcfullyear() var thebigday = new date(); thebigday.setutcfullyear(1997); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcfullyear' in that specification.
Date.prototype.setUTCHours() - JavaScript
the setutchours() method sets the hour for a specified date according to universal time, and returns the number of milliseconds since january 1, 1970 00:00:00 utc until the time represented by the updated date instance.
... syntax dateobj.setutchours(hoursvalue[, minutesvalue[, secondsvalue[, msvalue]]]) parameters hoursvalue an integer between 0 and 23, representing the hour.
... if a parameter you specify is outside of the expected range, setutchours() attempts to update the date information in the date object accordingly.
... examples using setutchours() var thebigday = new date(); thebigday.setutchours(8); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutchours' in that specification.
Date.prototype.setUTCMilliseconds() - JavaScript
the setutcmilliseconds() method sets the milliseconds for a specified date according to universal time.
... syntax dateobj.setutcmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds.
... description if a parameter you specify is outside of the expected range, setutcmilliseconds() attempts to update the date information in the date object accordingly.
... examples using setutcmilliseconds() var thebigday = new date(); thebigday.setutcmilliseconds(500); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcmilliseconds' in that specification.
Date.prototype.setUTCMinutes() - JavaScript
the setutcminutes() method sets the minutes for a specified date according to universal time.
... syntax dateobj.setutcminutes(minutesvalue[, secondsvalue[, msvalue]]) parameters minutesvalue an integer between 0 and 59, representing the minutes.
... if a parameter you specify is outside of the expected range, setutcminutes() attempts to update the date information in the date object accordingly.
... examples using setutcminutes() var thebigday = new date(); thebigday.setutcminutes(43); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcminutes' in that specification.
Date.prototype.setUTCMonth() - JavaScript
the setutcmonth() method sets the month for a specified date according to universal time.
... syntax dateobj.setutcmonth(monthvalue[, dayvalue]) parameters monthvalue an integer between 0 and 11, representing the months january through december.
... if a parameter you specify is outside of the expected range, setutcmonth() attempts to update the date information in the date object accordingly.
... examples using setutcmonth() var thebigday = new date(); thebigday.setutcmonth(11); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcmonth' in that specification.
Date.prototype.setUTCSeconds() - JavaScript
the setutcseconds() method sets the seconds for a specified date according to universal time.
... syntax dateobj.setutcseconds(secondsvalue[, msvalue]) parameters secondsvalue an integer between 0 and 59, representing the seconds.
... if a parameter you specify is outside of the expected range, setutcseconds() attempts to update the date information in the date object accordingly.
... examples using setutcseconds() var thebigday = new date(); thebigday.setutcseconds(20); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setutcseconds' in that specification.
Map.prototype.set() - JavaScript
the set() method adds or updates an element with a specified key and a value to a map object.
... syntax mymap.set(key, value) parameters key the key of the element to add to the map object.
... examples using set() let mymap = new map() // add new elements to the map mymap.set('bar', 'foo') mymap.set(1, 'foobar') // update an element in the map mymap.set('bar', 'baz') using the set() with chaining since the set() method returns back the same map object, you can chain the method call like below: // add new elements to the map with chaining.
... mymap.set('bar', 'foo') .set(1, 'foobar') .set(2, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'map.prototype.set' in that specification.
Set.prototype.add() - JavaScript
the add() method appends a new element with a specified value to the end of a set object.
... syntax myset.add(value); parameters value the value of the element to add to the set object.
... return value the set object.
... examples using the add method var myset = new set(); myset.add(1); myset.add(5).add('some text'); // chainable console.log(myset); // set [1, 5, "some text"] specifications specification ecmascript (ecma-262)the definition of 'set.prototype.add' in that specification.
Set.prototype.entries() - JavaScript
the entries() method returns a new iterator object that contains an array of [value, value] for each element in the set object, in insertion order.
... for set objects there is no key like in map objects.
... syntax myset.entries() return value a new iterator object that contains an array of [value, value] for each element in the given set, in insertion order.
... examples using entries() var myset = new set(); myset.add('foobar'); myset.add(1); myset.add('baz'); var setiter = myset.entries(); console.log(setiter.next().value); // ["foobar", "foobar"] console.log(setiter.next().value); // [1, 1] console.log(setiter.next().value); // ["baz", "baz"] specifications specification ecmascript (ecma-262)the definition of 'set.prototype.entries' in that specification.
Set.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the specified value exists in a set object or not.
... syntax myset.has(value); parameters value the value to test for presence in the set object.
... return value returns true if an element with the specified value exists in the set object; otherwise false.
... examples using the has method var myset = new set(); myset.add('foo'); myset.has('foo'); // returns true myset.has('bar'); // returns false var set1 = new set(); var obj1 = {'key1': 1}; set1.add(obj1); set1.has(obj1); // returns true set1.has({'key1': 1}); // returns false because they are different object references set1.add({'key1': 1}); // now set1 contains 2 entries specifications specification ecmascript (ecma-262)the definition of 'set.prototype.has' in that specification.
Set.prototype.size - JavaScript
the size accessor property returns the number of (unique) elements in a set object.
... description the value of size is an integer representing how many entries the set object has.
... a set accessor function for size is undefined; you cannot change this property.
... examples using size var myset = new set(); myset.add(1); myset.add(5); myset.add('some text') myset.size; // 3 specifications specification ecmascript (ecma-262)the definition of 'set.prototype.size' in that specification.
Set.prototype.values() - JavaScript
the values() method returns a new iterator object that contains the values for each element in the set object in insertion order.
... the keys() method is an alias for this method (for similarity with map objects); it behaves exactly the same and returns values of set elements.
... syntax myset.values(); return value a new iterator object containing the values for each element in the given set, in insertion order.
... examples using values() var myset = new set(); myset.add('foo'); myset.add('bar'); myset.add('baz'); var setiter = myset.values(); console.log(setiter.next().value); // "foo" console.log(setiter.next().value); // "bar" console.log(setiter.next().value); // "baz" specifications specification ecmascript (ecma-262)the definition of 'set.prototype.values' in that specification.
WeakSet.prototype.add() - JavaScript
the add() method appends a new object to the end of a weakset object.
...the object to add to the weakset collection.
... return value the weakset object.
... examples using add var ws = new weakset(); ws.add(window); // add the window object to the weakset ws.has(window); // true // weakset only takes objects as arguments ws.add(1); // results in "typeerror: invalid value used in weak set" in chrome // and "typeerror: 1 is not a non-null object" in firefox specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.add' in that specification.
WeakSet.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an object exists in a weakset or not.
...the object to test for presence in the weakset.
... return value boolean returns true if an element with the specified value exists in the weakset object; otherwise false.
... examples using the has method var ws = new weakset(); var obj = {}; ws.add(window); myset.has(window); // returns true myset.has(obj); // returns false specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.has' in that specification.
<xsl:attribute-set> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:attribute-set> element creates a named set of attributes, which can then be applied as whole to the output document, in a manner similar to named styles in css.
... syntax <xsl:attribute-set name=name use-attribute-sets=list-of-names> <xsl:attribute> </xsl:attribute-set> required attributes name specifies the name of the attribute set.
... optional attributes use-attribute-sets builds an attribute set from other attribute sets.
... the names of the contributing sets must be separated with whitespace characters and must not directly or indirectly embed themselves.
Setting Parameters - XSLT: Extensible Stylesheet Language Transformations
setting parameters while running transformations using precoded .xsl and .xml files is quite useful, configuring the .xsl file from javascript may be even more useful.
...xsltprocessor provides three javascript methods to interact with these parameters: xsltprocessor.setparameter(), xsltprocessor.getparameter() and xsltprocessor.removeparameter().
...setparameter requires a third argument - namely the value to which the parameter will be set.
... figure 7 : parameters /* xslt: <xsl:param name="myorder" /> */ // javascript: var sortval = xsltprocessor.getparameter(null, "myorder"); if (sortval == "" || sortval == "descending") xsltprocessor.setparameter(null, "myorder", "ascending"); else xsltprocessor.setparameter(null, "myorder", "descending"); ...
Locked config settings - Archive of obsolete content
putting into place locked configuration settings this feature exists for mozilla and firefox, but not for thunderbird locked settings can be put into a mozilla.cfg file in the c:\program files\mozilla.org\mozilla directory.
...the encoding is a simple "byte-shifting" with an offset of 13 (netscape 4 used a similar encoding, but with a of 7 instead).
...moreover, some settings (such as mail & news configuration) unfortunately seem to be inaccessible to mozilla.cfg, which means that these cannot be locked.
currentset - Archive of obsolete content
« xul reference home currentset not in seamonkey 1.x type: comma-separated string the current set of displayed items on the toolbar.
... this isn't necessary the *current* set, i.e.
... it might not be equal the value of the currentset property which is computed from the actual dom ...
broadcasterset - Archive of obsolete content
the broadcasterset and its descendants are not displayed.
... examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
popupset - Archive of obsolete content
this element is optional; the given elements need not appear in a popupset container.
... examples <popupset> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> <label value="right click for popup" context="clipmenu"/> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, t...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements popup, menupopup ...
HTMLIFrameElement.setActive()
the setactive() method of the htmliframeelement sets the current <iframe> as the active frame, which has an effect on how it is prioritized by the process manager.
... syntax instanceofhtmliframeelement.setactive(boolean); returns void.
... example var browser = document.queryselector('iframe'); browser.setactive(); specification not part of any specification.
PR_SetConcurrency
syntax #include <prinit.h> void pr_setconcurrency(pruintn numcpus); parameter pr_setconcurrency has one parameter: numcpus the number of extra virtual processor threads to be created.
... description setting concurrency controls the number of virtual processors that nspr uses to implement its m x n threading model.
...on those where it is not available, pr_setconcurrency is ignored.
PR_SetLogBuffering
sets the level of buffering for the log file.
... syntax #include <prlog.h> void pr_setlogbuffering(printn buffer_size); parameters the function has this parameter: buffer_size the size of the buffer to be used for logging.
... returns nothing description this function sets the size of the buffer used in nspr logging.
JS_SetAllNonReservedSlotsToUndefined
syntax void js_setallnonreservedslotstoundefined(jscontext *cx, jsobject *objarg); name type description cx jscontext * the context in which to clear the object.
... description js_setallnonreservedslotstoundefined assignes undefined to all of obj's own properties, except the special __proto__ and __parent__ properties, in a single operation.
...see also mxr id search for js_setallnonreservedslotstoundefined bug 749371 ...
JS_SetCallReturnValue2
syntax void js_setcallreturnvalue2(jscontext *cx, jsval v); name type description cx jscontext * the context in which the native function is running.
... description calling js_setcallreturnvalue2 indicates to the runtime that the native will return a value of type reference.
... an example is in js/src/js.c; searching for js_setcallreturnvalue2 should find it.
JS_SetGCParametersBasedOnAvailableMemory
syntax void js_setgcparametersbasedonavailablememory(jsruntime *rt, uint32_t availmem); name type description rt jsruntime * the runtime to configure.
... description js_setgcparametersbasedonavailablememory adjusts the parameters of the garbage collection based on available memory.
... see also mxr id search for js_setgcparametersbasedonavailablememory js_setgcparameter bug 950044 ...
Components.utils.setGCZeal
this method lets scripts set the zeal level for garbage collection.
... you can get details on what this method does in js_setgczeal.
... this method calls through to that thusly: js_setgczeal(<current context>, zeal, js_default_zeal_freq, false); syntax components.utils.setgczeal(zeal); where zeal is the zeal value you wish to use.
nsICurrentCharsetListener
intl/uconv/idl/nsicurrentcharsetlistener.idlscriptable please add a summary to this article.
... inherits from: nsisupports last changed in gecko 1.7 implemented by: @mozilla.org/intl/currentcharsetlistener;1.
... to create an instance, use: var currentcharsetlistener = components.classes["@mozilla.org/intl/currentcharsetlistener;1"] .createinstance(components.interfaces.nsicurrentcharsetlistener); method overview void setcurrentcharset(in wstring charset); void setcurrentcomposercharset(in wstring charset); void setcurrentmailcharset(in wstring charset); methods setcurrentcharset() void setcurrentcharset( in wstring charset ); parameters charset setcurrentcomposercharset() void setcurrentcomposercharset( in wstring charset ); parameters charset setcurrentmailcharset() void setcurrentmailcharset( in wstring charset ); parameters charset ...
nsIGSettingsCollection
xpcom/system/nsigsettingsservice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview boolean getboolean(in autf8string key); long getint(in autf8string key); autf8string getstring(in autf8string key); void setboolean(in autf8string key, in boolean value); void setint(in autf8string key, in long value); void setstring(in autf8string key, in autf8string value); methods getboolean() boolean getboolean( in autf8string key ); parameters key return value getint() long getint( in autf8string key ); parameters key return value getstring() autf8string getstring( in autf8string key ); parameters key return value setboolean() void setboolean( in autf8string key, in boolean value )...
...; parameters key value setint() void setint( in autf8string key, in long value ); parameters key value setstring() void setstring( in autf8string key, in autf8string value ); parameters key value ...
CSSPrimitiveValue.setFloatValue() - Web APIs
the setfloatvalue() method of the cssprimitivevalue interface is used to set a float value.
... syntax cssprimitivevalue.setfloatvalue(unittype, floatvalue); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned.
... specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setfloatvalue' in that specification.
CSSPrimitiveValue.setStringValue() - Web APIs
the setstringvalue() method of the cssprimitivevalue interface is used to set a string value.
... syntax cssprimitivevalue.setstringvalue(stringtype, stringvalue); parameters stringtype an unsigned short representing the type of the value.
... specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setstringvalue' in that specification.
Document.styleSheetSets - Web APIs
the stylesheetsets read-only property returns a live list of all of the currently-available style sheet sets.
... syntax var sets = document.stylesheetsets; on return, sets is a list of style sheet sets that are available.
... example given an <ul> (list) element with the id "sheetlist", you can populate it with the names of all the available style sheet sets with code like this: let list = document.getelementbyid('sheetlist'); let sheets = document.stylesheetsets; list.innerhtml = ''; for (let i = 0; i < sheets.length; i++) { let item = document.createelement('li'); item.innerhtml = sheets[i]; list.appendchild(item); } notes the list of available style sheet sets is constructed by enumerating all the style sheets available for the document, in the order in which they're listed in the document.stylesheets attribute, adding the title of each style sheet that has a title to the list.
Element.setCapture() - Web APIs
warning: this interface never had much cross-browser support and you probably looking for element.setpointercapture instead, from the pointer events api.
... syntax element.setcapture(retargettoelement); retargettoelement if true, all events are targeted directly to this element; if false, events can also fire at descendants of this element.
... <html> <head> <title>mouse capture example</title> <style type="text/css"> #mybutton { border: solid black 1px; color: black; padding: 2px; box-shadow: black 2px 2px; } </style> <script type="text/javascript"> function init() { var btn = document.getelementbyid("mybutton"); if (btn.setcapture) { btn.addeventlistener("mousedown", mousedown, false); btn.addeventlistener("mouseup", mouseup, false); } else { document.getelementbyid("output").innerhtml = "sorry, there appears to be no setcapture support on this browser"; } } function mousedown(e) { e.target.setcapture(); e.target.addeventlistener("mousemove", mousemo...
HTMLIFrameElement.setNfcFocus() - Web APIs
the setnfcfocus() method of the htmliframeelement interface sets whether an <iframe> can receive an nfc event.
... syntax myiframe.setnfcfocus(true); returns void.
...default is false; set to true to allow it to receive nfc events.
HTMLInputElement.mozSetFileNameArray() - Web APIs
the htmlinputelement.mozsetfilenamearray() method sets the names of the files that selected on an html input element.
... syntax inputelement.mozsetfilenamearray(afilenames, alength); parameters afilenames is the array of file names to apply to the element.
... example var filearray = {"/foo/bar.txt", "/foo/foosball.txt"}; inputelement.mozsetfilenamearray(filearray, filearray.length); ...
HTMLMediaElement.setSinkId() - Web APIs
the htmlmediaelement.setsinkid() method sets the id of the audio device to use for output and returns a promise.
... syntax htmlmediaelement.setsinkid(sinkid).then(function() { ...
... exceptions exception explanation domexception no permission to use the requested device examples const devices = await navigator.mediadevices.enumeratedevices(); const audiodevices = devices.filter(device => device.kind === 'audiooutput'); const audio = document.createelement('audio'); await audio.setsinkid(audiodevices[0].deviceid); console.log('audio is being played on ' + audio.sinkid); specifications specification status comment audio output devices apithe definition of 'sinkid' in that specification.
msSetVideoRectangle - Web APIs
the htmlvideoelement.mssetvideorectangle() method sets the dimensions of a sub-rectangle within a video.
... syntax htmlvideoelement.mssetvideorectangle(); parameters left a number representing left-side position.
... example htmlvideoelement.mssetvideorectangle(left: 2, top: 0, right: 4, bottom: 4); see also htmlvideoelement microsoft api extensions ...
IDBVersionChangeRequest.setVersion() - Web APIs
the idbversionchangerequest.setversion method updates the version of the database, returning immediately and running a versionchange transaction on the connected database in a separate thread.
... syntax idbversionchangerequest setversion ([treatnullas=emptystring] in domstring version); example tbd parameters version the version to store in the database.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsetversion deprecatednon-standardchrome no support noedge no support nofirefox no support noie no support noopera no support nosafari no support ...
setServerCertificate() - Web APIs
the mediakeys.setservercertificate() method a promise to a server certificate to be used to encrypt messages to the license server.
... syntax mediakeys.setservercertificate([mediakeysessiontype]).then(function() { ...
... }); specifications specification status comment encrypted media extensionsthe definition of 'setservercertificate()' in that specification.
MediaTrackSettings.aspectRatio - Web APIs
the mediatracksettings dictionary's aspectratio property is a double-precision floating-point number indicating the aspect ratio of the mediastreamtrack as currently configured.
... syntax var aspectratio = mediatracksettings.aspectratio; value a double-precision floating-point number indicating the current configuration of the track's aspect ratio.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.autoGainControl - Web APIs
the mediatracksettings dictionary's autogaincontrol property is a boolean value whose value indicates whether or not automatic gain control (agc) is enabled on an audio track.
... syntax var autogaincontrol = mediatracksettings.autogaincontrol; value a boolean value which is true if the track has automatic gain control enabled or false if agc is disabled.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.channelCount - Web APIs
the mediatracksettings dictionary's channelcount property is an integer indicating how many audio channel the mediastreamtrack is currently configured to have.
... syntax var channelcount = mediatracksettings.channelcount; value an integer value indicating the number of audio channels on the track.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.cursor - Web APIs
the mediatracksettings dictionary's cursor property indicates whether or not the cursor should be captured as part of the video track included in the mediastream returned by getdisplaymedia().
... syntax cursorsetting = mediatracksettings.cursor; value the value of cursor comes from the cursorcaptureconstraint enumerated string type, and may have one of the following values: always the mouse should always be visible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content.
... specifications specification status comment screen capturethe definition of 'mediatracksettings.cursor' in that specification.
MediaTrackSettings.deviceId - Web APIs
the mediatracksettings dictionary's deviceid property is a domstring which uniquely identifies the source for the corresponding mediastreamtrack for the origin corresponding to the browsing session.
... syntax var deviceid = mediatracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the track's source.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.displaySurface - Web APIs
the mediatracksettings dictionary's displaysurface property indicates the type of display surface being captured.
... syntax displaysurface = mediatracksettings.displaysurface; value the value of displaysurface is a string that comes from the displaycapturesurfacetype enumerated type, and is one of the following: application the stream's video track contains all of the windows belonging to the application chosen by the user.
... specifications specification status comment screen capturethe definition of 'mediatracksettings.displaysurface' in that specification.
MediaTrackSettings.echoCancellation - Web APIs
the mediatracksettings dictionary's echocancellation property is a boolean value whose value indicates whether or not echo cancellation is enabled on an audio track.
... syntax var echocancellation = mediatracksettings.echocancellation; value a boolean value which is true if the track has echo cancellation functionality enabled or false if echo cancellation is disabled.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.facingMode - Web APIs
the mediatracksettings dictionary's facingmode property is a domstring indicating the direction in which the camera producing the video track represented by the mediastreamtrack is currently facing.
... syntax var facingmode = mediatracksettings.facingmode; value a domstring whose value is one of the strings in videofacingmodeenum.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.frameRate - Web APIs
the mediatracksettings dictionary's framerate property is a double-precision floating-point number indicating the frame rate, in frames per second, of the mediastreamtrack as currently configured.
... syntax var framerate = mediatracksettings.framerate; value a double-precision floating-point number indicating the current configuration of the track's frame rate, in frames per second.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.height - Web APIs
the mediatracksettings dictionary's height property is an integer indicating the number of pixels tall mediastreamtrack is currently configured to be.
... syntax var height = mediatracksettings.height; value an integer value indicating the height, in pixels, of the video track as currently configured.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.latency - Web APIs
the mediatracksettings dictionary's latency property is a double-precision floating-point number indicating the estimated latency (specified in seconds) of the mediastreamtrack as currently configured.
... syntax var latency = mediatracksettings.latency; value a double-precision floating-point number indicating the estimated latency, in seconds, of the audio track as currently configured.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.logicalSurface - Web APIs
the mediatracksettings dictionary's logicalsurface property indicates whether or not the display area being captured is a logical surface.
... syntax islogicalsurface = mediatracksettings.logicalsurface; value a boolean value which is true if the video track in the stream of captured video is taken from a logical display surface.
... specifications specification status comment screen capturethe definition of 'mediatracksettings.logicalsurface' in that specification.
MediaTrackSettings.noiseSuppression - Web APIs
the mediatracksettings dictionary's noisesuppression property is a boolean value whose value indicates whether or not noise suppression technology is enabled on an audio track.
... syntax var noisesuppression = mediatracksettings.noisesuppression; value a boolean value which is true if the input track has noise suppression enabled or false if agc is disabled.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.sampleRate - Web APIs
the mediatracksettings dictionary's samplerate property is an integer indicating how many audio samples per second the mediastreamtrack is currently configured for.
... syntax var samplerate = mediatracksettings.samplerate; value an integer value indicating how many samples each second of audio data includes.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.sampleSize - Web APIs
the mediatracksettings dictionary's samplesize property is an integer indicating the linear sample size (in bits per sample) the mediastreamtrack is currently configured for.
... syntax var samplesize = mediatracksettings.samplesize; value an integer value indicating how many bits each audio sample is represented by.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.volume - Web APIs
the mediatracksettings dictionary's volume property is a double-precision floating-point number indicating the volume of the mediastreamtrack as currently configured, as a value from 0.0 (silence) to 1.0 (maximum supported volume for the device).
... syntax var volume = mediatracksettings.volume; value a double-precision floating-point number indicating the volume, from 0.0 to 1.0, of the audio track as currently configured.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSettings.width - Web APIs
the mediatracksettings dictionary's width property is an integer indicating the number of pixels wide mediastreamtrack is currently configured to be.
... syntax var width = mediatracksettings.width; value an integer value indicating the width, in pixels, of the video track as currently configured.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
msSetMediaProtectionManager - Web APIs
the mssetmediaprotectionmanager method specifies the media protection manager for a given media pipeline.
... syntax htmlmediaelement.mssetmediaprotectionmanager(mediaprotectionmanager); parameters the windows.media.protection namespace provides classes to manage digital rights management (drm) media contents.
... the optional parameter of the mssetmediaprotectionmanager property is mediaprotectionmanager and can be any type.
RTCIceCandidateStats.lastResponseTimestamp - Web APIs
the rtcicecandidatepairstats property lastresponsetimestamp indicates the time at which the last stun response was received on the described candidate pair.
... syntax lastresponsetimestamp = rtcicecandidatepairstats.lastresponsetimestamp; value a domhighrestimestamp object indicating the timestamp at which the most recent stun response was received on the connection defined by the described pair of candidates.
... specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.lastresponsetimestamp' in that specification.
Selection.collapseToEnd() - Web APIs
the selection.collapsetoend() method collapses the selection to the end of the last range in the selection.
... syntax sel.collapsetoend() parameters none.
... specifications specification status comment selection apithe definition of 'selection.collapsetoend()' in that specification.
Selection.collapseToStart() - Web APIs
the selection.collapsetostart() method collapses the selection to the start of the first range in the selection.
... syntax sel.collapsetostart() parameters none.
... specifications specification status comment selection apithe definition of 'selection.collapsetostart()' in that specification.
StylePropertyMap.set() - Web APIs
the set() method of the stylepropertymap interface changes the css declaration with the given property.
... syntax stylepropertymap.set(property,value) parameters property an identifier indicating the stylistic feature (e.g.
... return value undefined example // tbd specifications specification status comment css typed om level 1the definition of 'set()' in that specification.
USBDevice.reset() - Web APIs
WebAPIUSBDevicereset
the reset() method of the usbdevice interface returns a promise that resolves when the device is reset and all app operations canceled and their promises rejected.
... syntax var promise = usbdevice.reset() parameters none.
... specifications specification status comment webusbthe definition of 'reset()' in that specification.
VisualViewport.offsetTop - Web APIs
the offsettop read-only property of the visualviewport interface returns the offset of the top edge of the visual viewport from the top edge of the layout viewport in css pixels.
... syntax var offsettop = visualviewport.offsettop value a double.
... specifications specification status comment visual viewport apithe definition of 'offsettop' in that specification.
VisualViewport.offsetleft - Web APIs
the offsetleft read-only property of the visualviewport interface returns the offset of the left edge of the visual viewport from the left edge of the layout viewport in css pixels.
... syntax var offsetleft = visualviewport.offsetleft value a double.
... specifications specification status comment visual viewport apithe definition of 'offsetleft' in that specification.
WebGLRenderingContext.getVertexAttribOffset() - Web APIs
the webglrenderingcontext.getvertexattriboffset() method of the webgl api returns the address of a specified vertex attribute.
... syntax glintptr gl.getvertexattriboffset(index, pname); parameters index a gluint specifying the index of the vertex attribute.
... examples gl.getvertexattriboffset(i, gl.vertex_attrib_array_pointer); specifications specification status comment webgl 1.0the definition of 'getvertexattriboffset' in that specification.
XMLHttpRequestResponseType - Web APIs
the xmlhttprequestresponsetype type is an enumerated set of strings which are used to specify the type of data contained in the response of an xmlhttprequest.
... these values are used when getting or setting the responsetype on the request.
... values "" an empty responsetype string is treated the same as "text", the default type.
inset-block-end - CSS: Cascading Style Sheets
the inset-block-end css property defines the logical block end offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-block-end: 3px; inset-block-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-end: 10%; /* keyword value */ inset-block-end: auto; /* global values */ inset-block-end: inherit; inset-block-end: initial; inset-block-end: unset; syntax values the inset-block-end property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting block end offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; position: relative; inset-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-block-end' in that specification.
inset-block-start - CSS: Cascading Style Sheets
the inset-block-start css property defines the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-block-start: 3px; inset-block-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-start: 10%; /* keyword value */ inset-block-start: auto; /* global values */ inset-block-start: inherit; inset-block-start: initial; inset-block-start: unset; syntax values the inset-block-start property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting block start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block-start: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the definition of 'inset-block-start' in that specification.
inset-block - CSS: Cascading Style Sheets
the inset-block css property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-block: 3px 10px; inset-block: 2.4em 3em; inset-block: 10px; /* value applied to start and end */ /* <percentage>s of the width or height of the containing block */ inset-block: 10% 5%; /* keyword value */ inset-block: auto; /* global values */ inset-block: inherit; inset-block: initial; inset-block: unset; constituent properties this property is a shorthand for the following css properties: inset-block-end inset-block-start syntax values the inset-block property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting block start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block: 20px 50px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-block' in that specification.
inset-inline - CSS: Cascading Style Sheets
the inset-inline css property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-inline: 3px 10px; inset-inline: 2.4em 3em; inset-inline: 10px; /* value applied to start and end */ /* <percentage>s of the width or height of the containing block */ inset-inline: 10% 5%; /* keyword value */ inset-inline: auto; /* global values */ inset-inline: inherit; inset-inline: initial; inset-inline: unset; constituent properties this property is a shorthand for the following css properties: inset-inline-end inset-inline-start syntax values the inset-inline property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting inline start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline: 20px 50px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-inline' in that specification.
inset - CSS: Cascading Style Sheets
WebCSSinset
the inset css property, though part of the logical specification, doesn't define logical block or inline offsets, and instead defines physical offsets, regardless of the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset: 10px; /* value applied to all edges */ inset: 4px 8px; /* top/bottom left/right */ inset: 5px 15px 10px; /* top left/right bottom */ inset: 2.4em 3em 3em 3em; /* top right bottom left */ /* <percentage>s of the width (left/right) or height (top/bottom) of the containing block */ inset: 10% 5% 5% 5%; /* keyword value */ inset: auto; /* global values */ inset: inherit; inset: initial; inset: unset; syntax values the inset property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,4} examples setting offsets for an element html <div> <span class="exampletext">example text</span> </div> css div { background-color: yellow; width: 150px; height: 120px; position: relative; } .exampletext { writing-mode: sideways-rl; position: absolute; inset: 20px 40px 30px 10px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset' in that specif...
DataView.prototype.byteOffset - JavaScript
the byteoffset accessor property represents the offset (in bytes) of this view from the start of its arraybuffer or sharedarraybuffer.
... description the byteoffset property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
... examples using the byteoffset property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.byteoffset; // 0 (no offset specified) var dataview2 = new dataview(buffer, 3); dataview2.byteoffset; // 3 (as specified when constructing the dataview) specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.byteoffset' in that specification.
Date.prototype.setMilliseconds() - JavaScript
the setmilliseconds() method sets the milliseconds for a specified date according to local time.
... syntax dateobj.setmilliseconds(millisecondsvalue) parameters millisecondsvalue a number between 0 and 999, representing the milliseconds.
... examples using setmilliseconds() var thebigday = new date(); thebigday.setmilliseconds(100); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.setmilliseconds' in that specification.
Set.prototype.clear() - JavaScript
the clear() method removes all elements from a set object.
... syntax myset.clear(); return value undefined.
... examples using the clear method var myset = new set(); myset.add(1); myset.add('foo'); myset.size; // 2 myset.has('foo'); // true myset.clear(); myset.size; // 0 myset.has('bar') // false specifications specification ecmascript (ecma-262)the definition of 'set.prototype.clear' in that specification.
TypedArray.prototype.byteOffset - JavaScript
the byteoffset accessor property represents the offset (in bytes) of a typed array from the start of its arraybuffer.
... description the byteoffset property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
... examples using the byteoffset property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.byteoffset; // 0 (no offset specified) var uint8 = new uint8array(buffer, 3); uint8.byteoffset; // 3 (as specified when constructing uint8array) specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.byteoffset' in that specification.
WeakMap.prototype.set() - JavaScript
the set() method adds a new element with a specified key and value to a weakmap object.
... syntax wm.set(key, value); parameters key required.
... examples using the set method var wm = new weakmap(); var obj = {}; // add new elements to the weakmap wm.set(obj, 'foo').set(window, 'bar'); // chainable // update an element in the weakmap wm.set(obj, 'baz'); specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.set' in that specification.
defaultset - Archive of obsolete content
« xul reference home defaultset not in seamonkey 1.x type: comma-separated list of item ids the default set of displayed items on the toolbar.
... this should be set to a comma-separated list of item ids from the toolbarpalette.
moveByOffset - Archive of obsolete content
« xul reference home movebyoffset( offset , isselecting, isselectingrange) return type: no return value if offset is positive, adjusts the focused item forward by that many items.
... if offset is negative, adjusts the focused item backward by that many items.
setSelectionRange - Archive of obsolete content
« xul reference home setselectionrange( start, end ) return type: no return value sets the selected portion of the textbox, where the start argument is the index of the first character to select and the end argument is the index of the character after the selection.
... set both arguments to the same value to move the cursor to the corresponding position without selecting text.
documentCharsetInfo - Archive of obsolete content
« xul reference documentcharsetinfo obsolete since gecko 12.0 type: nsidocumentcharsetinfo this read-only property contains the nsidocumentcharsetinfo object for the document which is used to handle which character set should be used to display the document.
... the properties of the nsidocumentcharsetinfo object were merged into the docshell in gecko 12.0 (firefox 12.0 / thunderbird 12.0 / seamonkey 2.9).
queryset - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
stringbundleset - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
toolbarset - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database,...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarspacer, toolbox ...
Settings - Archive of obsolete content
the debugger has its own settings menu, which you can access from an icon in the toolbar: each setting is a simple on/off switch: auto prettify minified sources with this option enabled, the debugger will automatically detect minified js files and pretty-print them.
... ignore caught exceptions if this option is set (it is set by default) and "pause on exceptions" is set, then execution will pause on an exception only if that exception is not caught.
Typesetting a community school homepage - Learn web development
your post should include: a descriptive title such as "assessment wanted for typesetting a community school homepage".
... previous overview: styling text in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
How do you set up a local testing server? - Learn web development
this article explains how to set up a simple local testing server on your machine, and the basics of how to use it.
... objective: you will learn how to set up a local testing server.
Initial setup
here we'll go over the accounts you need as well as the tools and their configurations you need to set up before contributing.
... end of initial setup now that you've finished your initial setup, it's time for the best part: translating!
PR_ProcessAttrSetInheritableFileMap
syntax #include <prshma.h> nspr_api(prstatus) pr_processattrsetinheritablefilemap( prprocessattr *attr, prfilemap *fm, const char *shmname ); parameters the function has the following parameters: attr pointer to a prprocessattr structure used to pass data to pr_createprocess.
... returns prstatus description pr_processattrsetinheritablefilemap connects the prfilemap to prprocessattr with shmname.
PR_SetError
sets error information within a thread context.
... syntax #include <prerror.h> void pr_seterror(prerrorcode errorcode, print32 oserr) parameters the function has these parameters: errorcode the nspr (platform-independent) translation of the error.
PR_SetLogFile
sets the name of the log file.
... syntax #include <prlog.h> prbool pr_setlogfile(const char *name); parameters the function has this parameter: name the name of the log file.
PR_SetPollableEvent
set a pollable event.
... syntax nspr_api(prstatus) pr_setpollableevent(prfiledesc *event); parameter the function has the following parameter: event pointer to a prfiledesc structure previously created via a call to pr_newpollableevent.
JS_SetExtraGCRoots
syntax void js_setextragcroots(jsruntime *rt, jstracedataop traceop, void *data); argument meaning rt the runtime whose trace operation is to be set.
...this is the data value that was passed to js_setextragcroots when this callback function was installed.
nsIGSettingsService
xpcom/system/nsigsettingsservice.idlscriptable please add a summary to this article.
... 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) implemented by: @mozilla.org/gsettings-service;1 as a service: var gsettingsservice = components.classes["@mozilla.org/gsettings-service;1"] .createinstance(components.interfaces.nsigsettingsservice); method overview nsigsettingscollection getcollectionforschema(in autf8string schema); methods getcollectionforschema() nsigsettingscollection getcollectionforschema( in autf8string schema ); parameters schema return value ...
Set a logpoint - Firefox Developer Tools
working with logpoints when you set a logpoint, the indicator is purple, rather than the blue of an unconditional breakpoint or the orange of a conditional breakpoint.
... when you want to know that a specific line in your code has executed, but you don’t want to break code execution, set a logpoint.
FontFaceSet.check() - Web APIs
WebAPIFontFaceSetcheck
the check() method of the fontfaceset returns whether all fonts in the given font list have been loaded and are available.
... syntax bool = afontfaceset.check(font); bool = afontfaceset.check(font, text); returns a boolean that is true if the font list is available parameters font: a font specification using the css value syntax, e.g.
FontFaceSet.load() - Web APIs
WebAPIFontFaceSetload
the load() method of the fontfaceset forces all the fonts given in parameters to be loaded.
... syntax result = afontfaceset.load(font); result = afontfaceset.load(font, text); returns a promise of an array of fontface loaded.
HTMLFormElement.acceptCharset - Web APIs
the htmlformelement.acceptcharset property represents a list of the supported character encodings for the given <form> element.
... syntax var string = form.acceptcharset; form.acceptcharset = string; example inputs = document.forms['myform'].acceptcharset; specifications specification status comment html living standardthe definition of 'htmlformelement: acceptcharset' in that specification.
MediaSettingsRange.max - Web APIs
the max read-only property of the mediasettingsrange interface returns the maximum value of the settings range.
... syntax var max = mediasettingsrange.max value a double integer.
MediaSettingsRange.min - Web APIs
the min read-only property of the mediasettingsrange interface returns the minimum value of the settings range.
... syntax var min = mediasettingsrange.min value a double integer.
MediaSettingsRange.step - Web APIs
the step read-only property of the mediasettingsrange interface returns the minimum difference between consecutive values of the settings range.
... syntax var step = mediasettingsrange.step value a double integer.
MouseEvent.offsetX - Web APIs
the offsetx read-only property of the mouseevent interface provides the offset in the x coordinate of the mouse pointer between that event and the padding edge of the target node.
... syntax var xoffset = instanceofmouseevent.offsetx; return value a double floating point value.
MouseEvent.offsetY - Web APIs
the offsety read-only property of the mouseevent interface provides the offset in the y coordinate of the mouse pointer between that event and the padding edge of the target node.
... syntax var yoffset = instanceofmouseevent.offsety; return value a double floating point value.
Selection.anchorOffset - Web APIs
the selection.anchoroffset read-only property returns the number of characters that the selection's anchor is offset within the selection.anchornode.
... syntax number = sel.anchoroffset specifications specification status comment selection apithe definition of 'selection.anchoroffset' in that specification.
Selection.focusOffset - Web APIs
the selection.focusoffset read-only property returns the number of characters that the selection's focus is offset within the selection.focusnode.
... syntax offset = sel.focusoffset specifications specification status comment selection apithe definition of 'selection.focusoffset' in that specification.
Window.pageXOffset - Web APIs
the read-only window property pagexoffset is an alias for scrollx.
... specification specification status comment css object model (cssom) view modulethe definition of 'window.pagexoffset' in that specification.
XDomainRequest.responseText - Web APIs
syntax var response = xdr.responsetext; this sets response to contain the response body of the request, as a string.
... example var response = xdr.responsetext; specification not part of any specification.
CSS Charsets - CSS: Cascading Style Sheets
css charsets is a module of css that lets you specify the character set used in the style sheet.
... reference at-rules @charset specifications specification status comment css level 2 (revision 1)the definition of '@charset' in that specification.
205 Reset Content - HTTP
WebHTTPStatus205
the http 205 reset content response status tells the client to reset the document view, so for example to clear the content of a form, reset a canvas state, or to refresh the ui.
... status 205 reset content specifications specification title rfc 7231, section 6.3.6: 205 reset content hypertext transfer protocol (http/1.1): semantics and content compatibility notes browser behavior differs if this response erroneously includes a body on persistent connections see 204 no content for more detail.
Set.prototype[@@iterator]() - JavaScript
syntax myset[symbol.iterator] return value the set iterator function, which is the values() function by default.
... examples using [@@iterator]() const myset = new set(); myset.add('0'); myset.add(1); myset.add({}); const setiter = myset[symbol.iterator](); console.log(setiter.next().value); // "0" console.log(setiter.next().value); // 1 console.log(setiter.next().value); // object using [@@iterator]() with for..of const myset = new set(); myset.add('0'); myset.add(1); myset.add({}); for (const v of myset) { console.log(v); } specifications specification ecmascript (ecma-262)the definition of 'set.prototype[@@iterator]' in that specification.
WeakSet.prototype.clear() - JavaScript
the clear() method used to remove all elements from a weakset object, but is no longer part of ecmascript and its implementations.
... syntax ws.clear(); examples using the clear method var ws = new weakset(); ws.add(window); ws.has(window); // true ws.clear(); ws.has(window); // false specifications not part of any standard.
onclosetab - Archive of obsolete content
« xul reference home onclosetab type: script code this script will be called when the close tab button is clicked.
parsetype - Archive of obsolete content
« xul reference home parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer.
setfocus - Archive of obsolete content
« xul reference home setfocus type: boolean if true or omitted, the focus will be given to the first element in the corresponding tabpanel when the tabs are navigated via the keyboard.
collapseToolbar - Archive of obsolete content
« xul reference home collapsetoolbar( toolbar ) not in firefox return type: no return value collapse the given toolbar which should be contained within the toolbox.
reset - Archive of obsolete content
ArchiveMozillaXULMethodreset
« xul reference home reset() return type: no return value resets the preference to its default value.
setIcon - Archive of obsolete content
ArchiveMozillaXULMethodsetIcon
« xul reference home seticon( atab, auri ) return type: no return value sets the specified tab's favicon to the image specified by auri.
showOnlyTheseTabs - Archive of obsolete content
« xul reference home showonlythesetabs( atabs ) return type: no return value makes all tabs in the atabs array visible, and all other tabs hidden.
toolbarset - Archive of obsolete content
« xul reference toolbarset firefox only type: element the toolbarset within the toolbox.
NPN_SetException - Archive of obsolete content
syntax #include <npruntime.h> void npn_setexception(npobject *npobj, const nputf8 *message); parameters the function has the following parameters: <tt>npobj</tt> the object on which the exception occurred.
NPN_SetValueForURL - Archive of obsolete content
(while the api theoretically allows the preferred proxy for a given url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) syntax #include <npapi.h> typedef enum { npnurlvcookie = 501, npnurlvproxy } npnurlvariable; nperror npn_setvalueforurl(npp instance, npnurlvariable variable, const char *url, const char *value, uint32_t len); parameters this function has the following parameters: instance pointer to the current plug-in instance.
PR_SetLibraryPath
syntax #include <prlink.h> prstatus pr_setlibrarypath(const char *path); parameters the function has this parameter: path a pointer to a character array that contains the directory path that the application should use as a default.
SetSelected
void setselected( in boolean aisselected ); parameters aisselected[out] the current selection exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.
set
this content is now available at nsiproperties.set().
Set watch expressions - Firefox Developer Tools
to set a watch expression, expand the watch expressions sidebar, then click "add watch expression." type the expression you'd like to watch into the text field.
Set a conditional breakpoint - Firefox Developer Tools
to set a conditional breakpoint, activate the context menu in the source pane, on the line where you want the breakpoint, and select "add conditional breakpoint".
Set an XHR breakpoint - Firefox Developer Tools
see set a breakpoint > inline variable preview for more information.
Set event listener breakpoints - Firefox Developer Tools
see set a breakpoint > inline variable preview for more information.
FontFaceSetLoadEvent.fontfaces - Web APIs
syntax var fontface[] = fontfacesetloadevent.fontfaces value an array of fontface instance.
Index - Web APIs
WebAPIIndex
in addition, it can execute multiple instances of a set of elements.
... 19 abstractrange.endoffset api, abstractrange, dom, dom api, end, property, range, read-only, reference, endoffset, offset the endoffset property of the abstractrange interface returns the offset into the end node of the range's end position.
... 21 abstractrange.startoffset api, abstractrange, dom, dom api, property, range, read-only, reference, offset, startoffset the read-only startoffset property of the abstractrange interface returns the offset into the start node of the range's start position.
...And 597 more matches
sslfnc.html
nss_init nss_initreadwrite nss_nodb_init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidcache ssl_inheritmpserversidcache nss_init sets up configuration files and performs other tasks required to run network security services.
...therefore, an application cannot use nss to perform any cryptographic operations until after it enables appropriate cipher suites by calling one of the ssl export policy functions: nss_setdomesticpolicy, nss_setexportpolicy, and nss_setfrancepolicy configure the cipher suites for domestic, international, and french versions of software products with encryption features.
... ssl_cipherpolicyset sets policy flags for individual cipher suites, one at a time.
...And 195 more matches
Index - Archive of obsolete content
43 clipboard add-on sdk interact with the system clipboard, setting and getting its contents.
... 56 selection add-on sdk get and set text and html selections in the current web page.
... 62 timers add-on sdk set one-off and periodic timers.
...And 149 more matches
Bytecode Descriptions
this is used for code like ++obj[index], which must do both a jsop::getelem and a jsop::setelem with the same property key.
...more fundamentally, the result of evaluating x-- is tonumeric(old value of x), a value that the sequence getlocal "x"; one; sub; setlocal "x" does not give us.
...format: jof_elem, jof_propinit initpropsetter, inithiddenpropsetter operands: (uint32_t nameindex) stack: obj, setter ⇒ obj define an accessor property on obj with the given setter.
...And 104 more matches
Index
found 353 pages: # page tags and summary 1 network security services jss, nss, needsmigration network security services (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications.
...nss ships a predefined set of ca certificates.
... this set, including their trust assignments, is provided by nss as a software module, called ckbi (“built-in root certificates”), which also implements the pkcs#11 interface.
...And 88 more matches
Index
65 js::remove*root jsapi reference, obsolete, reference, référence(2), spidermonkey js::remove*root removes the variable that rp points to from the garbage collector's root set.
... 67 js::setlargeallocationfailurecallback jsapi reference, reference, référence(2), spidermonkey if a large allocation fails when calling pod_{calloc,realloc}cangc, the js engine may call the large-allocation- failure callback, if set, to allow the embedding to flush caches, possibly perform shrinking gcs, etc.
...the allocation will then be retried (and may still fail.) 68 js::setoutofmemorycallback jsapi reference, reference, référence(2), spidermonkey unlike the error reporter, which is only called if the exception for an oom bubbles up and is not caught, the js::outofmemorycallback is called immediately at the oom site to allow the embedding to capture the current state of heap allocation before anything is freed.
...And 86 more matches
nsIAnnotationService
method overview void setpageannotation(in nsiuri auri, in autf8string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setitemannotation(in long long aitemid, in autf8string aname, in nsivariant avalue, in long aflags, in unsigned short aexpiration); void setpageannotationstring(in nsiuri auri, in autf8string aname, in astring avalue, in long aflags, in unsigned short ae...
...xpiration); boolean setitemannotationstring(in long long aitemid, in autf8string aname, in astring avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint32(in nsiuri auri, in autf8string aname, in long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint32(in long long aitemid, in autf8string aname, in long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationint64(in nsiuri auri, in autf8string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setitemannotationint64(in long long aitemid, in autf8string aname, in long long avalue, in long aflags, in unsigned short aexpiration); void setpageannotationdouble(in nsiuri auri, in autf...
...8string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setitemannotationdouble(in long long aitemid, in autf8string aname, in double avalue, in long aflags, in unsigned short aexpiration); void setpageannotationbinary(in nsiuri auri, in autf8string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in long aflags, in unsigned short aexpiration); void setitemannotationbinary(in long long aitemid, in autf8string aname,[const, array, size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in long aflags, in unsigned short aexpiration); nsivariant getpageannotation(in nsiuri auri, in autf8string aname); nsivariant getitemannotation(i...
...And 77 more matches
WebIDL bindings
notes: need to document the setup for indexed and named setters/creators/deleters.
... add an entry to dom/bindings/bindings.conf that sets some basic information about the implementation of the interface.
... if the c++ type is not mozilla::dom::myinterface, you need to set the 'nativetype' to the right type.
...And 67 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
lass="button"> delete line </div> </div> <div class="property"> <div class="ui-slider" data-topic="axis-rotation" data-info="rotation" data-min="-180" data-value="0" data-max="180"></div> </div> </div> <div id="tool-section" class="section"> <div class="title"> tool settings </div> <div class="property"> <div class="name"> alpha background </div> <div id="canvas-bg"></div> <div id="add-axis" class="button"> add line </div> </div> <div id="order"> <div id="gradient-axes"></div> <div id="gradient-order"></div> ...
...transform: lowercase; line-height: inherit; } .ui-input-slider-left, .ui-input-slider-right { width: 16px; cursor: pointer; background: url("arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-transform: lowercase; } .ui-input-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: 5px; color: #fff; font-weight: bold; line-height: 14px; text-align: center; } .ui-input-slider-btn-set:hover { background-color: #379b4a; cursor: pointer; } /* * ui slider */ .ui-slider { height: 20px; margin: 10px 0; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-user-select: none; user-select: none; } .ui-...
...tion 0-100 * @param value 0-100 * @param lightness 0-100 */ function color(color) { if(color instanceof color === true) { this.copy(color); return; } this.r = 0; this.g = 0; this.b = 0; this.a = 1; this.hue = 0; this.saturation = 0; this.value = 0; this.lightness = 0; this.format = 'hsv'; } function rgbcolor(r, g, b) { var color = new color(); color.setrgba(r, g, b, 1); return color; } function rgbacolor(r, g, b, a) { var color = new color(); color.setrgba(r, g, b, a); return color; } function hsvcolor(h, s, v) { var color = new color(); color.sethsv(h, s, v); return color; } function hsvacolor(h, s, v, a) { var color = new color(); color.sethsv(h, s, v); color.a = a; return color; } function hslcolor(h, s, l) {...
...And 65 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is created by setting the type attribute of a textbox to autocomplete.
...the autocomplete functionality is handled through one of more session objects, each of which can return a set of results given the current value of the textbox.
... the sessions can be set using the searchsessions attribute or by calling the addsession method.
...And 63 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
previous overview: asynchronous next this tutorial looks at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g.
... a set number of times per second), discusses what they are useful for, and considers their inherent issues.
... these functions are: settimeout() execute a specified block of code once after a specified time has elapsed.
...And 63 more matches
Index
MozillaTechXPCOMIndex
46 components.utils.setgczeal needstechnicalreview, xpcom, xpcom:language bindings, xpconnect this method lets scripts set the zeal level for garbage collection.
... you can get details on what this method does in js_setgczeal.
... 73 setting http request headers add-ons, extensions, http, xul, xulrunner http is one of the core technologies behind the web.
...And 63 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
6 flexgroup "flexgroup" is used to group flexible elements together and should be set to an integer.
... 30 browser.type xul attributes, xul reference type: one of the values below.the type of browser, which can be used to set access of the document loaded inside the browser.
... 80 currentset needshelp, xul attributes, xul reference no summary!
...And 60 more matches
Color picker tool - CSS: Cascading Style Sheets
-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-transform: lowercase; } .ui-input-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: 5px; color: #fff; font-weight: bold; line-height: 14px; text-align: center; } .ui-input-slider-btn-set:hover { background-color: #379b4a; cursor: pointer; } /* * color picker tool */ body { max-width: 1000px; margin: 0 auto; font-family: "segoe ui", arial, helvetica, sans-serif; box-shadow: 0 0 5px 0 #999; -moz-box-siz...
... } #picker-samples .sample[data-active='true'] { border-color: #999; } #picker-samples .sample[data-active='true']:after { content: ""; position: absolute; background: url('https://mdn.mozillademos.org/files/6065/arrow.png') center no-repeat; width: 100%; height: 12px; top: -12px; z-index: 2; } #picker-samples #add-icon { width: 100%; height: 100%; position: relative; box-shadow: inset 0px 0px 2px 0px #ddd; } #picker-samples #add-icon:hover { cursor: pointer; border-color: #ddd; box-shadow: inset 0px 0px 5px 0px #ccc; } #picker-samples #add-icon:before, #picker-samples #add-icon:after { content: ""; position: absolute; background-color: #eee; box-shadow: 0 0 1px 0 #eee; } #picker-samples #add-icon:before { width: 70%; height: 16%; top: 42%; left: 15%; } #picker-s...
...tion 0-100 * @param value 0-100 * @param lightness 0-100 */ function color(color) { if(color instanceof color === true) { this.copy(color); return; } this.r = 0; this.g = 0; this.b = 0; this.a = 1; this.hue = 0; this.saturation = 0; this.value = 0; this.lightness = 0; this.format = 'hsv'; } function rgbcolor(r, g, b) { var color = new color(); color.setrgba(r, g, b, 1); return color; } function rgbacolor(r, g, b, a) { var color = new color(); color.setrgba(r, g, b, a); return color; } function hsvcolor(h, s, v) { var color = new color(); color.sethsv(h, s, v); return color; } function hsvacolor(h, s, v, a) { var color = new color(); color.sethsv(h, s, v); color.a = a; return color; } function hslcolor(h, s, l) {...
...And 58 more matches
nsIDOMWindowUtils
ekeyevent(in long anativekeyboardlayout, in long anativekeycode, in long amodifierflags, in astring acharacters, in astring aunmodifiedcharacters); void sendnativemouseevent(in long ascreenx, in long ascreeny, in long anativemessage, in long amodifierflags, in nsidomelement aelement); nsiquerycontenteventresult sendquerycontentevent(in unsigned long atype, in unsigned long aoffset, in unsigned long alength, in long ax, in long ay); obsolete since gecko 31.0 nsiquerycontenteventresult sendquerycontentevent(in unsigned long atype, in unsigned long aoffset, in unsigned long alength, in long ax, in long ay, [optional] in unsigned long aadditionalflags); boolean sendselectionsetevent(in unsigned long aoffset, in unsigned long alength, in boolean areverse); ...
...obsolete since gecko 31.0 boolean sendselectionsetevent(in unsigned long aoffset, in unsigned long alength, [optional] in unsigned long aadditionalflags); void sendsimplegestureevent(in astring atype, in float ax, in float ay, in unsigned long adirection, in double adelta, in long amodifiers); void sendtextevent(in astring acompositionstring, in long afirstclauselength, in unsigned long afirstclauseattr, in long asecondclauselength, in unsigned long asecondclauseattr, in long athirdclauselength, in unsigned long athirdclauseattr, in long acaretstart, in long acaretlength); obsolete since gecko 26 boolean sendtouchevent(in astring atype, [array, size_is(count)] in pruint32 aidentifiers, [array, size_is(count)] in print32 axs, [array, size_is(count)] in pri...
...nt32 ays, [array, size_is(count)] in pruint32 arxs, [array, size_is(count)] in pruint32 arys, [array, size_is(count)] in float arotationangles, [array, size_is(count)] in float aforces, in pruint32 count, in long amodifiers, [optional] in boolean aignorerootscrollframe); void setcssviewport(in float awidthpx, in float aheightpx); void setdisplayport(in float axpx, in float aypx, in float awidthpx, in float aheightpx); void setresolution(in float axresolution, in float ayresolution); void startpccountprofiling(); void stoppccountprofiling(); void suppresseventhandling(in boolean asuppress); void suspendtimeouts(); nsidomfile wrapdomfile(nsifile afile); attributes attribute type descripti...
...And 57 more matches
Box-shadow generator - CSS: Cascading Style Sheets
-action="hexa"></div> </div> </div> </div> </div> <div class="wrap-right"> <div id="shadow_properties" class="category"> <div class="title"> shadow properties </div> <div class="group"> <div class="group property"> <div class="ui-slider-name"> inset </div> <div class="ui-checkbox" data-topic='inset'></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> position x </div> <div class="ui-slider-btn-set" data-topic="posx" data-type="sub"></div> <div class="ui-slider" data-topic="posx" ...
... data-min="-500" data-max="500" data-step="1"> </div> <div class="ui-slider-btn-set" data-topic="posx" data-type="add"></div> <div class="ui-slider-input" data-topic="posx" data-unit="px"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> position y </div> <div class="ui-slider-btn-set" data-topic="posy" data-type="sub"></div> <div class="ui-slider" data-topic="posy" data-min="-500" data-max="500" data-step="1"> </div> <div class="ui-slider-btn-set" data-topic="posy" data-type="add"></div> <div class="ui-slider-input" data-topic...
...="posy" data-unit="px"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> blur </div> <div class="ui-slider-btn-set" data-topic="blur" data-type="sub"></div> <div class="ui-slider" data-topic="blur" data-min="0" data-max="200" data-step="1"> </div> <div class="ui-slider-btn-set" data-topic="blur" data-type="add"></div> <div class="ui-slider-input" data-topic="blur" data-unit="px"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> spread </div> <div class="ui-slider-btn-set" data-topic="...
...And 56 more matches
IAccessibleText
other-licenses/ia2/accessibletext.idlnot scriptable a structure containing a substring and the start and end offsets in the enclosing string.
...this enum is used in textbeforeoffset(), textatoffset(), and textafteroffset().
... method overview hresult addselection([in] long startoffset, [in] long endoffset ); [propget] hresult attributes([in] long offset, [out] long startoffset, [out] long endoffset, [out] bstr textattributes ); [propget] hresult caretoffset([out] long offset ); [propget] hresult characterextents([in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [out] long height ); [propget] hresult ncharacters([out] long ncharacters ); [propget] hresult newtext([out] ia2textsegment newtext ); [propget] hresult nselections([out] long nselections ); [propget] hresult offsetatpoint([in] long x, [in] long y, [in] enum ia2coordinatetype coordtype, [out] long offset ); [propget] hresult oldtext([out] ia2textsegment oldtext ); hresult removeselect...
...And 55 more matches
nsIDocShell
boolean isbeingdestroyed(); void loadstream(in nsiinputstream astream, in nsiuri auri, in acstring acontenttype, in acstring acontentcharset, in nsidocshellloadinfo aloadinfo); native code only!
... void preparefornewcontentmodel(); void resumerefreshuris(); void setchildoffset(in unsigned long offset); native code only!
... void setcurrenturi(in nsiuri auri); void suspendrefreshuris(); void tabtotreeowner(in boolean forward, out boolean tookfocus); attributes attribute type description allowauth boolean certain dochshells (like the message pane) should not throw up auth dialogs because it can act as a password trojan.
...And 52 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is created by setting the type attribute of the textbox to autocomplete.
..., forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, selectionend, selectionstart, showcommentcolumn, showimagecolumn,size, tabindex, tabscrolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="history"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...if set to false or omitted, the value must be selected from the list.
...And 51 more matches
StringView - Archive of obsolete content
|*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function stringview (vinput, sencoding /* optional (default: utf-8) */, noffset /* optional */, nlength /* optional */) { var ftaview, awhole, araw, fputoutptcode, fgetoutptchrsize, ninptlen, nstartidx = isfinite(noffset) ?
... noffset : 0, ntranscrtype = 15; if (sencoding) { this.encoding = sencoding.tostring(); } encswitch: switch (this.encoding) { case "utf-8": fputoutptcode = stringview.pututf8charcode; fgetoutptchrsize = stringview.getutf8charlength; ftaview = uint8array; break encswitch; case "utf-16": fputoutptcode = stringview.pututf16charcode; fgetoutptchrsize = stringview.getutf16charlength; ftaview = uint16array; break encswitch; case "utf-32": ftaview = uint32array; ntranscrtype &= 14; break encswitch; default: /* case "ascii", or case "binarystring" or unknown cases */ ftaview = uint8array; ntranscrtype &= 14; } typeswitch: switch (typeof vinput) { case "string": /* the input argumen...
...*/ ftaview = vinput.constructor; ninptlen = vinput.length; awhole = vinput.byteoffset === 0 && vinput.length === ( ftaview === uint32array ?
...And 49 more matches
source-editor.jsm
next(boolean awrap); number findprevious(boolean awrap); event management void addeventlistener(string aeventtype, function acallback); void removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); number gettopindex(); boolean hasfocus(); void settopindex(number atopindex); content management operations number getcharcount(); string getindentationstring(); string getlinedelimiter(); number ...
...getlinecount(); number getlineend(number alineindex, boolean aincludedelimiter); number getlinestart(number alineindex); string getmode(); string gettext([optional] number astart, [optional] number aend); string getselectedtext(); void setmode(string amode); void settext(string atext, [optional] number astart, [optional] number aend); selection operations void dropselection(); number getcaretoffset(); object getcaretposition(); object getselection(); void setcaretoffset(number aoffset); void setcaretposition(number aline, [optional] number acolumn, [optional] number aalign); void setselection(number astart, number aend); breakpoint management ...
... void addbreakpoint(number alineindex, [optional] string acondition); array getbreakpoints(); boolean removebreakpoint(number alineindex); properties attribute type description dirty boolean set this value to false whenever you save the text; the editor will update it to true when the content is changed.
...And 49 more matches
Border-image generator - CSS: Cascading Style Sheets
ass="property"> <div class="name">fill</div> <div class="ui-checkbox" data-topic='slice-fill'></div> </div> </div> <!-- border-image-width --> <div id="border-width-control" class="category"> <div class="title"> border-image-width </div> </div> <!-- border-image-outset --> <div id="border-outset-control" class="category"> <div class="title"> border-image-outset </div> </div> <!-- other-settings --> <div id="aditional-properties" class="category"> <div class="title"> aditional-properties </div> <div class="property"> <div class="name"> repeat-x </...
...> <span id="out-border-slice" class="value"> </span> </div> <div class="css-property"> <span class="name"> border-image-width: </span> <span id="out-border-width" class="value"> </span> </div> <div class="css-property"> <span class="name"> border-image-outset: </span> <span id="out-border-outset" class="value"> </span> </div> <div class="css-property"> <span class="name"> border-image-repeat: </span> <span id="out-border-repeat" class="value"> </span> </div> <div class="css-property"> <span class="name"> borde...
...============================================================ */ .section { clear: both; padding: 0px; margin: 0px; } /* grouping * ========================================================================== */ .group:before, .group:after { content: ""; display: table; } .group:after { clear:both; } .group { zoom: 1; /* for ie 6/7 (trigger haslayout) */ } /* grid column setup * ========================================================================== */ .col { display: block; float:left; margin: 1% 0 1% 1.6%; } .col:first-child { margin-left: 0; } /* all browsers except ie6 and lower */ /* * ui component */ .ui-input-slider { height: 20px; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-user-select: none; user-select: none; } .ui-input...
...And 46 more matches
HTMLInputElement - Web APIs
formaction string: returns / sets the element's formaction attribute, containing the uri of a program that processes information submitted by the element.
... formenctype string: returns / sets the element's formenctype attribute, containing the type of content that is used to submit the form to the server.
... formmethod string: returns / sets the element's formmethod attribute, containing the http method that the browser uses to submit the form.
...And 45 more matches
Drawing and Event Handling - Plugins
for windowless plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable.
... for windowed plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a window.
...the browser calls npp_setwindow whenever the drawable changes.
...And 43 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
fixme: explain how setting this option and use next listings if we want to run firefox displaying none of its gui and only the contents of a certain xul file, we can launch firefox and set the option: -chrome file_url.xul another way, as shown in listing 1, is to use the window.opendialog() method, which can be used only within a xul window.
...we can also read in a stylesheet that we had set up ourselves.
...you can explicitly set or change this layout using the orient attribute, with options for horizontal and vertical.
...And 42 more matches
jspage - Archive of obsolete content
try(function(){return navigator.plugins["shockwave flash"].description; },function(){return new activexobject("shockwaveflash.shockwaveflash").getvariable("$version");})||"0 r0").match(/\d+/g);return{version:parseint(a[0]||0+"."+a[1],10)||0,build:parseint(a[2],10)||0}; })();function $exec(b){if(!b){return b;}if(window.execscript){window.execscript(b);}else{var a=document.createelement("script");a.setattribute("type","text/javascript"); a[(browser.engine.webkit&&browser.engine.version<420)?"innertext":"text"]=b;document.head.appendchild(a);document.head.removechild(a);}return b;}native.uid=1; var $uid=(browser.engine.trident)?function(a){return(a.uid||(a.uid=[native.uid++]))[0];}:function(a){return a.uid||(a.uid=native.uid++);};var window=new native({name:"window",legacy:(browser.engine.triden...
...; b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this; b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c); }var e=function(){return a.apply(b.bind||null,c);};if(b.delay){return settimeout(e,b.delay);}if(b.periodical){return setinterval(e,b.periodical);}if(b.attempt){return $try(e); }return e();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a}); },bindwithevent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){r...
...urn this.replace(b||(/\\?{([^{}]+)}/g),function(d,c){if(d.charat(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:""; });}});hash.implement({has:object.prototype.hasownproperty,keyof:function(b){for(var a in this){if(this.hasownproperty(a)&&this[a]===b){return a;}}return null; },hasvalue:function(a){return(hash.keyof(this,a)!==null);},extend:function(a){hash.each(a||{},function(c,b){hash.set(this,b,c);},this);return this;},combine:function(a){hash.each(a||{},function(c,b){hash.include(this,b,c); },this);return this;},erase:function(a){if(this.hasownproperty(a)){delete this[a];}return this;},get:function(a){return(this.hasownproperty(a))?this[a]:null; },set:function(a,b){if(!this[a]||this.hasownproperty(a)){this[a]=b;}return this;},empty:function(){hash.each(this,function(b,a){delete ...
...And 41 more matches
Styling a Tree - Archive of obsolete content
setting properties instead, you must use the properties attribute on the rows or cells to set one or more named properties.
...you can set multiple properties by separating them with spaces.
... set the property on a row or cell, as in the following example: <treerow properties="makeitblue"> css selectors for the tree the style sheet can take this property and use it to change the appearance of the row for unread messages or labels.
...And 38 more matches
Timing element visibility with the Intersection Observer API - Web APIs
its style looks like this: header { grid-column: 1 / -1; grid-row: 1; background-color: aliceblue; } grid-row is set to 1, since we want the header to be placed in the top row of the site's grid.
...the sidebar is represented using an <aside> element, and is styled as follows: aside { grid-column: 1; grid-row: 2; background-color: cornsilk; padding: 5px 10px; } aside ul { padding-left: 0; } aside ul li { list-style: none; } aside ul li a { text-decoration: none; } the most important thing to note here is that the grid-column is set to 1, to place the sidebar on the left-hand side of the screen.
...the grid-row is set to 2, to place it alongside the site body.
...And 38 more matches
Shell global objects
these are the global objects that are set up automatically by the spidermonkey js command-line interpreter when you start the program.
...the first call with a string argument sets the source buffer.
... setsharedarraybuffer() install the sharedarraybuffer object in the cross-worker mailbox.
...And 37 more matches
Redis Tips
but obviously, calling ice cream a nowhale food doesn't give you any sense of how good the ice cream is, or what sets it apart from other kinds of food that aren't made from whale meat but that are also very unlike ice cream -- it just gives the whaling industry a way to lump together people who don't use their products.
... so rather than thinking about redis as a database with some kind of non-existent relationship to sql, think of it as a data structure server with a rich set of commands for querying and manipulating those data structures over a network connection.
... redis data types include: strings hashes lists sets ordered sets (called zsets in redis) transactions publishers and subscribers this table lists some common programming tasks and data structures, and suggests some redis functions or data structures for them: dictionary lookup set, get, setnx, etc.
...And 37 more matches
Applying styles and colors - Web APIs
fillstyle = color sets the style used when filling shapes.
... strokestyle = color sets the style for shapes' outlines.
...by default, the stroke and fill color are set to black (css color value #000000).
...And 37 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
instead of configuring end user individual preferences files (~/.mozilla/default/randomdir/prefs.js) we now use a centralized default set of preferences.
... autoconfig directives here we want to set users central mail preferences: create one account from their login name, get their email address from an ldap request and set the enterprise imap and smtp servers.
... thunderbird.cfg (version 1) here's the complete file, first we get the user login name from environment variables, then configure the ldap address book, create an email account, and configure imap and smtp: [root@calaz /usr/lib/thunderbird] $ cat thunderbird.cfg //put everything in a try/catch try { // 1) env variables if(getenv("user") != "") { // *nix settings var env_user = getenv("user"); var env_home = getenv("home"); } else { // windows settings var env_user = getenv("username"); var env_home = getenv("homepath"); } var env_mozdebug= getenv("mozilla_debug"); // var env_user = prompt("indiquez votre login", toto); // 2) lock general preferences //ldap address book lockpref("ldap_2.prefs_migrated", true); lockpref("ldap_2.servers.ldap...
...And 36 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
<input type="range" name="range" min="0" max="25"/> html5 reset a button that resets the contents of the form to default values.
... <input type="reset" name="reset"/> search a single-line text field for entering search strings.
...since every <input> element, regardless of type, is based on the htmlinputelement interface, they technically share the exact same set of attributes.
...And 36 more matches
textbox - Archive of obsolete content
imeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment, inputfield, label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tabindex, textlength, timeout, type, value, valuenumber, wraparound methods decrease, increase, reset, select, setselectionrange style classes plain examples <vbox> <label control="your-name" value="enter your name:"/> <textbox id="your-name" value="john"/> </vbox> attributes cols type: integer for multiline textboxes, the number of columns to display.
...if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...And 33 more matches
JSAPI User Guide
the next section explains how to set them up, using jsapi functions.
...it can compile and execute scripts, get and set object properties, call javascript functions, convert javascript data from one type to another, create objects, and so on.
...for maximum ecmascript standard compliance, applications should also use js_setoptions to enable jsoption_varobjfix.
...And 33 more matches
nsIHttpChannel
//www.example.com/", null, null); method overview void getoriginalresponseheader(in acstring aheader, in nsihttpheadervisitor avisitor); acstring getrequestheader(in acstring aheader); acstring getresponseheader(in acstring header); boolean isnocacheresponse(); boolean isnostoreresponse(); void redirectto(in nsiuri anewuri); void setemptyrequestheader(in acstring aheader); void setreferrerwithpolicy(in nsiuri referrer, in unsigned long referrerpolicy); void setrequestheader(in acstring aheader, in acstring avalue, in boolean amerge); void setresponseheader(in acstring header, in acstring value, in boolean merge); void visitoriginalresponseheaders(in nsihttpheadervisitor avisitor); ...
...this should be set to false, for example, if the application knows that the corresponding document is likely to be very large.
... this attribute may only be set before the channel is opened.
...And 33 more matches
Block and Line Layout Cheat Sheet - Archive of obsolete content
mflags flags set on the frame to indicate its state.
... ns_frame_in_reflow this bit is set when the frame is being actively being reflowed.
... by default it is set in willreflow(), and unset in didreflow().
...And 31 more matches
IME handling guide
and editor sets these ime selections from mozilla::textrangetype which are sent by mozilla::widgetcompositionevent as mozilla::textrangearray.
...then, startcomposition(), setpendingcomposition(), flushpendingcomposition(), commitcomposition(), etc.
...the mdata value is a selected string at dispatching the dom event and it's automatically set by textcomposition.
...And 31 more matches
JavaScript Daemons Management - Archive of obsolete content
the following daemons management framework is the major version of setinterval – a little framework.
... advantages of this approch: abstraction passage of this object to javascript timers (both setinterval and settimeout) optimisation (avoiding closures) modularity the code the code of this framework is split into three files: daemon.js (the core) daemon-safe.js (an extension of the core which adds a replacement of setinterval with a recursive invocation of settimeout) daemon-methods.js (a wide and highly scalable collection of methods) the only independent module is daemon.js: ...
... about the “callback arguments” polyfill in order to make this framework compatible with internet explorer (which doesn't support sending additional parameters to timers' callback function, neither with settimeout() or setinterval()) we included the ie-specific compatibility code (commented code), which enables the html5 standard parameters' passage functionality in that browser for both timers (polyfill), at the end of the daemon.js module.
...And 30 more matches
Fundamental text and font styling - Learn web development
here we'll go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.
...but it was a rare occasion such as this that he did.</p> you can find the finished example on github (see also the source code.) color the color property sets the color of the foreground content of the selected elements (which is usually the text, but can also include a couple of other things, such as an underline or overline placed on text using the text-decoration property).
...but it was a rare occasion such as this that he did.</p> font families to set a different font on your text, you use the font-family property — this allows you to specify a font (or list of fonts) for the browser to apply to the selected elements.
...And 30 more matches
Gecko info for Windows accessibility vendors
we have chosen a subset of readonly methods in the dom needed for assistive technology vendors.
... the msaa tree and the dom tree are parallel structures, although the msaa tree is a subset of the dom tree.
...both controlled_by and controller_for are set in markup from the single dynamic content accessibility dynamic content aaa:controls attribute.
...And 30 more matches
Hacking Tips
therefore, the jit frames do not appear until you settle on the next breakpoint.
... to work-around this issue you can use the recording feature of gdb, to step one instruction, and settle back to where you came from with the following set of gdb commands: (gdb) record full (gdb) si (gdb) record goto 0 (gdb) record stop if you have a core file, you can use the gdb unwinder the same way, or do everything from the command line as follow: $ gdb -ex 'enable unwinder .* spidermonkey' -ex 'bt 0' -ex 'thread apply all backtrace' -ex 'quit' out/dist/bin/js corefile the gdb unwinder is supposed to be loaded by dist/bin/js-gdb.py and load python scripts which are located in js/src/gdb/mozilla under gdb.
... setting a breakpoint in the generated code (from gdb, x86 / x86-64, arm) to set a breakpoint the generated code of a specific jsscript compiled with ionmonkey.
...And 30 more matches
button - Archive of obsolete content
it is typically rendered as a grey outset rectangle.
...op, dir, disabled, dlgtype, group, icon, image, label, open, orient, tabindex, type properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tabindex, type examples <button label="press me" oncommand="alert('you pressed me!');"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...this means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state.
...And 29 more matches
toolbarbutton - Archive of obsolete content
em 2"/> </menupopup> </toolbarbutton> </toolbar> <toolbar id="radio-toolbar"> <toolbarbutton accesskey="1" label="radio 1" type="radio" group="radiogroup"/> <toolbarbutton accesskey="2" label="radio 2" type="radio" group="radiogroup"/> <toolbarbutton accesskey="3" label="radio 3" type="radio" group="radiogroup"/> </toolbar> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...this means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state.
... if you wish to have different behavior for how the states are adjusted, set the autocheck attribute to false and adjust the state with a script.
...And 29 more matches
2D maze game with device orientation - Game development
the phaser framework provides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself.
...the folder structure is quite straightforward: the starting point is the index.html file where we initialize the framework and set up an <canvas> to render the game on.
... setting up the canvas we will be rendering our game on canvas, but we won't do it manually — this will be taken care of by the framework.
...And 29 more matches
JSAPI reference
runtimes and contexts js_init added in spidermonkey 31 js_shutdown struct jsruntime js_newruntimeobsolete since jsapi 52 js_destroyruntime js_getruntimeprivate js_setruntimeprivate js_setnativestackquota added in spidermonkey 17 js_contextiteratorobsolete since jsapi 52 js_finish obsolete since jsapi 19 struct jscontext js_newcontext js_destroycontext js_destroycontextnogc js_setcontextcallback enum jscontextop js_getruntime js_getparentruntime added in spidermonkey 31 js_getobjectruntime added in spidermonkey 17 js_getcontex...
...tprivate js_setcontextprivate js_getsecondcontextprivate added in spidermonkey 17 js_setsecondcontextprivate added in spidermonkey 17 js_setinterruptcallback added in spidermonkey 31 js_getinterruptcallback added in spidermonkey 31 js_requestinterruptcallback added in spidermonkey 31 js_checkforinterrupt added in jsapi 45 js_destroycontextmaybegc obsolete since jsapi 14 js_setbranchcallback obsolete since javascript 1.9.1 js_setoperationcallback obsolete since jsapi 30 js_getoperationcallback obsolete since jsapi 30 js_triggeroperationcallback obsolete since jsapi 30 js_clearoperationcallback obsolete since javascript 1.9.1 js_getoperationlimit obsolete since javascript 1.9.1 js_setoperationlimit obsolete since javascript 1.9.1 js_max_operation_limit obsolete since javas...
...cript 1.9.1 js_operation_weight_base obsolete since javascript 1.9.1 js_setthreadstacklimit obsolete since jsapi 13 js_setscriptstackquota obsolete since javascript 1.8.6 js_setoptions obsolete since jsapi 27 js_getoptions obsolete since jsapi 27 js_toggleoptions obsolete since jsapi 27 enum jsversion jsversion_ecma_3 jsversion_1_6 jsversion_1_7 jsversion_1_8 jsversion_ecma_5 jsversion_default jsversion_unknown jsversion_latest js_getimplementationversion js_getversion js_setversionforcompartment added in spidermonkey 31 js_stringtoversion js_versiontostring js_setversion obsolete since jsapi 25 js::currentglobalornull added in spidermonkey 31 js_getglobalforscopechain obsolete since jsapi 25 js_getglobalobject obsolete since jsa...
...And 29 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
in this article, we'll make use of information introduced in the previous articles in our webxr tutorial series to construct an example which animates a rotating cube around which the user can move freely using a vr headset, keyboard, and/or mouse.
... while reading this article and the accompanying source code, it's helpful to keep in mind that the display for a 3d headset is a single screen, divided in half.
...contrarily, when rendering the right eye, the viewport is set to restrict drawing to the right half of the surface.
...And 29 more matches
CustomizableUI.jsm
this is analogous to the old currentset attribute.
...in order to register such a toolbar, set the 'overflowable' property to true, and provide the id of the anchor in the 'anchor' property.
... onwidgetreset(anode, acontainer) fired after a reset to default placements moves a widget's node to a different location.
...And 28 more matches
nsIAccessibleText
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void addselection(in long startoffset, in long endoffset); nsiaccessible getattributerange(in long offset, out long rangestartoffset, out long rangeendoffset); obsolete since gecko 1.9.1 wchar getcharacteratoffset(in long offset); void getcharacterextents(in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype); long getoffsetatpoint(in long x, in long y, in unsigned long coordtype); void getrangeextents(in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long co...
...ordtype); void getselectionbounds(in long selectionnum, out long startoffset, out long endoffset); astring gettext(in long startoffset, in long endoffset); astring gettextafteroffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); astring gettextatoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); nsipersistentproperties gettextattributes(in boolean includedefattrs, in long offset, out long rangestartoffset, out long rangeendoffset); astring gettextbeforeoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); void removeselection(in long selectionnum); void scrollsubstringto(in long startindex, in long endindex, in ...
...unsigned long scrolltype); void scrollsubstringtopoint(in long startindex, in long endindex, in unsigned long coordinatetype, in long x, in long y); void setselectionbounds(in long selectionnum, in long startoffset, in long endoffset); attributes attribute type description caretoffset long the current current caret offset.
...And 28 more matches
Creating a cross-browser video player - Developer guides
le="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></figcaption> </figure> even though this player will define its own custom control set, the controls attribute is still added to the <video> element, and the player's default control set is switched off later with javascript.
... a poster image is defined for the video, and the preload attribute is set to metadata, which informs the browser that it should initially only attempt to load the metadata from the video file rather than the entire video file.
... note: ie9 behaves differently than most other browsers when a poster attribute is set.
...And 28 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
5 api codingscripting, glossary, infrastructure an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface.
... utf-8 is the most common character set and includes the graphemes of the most popular human languages.
... 73 character set glossary, character encoding, character set a character set is an encoding system to let computers know how to recognize character, including letters, numbers, punctuation marks, and whitespace.
...And 27 more matches
AsyncTestUtils extended framework
bringing messages into the picture synthetic set definitions most of the code involved in creating synthetic messages takes an object that defines how to generate the set.
...(see the bottom of this page for links to the source files.) count: 10 the number of messages that should be in the set.
...(we will probably auto-correct that in the future.) if your set definition was {count: 3, age: {days: 7}, age_incr: {days: -1}}, then you would generate messages from 7, 6, and 5 days ago.
...And 27 more matches
nsIDOMXULElement
from: nsidomelement last changed in gecko 1.9 (firefox 3) method overview void blur(); void click(); void docommand(); void focus(); nsidomnodelist getelementsbyattribute(in domstring name, in domstring value); nsidomnodelist getelementsbyattributens(in domstring namespaceuri, in domstring name, in domstring value); attributes attribute type description align domstring gets/sets the value of the element's align attribute.
...removes the attribute if you set it to false.
... classname domstring gets/sets the value of the element's class attribute.
...And 27 more matches
Component; nsIPrefBranch
this object may be obtained from the preferences service (nsiprefservice) and used to get and set default and/or user preferences across the application.
...for example, if this object is created with the root "browser.startup.", the preferences "browser.startup.page", "browser.startup.homepage", and "browser.startup.homepage_override" can be accessed by simply passing "page", "homepage", or "homepage_override" to the various get/set methods.
...avalue); long getintpref(in string aprefname,requires gecko 54 [optional] in long adefaultvalue); long getpreftype(in string aprefname); void lockpref(in string aprefname); boolean prefhasuservalue(in string aprefname); boolean prefislocked(in string aprefname); void removeobserver(in string adomain, in nsiobserver aobserver); void resetbranch(in string astartingat); void setboolpref(in string aprefname, in long avalue); void setcharpref(in string aprefname, in string avalue); requires gecko 58 void setstringpref(in string aprefname, in utf8string avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, in nsisupports avalue); void setintpref(in string aprefname, in long a...
...And 27 more matches
tab - Archive of obsolete content
ArchiveMozillaXULtab
afterselected, beforeselected, command, crop, disabled, first-tab, image, label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tabindex, unread, validate, value properties accesskey, accessibletype, command, control, crop, disabled, image, label, linkedpanel, selected, tabindex, value examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... afterselected type: boolean this is set to true if the tab is immediately after the currently selected tab.
... this is automatically set when needed and you shouldn't adjust it manually.
...And 26 more matches
nsIFaviconService
afaviconuri); obsolete since gecko 22.0 nsiuri getfaviconforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconimageforpage(in nsiuri apageuri); obsolete since gecko 22.0 nsiuri getfaviconlinkforicon(in nsiuri afaviconuri); boolean isfailedfavicon(in nsiuri afaviconuri); void removefailedfavicon(in nsiuri afaviconuri); void setandloadfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); obsolete since gecko 22.0 void setfavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, in prtime aexpiration); obsolete since gecko 22...
....0 void setfavicondatafromdataurl(in nsiuri afaviconuri, in astring adataurl, in prtime aexpiration); obsolete since gecko 22.0 void setfaviconurlforpage(in nsiuri apageuri, in nsiuri afaviconuri); obsolete since gecko 22.0 attributes attribute type description defaultfavicon nsiuri the default favicon uri.
...this cache will also be written to if you use setandloadfaviconforpage() method and it encounters an error while fetching an icon.
...And 26 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
then, finally, the media source for the self-view <video> element indicated by the selfvideo constant is set to the camera and microphone stream, allowing the local user to see what the other peer sees.
... handling incoming tracks we next need to set up a handler for track events to handle inbound video and audio tracks that have been negotiatied to be received by this peer connection.
...otherwise, we set srcobject to the stream at index 0 in the streams array.
...And 26 more matches
Example and tutorial: Simple synth keyboard - Web APIs
the settings bar beneath the keyboard, we'll put some controls for configuring the layer.
... for now, we will have two controls: one to set the master volume and another to select what periodic waveform to use when generating notes.
... the volume control first we create the <div> to contain the settings bar, so it can be styled as needed.
...And 26 more matches
Using XMLHttpRequest - Web APIs
function reqlistener () { console.log(this.responsetext); } var oreq = new xmlhttprequest(); oreq.addeventlistener("load", reqlistener); oreq.open("get", "http://www.example.org/example.txt"); oreq.send(); types of requests a request made via xmlhttprequest can fetch the data in one of two ways, asynchronously or synchronously.
... the type of request is dictated by the optional async argument (the third argument) that is set on the xmlhttprequest.open() method.
... processing a responsetext property containing an html document if you use xmlhttprequest to get the content of a remote html webpage, the responsetext property is a string containing the raw html.
...And 26 more matches
Practical positioning examples - Learn web development
general setup to begin with, add the following between your opening and closing <style> tags: html { font-family: sans-serif; } * { box-sizing: border-box; } body { margin: 0; } this is just some general setup to set a sans-serif font on our page, use the border-box box-sizing model, and get rid of the default <body> margin.
... next, add the following just below your previous css: .info-box { width: 450px; height: 400px; margin: 0 auto; } this sets a specific width and height on the content, and centers it on the screen using the old margin: 0 auto trick.
... previously in the course we advised against setting a fixed height on content containers if at all possible; it is ok in this circumstance because we have fixed content in our tabs.
...And 25 more matches
Drawing graphics - Learn web development
add the following code into it, just below the opening <body> tag: <canvas class="mycanvas"> <p>add suitable fallback here.</p> </canvas> we have added a class to the <canvas> element so it will be easier to select if we have multiple canvases on the page, but we have removed the width and height attributes for now (you could add them back in if you wanted, but we will set them using javascript in a below section).
...in the second line we set both a new constant width and the canvas' width property equal to window.innerwidth (which gives us the viewport width).
... in the third line we set both a new constant height and the canvas' height property equal to window.innerheight (which gives us the viewport height).
...And 25 more matches
Mozilla DOM Hacking Guide
this is because, if we had a setlocation() method, it would take an nsidomlocation parameter, and not a url string.
...getproperty() is a function used by xpconnect when we are setting an unknown property on the object (window, in our case).
... in getproperty(), we check if the property being set is "location".
...And 25 more matches
Document - Web APIs
WebAPIDocument
document.body returns the <body> or <frameset> node of the current document.
... document.charactersetread only returns the character set being used by the document.
... document.fonts returns the fontfaceset interface of the current document.
...And 25 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
setattribute( aname, avalue ) sets the value of the specified attribute with the specified value.
...it does not, however, support outerhtml (which adds markup around an element, and has no standard equivalent) and innertext (which sets the text value of the node, and which you can achieve in mozilla by using textcontent).
...dom level 1 core introduced document fragments, which are lightweight documents that contain a subset of a normal document's interfaces.
...And 24 more matches
XUL element attributes - Archive of obsolete content
it is equivalent to setting the css visibility property to collapse.
... container type: boolean set to true if the element is to act as a container which can have child elements.
...this will be set by the template builder as needed.
...And 24 more matches
menuitem - Archive of obsolete content
if this value is set, it overrides an assigned key set in the key attribute.
... accesskey type: character this should be set to a character that is used as a shortcut key.
... use hasattribute() to determine whether this attribute is set instead of getattribute().
...And 24 more matches
CSS basics - Learn web development
for example, this css selects paragraph text, setting the color to red: p { color: red; } let's try it out!
... anatomy of a css ruleset let's dissect the css code for red paragraph text to understand how it works : the whole structure is called a ruleset.
... (the term ruleset is often referred to as just rule.) note the names of the individual parts: selector this is the html element name at the start of the ruleset.
...And 24 more matches
Video and Audio APIs - Learn web development
here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> this creates a video player inside the browser like so: you can review what all the html features do in the article linked above; for our purposes here, the most interesting attribute is controls, which enables the default set of playback controls.
...tyling: .controls { visibility: hidden; opacity: 0.5; width: 400px; border-radius: 10px; position: absolute; bottom: 20px; left: 50%; margin-left: -200px; background-color: black; box-shadow: 3px 3px 5px black; transition: 1s all; display: flex; } .player:hover .controls, player:focus .controls { opacity: 1; } we start off with the visibility of the custom controls set to hidden.
... in our javascript later on, we will set the controls to visible, and remove the controls attribute from the <video> element.
...And 24 more matches
Eclipse CDT
set an initial heap space of 1 gb and max heap space of 5 gb, say, by modifying the values of the following two lines in eclipse.ini: -xms1g -xmx5g if you fail to increase these limits, then you will likely find that eclipse either hangs when it tries to index the mozilla source or else that the code intelligence is very broken after the indexing "completes".
... express setup for the eclipse indexer to work well you must first build mozilla, so that it includes headers from the objdir etc.
... manual setup, and more more information can be found on the eclipse cdt manual setup page.
...And 24 more matches
NSS tools : certutil
-t reset the key database or token.
...the format of the validity-time argument is yymmddhhmmss[+hhmm|-hhmm|z], which allows offsets to be set relative to the validity end time.
...when specifying an offset time, use yymmddhhmmss+hhmm or yymmddhhmmss-hhmm for adding or subtracting time, respectively.
...And 24 more matches
nsINavBookmarksService
bookmarks consist of a set of user-customizable folders.
...gecko 2.0 void removefolderchildren(in long long aitemid); void removeitem(in long long aitemid); void removeobserver(in nsinavbookmarkobserver observer); void replaceitem(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports auserdata); void setfolderreadonly(in long long afolder, in boolean areadonly); void setfoldertitle(in print64 folder, in astring title); obsolete since gecko 1.9 void setitemdateadded(in long long aitemid, in prtime adateadded); void setitemguid(in long long aitemid, in astring aguid); obsolete since gecko 14.0 void setitemindex(in long long aitemid, in long anewindex); ...
... void setitemlastmodified(in long long aitemid, in prtime alastmodified); void setitemtitle(in long long aitemid, in autf8string atitle); void setkeywordforbookmark(in long long aitemid, in astring akeyword); obsolete since gecko 40.0 void setkeywordforuri(in nsiuri uri, in astring keyword); obsolete since gecko 1.9 obsolete since gecko 40.0 attributes attribute type description bookmarksmenufolder long long the item id of the bookmarks menu folder.
...And 24 more matches
nsISessionStore
astring gettabstate(in nsidomnode atab); astring gettabvalue(in nsidomnode atab, in astring akey); astring getwindowstate(in nsidomwindow awindow); astring getwindowvalue(in nsidomwindow awindow, in astring akey); void init(in nsidomwindow awindow); void persisttabattribute(in astring aname); void restorelastsession(); void setbrowserstate(in astring astate); void settabstate(in nsidomnode atab, in astring astate); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwindowstate(in nsidomwindow awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomno...
...de undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session.
... return value the string value that was previously assigned to akey using nsisessionstore.settabvalue(), or an empty string if no value is set for that key.
...And 24 more matches
Debugger.Script - Firefox Developer Tools
getalloffsets() if the instance refers to a jsscript, return an arrayl describing the relationship between bytecode instruction offsets and source code positions in this script.l is sparse, and indexed by source line number.
...if there is code forline, then l[line] is an array of offsets of byte code instructions that are entry points to that line.
... a[i] = i*i; calling getalloffsets() on that code might yield an array like this: [[0], [5, 20], , [10]] this array indicates that: the first line’s code starts at offset 0 in the script; the for statement head has two entry points at offsets 5 and 20 (for the initialization, which is performed only once, and the loop test, which is performed at the start of each iteration); the third line has no code; and the fourth line begins at offset 10.
...And 24 more matches
CanvasRenderingContext2D - Web APIs
this code draws a house: // set line width ctx.linewidth = 10; // wall ctx.strokerect(75, 140, 150, 110); // door ctx.fillrect(130, 190, 40, 60); // roof ctx.beginpath(); ctx.moveto(50, 140); ctx.lineto(150, 60); ctx.lineto(250, 140); ctx.closepath(); ctx.stroke(); the resulting drawing looks like this: reference drawing rectangles there are three methods that immediately draw rectangles to the canvas.
... canvasrenderingcontext2d.clearrect() sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.
... canvasrenderingcontext2d.setlinedash() sets the current line dash pattern.
...And 24 more matches
Starting up and shutting down a WebXR session - Web APIs
before you can begin to render your augmented or virtual reality scenario, you need to create and set up the webxr session, and you should know how to shut it down properly as well.
...with the extension in place, you can open up a developer tools panel that lets you control the position and orientation of the headset and any hand controllers, as well as button presses on the controllers.
... emulator usage while somewhat awkward compared to using an actual headset, this makes it possible to experiment with and developer webxr code on a desktop computer, where webxr isn't normally available.
...And 24 more matches
Client-side storage - Learn web development
this lets you persist data for long-term storage, save sites or documents for offline use, retain user-specific settings for your site, and more.
... saving data and assets locally so a site will be quicker (and potentially less expensive) to download, or be usable without a network connection.
... note: there are limits to the amount of data you can store using client-side storage apis (possibly both per individual api and cumulatively); the exact limit varies depending on the browser and possibly based on user settings.
...And 23 more matches
OS.File for the main thread
} let promise = file.write(view.subarray(pos, chunksize)); // write a subset of |data| return promise.then(function onsuccess(bytes) { return loop(pos + bytes); // ...
... file.close(); }, function onerror(reason) { file.close(); throw reason; }); return promise; } or a variant using task.js (or at least the subset already present on mozilla-central): let writestream = function writestream(data, outfile, chunksize) { return task.spawn(function() { let view = new uint8array(data); let pos = 0; while (pos < view.bytelength) { pos += yield outfile.write(view.subarray(pos, chunksize)); } outfile.close(); }).then( null, function onfailure(reason) { outfile.close(); throw ...
...void> move(in string sourcepath, in string destpath); promise<uint8array> read(in string path, [optional] in object options); promise<void> remove(in string path, [optional] in object options); promise<void> removeemptydir(in string path, [optional] in object options); promise<void> removedir(in string path, [optional] in object options); promise<void> setcurrentdirectory(in string path); promise<void> setdates(in string path, in date|number accessdate, in date|number modificationdate); promise<void> setpermissions(in string path, in object options ); promise<file.info> stat(in string path, [optional] in object options); promise<void> unixsymlink(in string targetpath, in string createpath); promise<void...
...And 23 more matches
certutil
-t reset the key database or token.
...the format of the validity-time argument is yymmddhhmmss[+hhmm|-hhmm|z], which allows offsets to be set relative to the validity end time.
... when specifying an offset time, use yymmddhhmmss+hhmm or yymmddhhmmss-hhmm for adding or subtracting time, respectively.
...And 23 more matches
HTMLTextAreaElement - Web APIs
01" y="65" width="190" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="396" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmltextareaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties accesskey string: returns / sets the element's accesskey attribute.
... autocapitalize string: returns / sets the element's capitalization behavior for user input.
... autocomplete autofocus boolean: returns / sets the element's autofocus attribute, indicating that the control should have input focus when the page loads cols unsigned long: returns / sets the element's cols attribute, indicating the visible width of the text area.
...And 23 more matches
Video player styling basics - Developer guides
ss-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.
... this "data-state" idea is also used for setting the current state of buttons within the video control set, which allows specific state styling.
... javascript as mentioned above, a data-state attribute is used in various places for styling purposes and these are set using javascript.
...And 23 more matches
ui/button/toggle - Archive of obsolete content
by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(state) { button.badge = state.badge + 1; if (state.checked) { bu...
...con-32.png", "64": "./icon-64.png" }, onchange: handlechange }); var panel = panels.panel({ contenturl: self.data.url("panel.html"), onhide: handlehide }); function handlechange(state) { if (state.checked) { panel.show({ position: button }); } } function handlehide() { button.state('window', {checked: false}); } disabling buttons you can disable a button by setting its disabled property to true.
...at the root is the global state, then there's a state you can set for each window, then a state you can set for each tab.
...And 22 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
setting up your development environment in order to develop (and test) extensions in a most convenient way it is recommended to apply some changes to firefox.
... in the following you will find a brief description how to do so; a more detailed one can be found under setting up an extension development environment.
... create a development profile if you want to partition your everyday browsing environment from your development environment in firefox, set up a second profile for development.
...And 22 more matches
listitem - Archive of obsolete content
properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tabindex, value style classes listitem-iconic examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... use hasattribute() to determine whether this attribute is set instead of getattribute().
... for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect.
...And 22 more matches
A first splash into JavaScript - Learn web development
example — guess the number game in this article we'll show you how to build up the simple game you can see below: top hidden code <!doctype html> <html> <head> <meta charset="utf-8"> <title>number guessing game</title> <style> html { font-family: sans-serif; } body { width: 50%; max-width: 800px; min-width: 480px; margin: 0 auto; } .lastresult { color: white; padding: 3px; } </style> </head> <body> <h1>number guessing ...
... here let randomnumber = math.floor(math.random() * 100) + 1; const guesses = document.queryselector('.guesses'); const lastresult = document.queryselector('.lastresult'); const loworhi = document.queryselector('.loworhi'); const guesssubmit = document.queryselector('.guesssubmit'); const guessfield = document.queryselector('.guessfield'); let guesscount = 1; let resetbutton; function checkguess() { let userguess = number(guessfield.value); if (guesscount === 1) { guesses.textcontent = 'previous guesses: '; } guesses.textcontent += userguess + ' '; if (userguess === randomnumber) { lastresult.textcontent = 'congratulations!
... you got it right!'; lastresult.style.backgroundcolor = 'green'; loworhi.textcontent = ''; setgameover(); } else if (guesscount === 10) { lastresult.textcontent = '!!!game over!!!'; loworhi.textcontent = ''; setgameover(); } else { lastresult.textcontent = 'wrong!'; lastresult.style.backgroundcolor = 'red'; if(userguess < randomnumber) { loworhi.textcontent = 'last guess was too low!' ; } else if(userguess > randomnumber) { loworhi.textcontent = 'last guess was too high!'; } } guesscount++; guessfield.value = ''; } guesssubmit.addeventlistener('click', checkguess); function setgameover() { guessfield.disabled = true; guesssubmit.d...
...And 22 more matches
NS ConvertASCIItoUTF16 external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find ...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
NS ConvertUTF8toUTF16 external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find ...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
PromiseFlatString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind ...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
nsAString (External)
94,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="http://developer.mozilla.org/en/nsliteralstring_(external)" shape="rect" title="nsliteralstring_(external)"> </map> method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar appendin...
... endreading prunichar* endreading() const - source charat prunichar charat(pruint32) const - source parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
...parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() const - source assign void assign(const nsastring&) - source parameters nsastring& astring void assign(const prunichar*, pruint32) - source parameters prunichar* adat...
...And 22 more matches
nsAutoString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind ...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
nsDependentString external
class declaration dependent strings method overview constructors rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lower...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
nsDependentSubstring external
class declaration substrings method overview constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const prunichar*, print32 (*) compare(const nsastring&, print32 (*) equals(const prunichar*, print32 (*) equals(const nsastring&, print32 (*) operator< operator<...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar* begin prunichar* end pruint32 newsize prunichar beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
nsStringContainer (External)
class declaration method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral find rfind findchar rfindchar ...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
nsString external
class declaration basic strings method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral lowercaseequalsliteral ...
... parameters pruint32 apos operator[] prunichar operator[](pruint32) const - source parameters pruint32 apos first prunichar first() const - source beginwriting pruint32 beginwriting(prunichar**, prunichar**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters prunichar** begin prunichar** end pruint32 newsize prunichar* beginwriting(pruint32) - source parameters pruint32 <anonymous> endwriting prunichar* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 22 more matches
nsIPromptService
you need to wrap them in a temporary object, which can be either empty or have a value property set to the out parameter type.
... button title flags these flags are used along with button position flags to set the labels of buttons in the prompt.
... constant value description button_delay_enable 67108864 standard buttons flags constant value description std_ok_cancel_buttons 513 selects the standard set of ok/cancel buttons.
...And 22 more matches
Drag Operations - Web APIs
when an image or link is dragged, the url of the image or link is set as the drag data, and a drag begins.
... to make other html elements draggable, three things must be done: set the draggable="true" on the element that you wish to make draggable.
... set the drag data in the above listener.
...And 22 more matches
WebGL model view projection - Web APIs
webglbox constructor the constructor looks like this: function webglbox() { // setup the canvas and webgl context this.canvas = document.getelementbyid('canvas'); this.canvas.width = window.innerwidth; this.canvas.height = window.innerheight; this.gl = mdn.createcontext(canvas); var gl = this.gl; // setup a webgl program, anything part of the mdn object is defined outside of this article this.webglprogram = mdn.createwebglprogramfromids(gl, 'vertex-shader', 'fra...
... webglbox.prototype.draw = function(settings) { // create some attribute data; these are the triangles that will end being // drawn to the screen.
... var data = new float32array([ //triangle 1 settings.left, settings.bottom, settings.depth, settings.right, settings.bottom, settings.depth, settings.left, settings.top, settings.depth, //triangle 2 settings.left, settings.top, settings.depth, settings.right, settings.bottom, settings.depth, settings.right, settings.top, settings.depth ]); // use webgl to draw this onto the screen.
...And 22 more matches
Fundamentals of WebXR - Web APIs
what webxr is and isn't webxr is an api for web content and apps to use to interface with mixed reality hardware such as vr headsets and glasses with integrated augmented reality features.
... this includes both managing the process of rendering the views needed to simulate the 3d experience and the ability to sense the movement of the headset or other motion sensing apparatus to provide the needed data to let you update the imagery shown to the user based on that movement.
... another key difference is that webxr has integrated support for the advanced input controllers that are used with most mixed reality headsets, while webvr relied on the gamepad api to support the controllers.
...And 22 more matches
DataView - JavaScript
var littleendian = (function() { var buffer = new arraybuffer(2); new dataview(buffer).setint16(0, 256, true /* littleendian */); // int16array uses the platform's endianness.
... function getuint64(dataview, byteoffset, littleendian) { // split 64-bit number into two 32-bit (4-byte) parts const left = dataview.getuint32(byteoffset, littleendian); const right = dataview.getuint32(byteoffset+4, littleendian); // combine the two 32-bit values const combined = littleendian?
... const bigint = window.bigint, bigthirtytwo = bigint(32), bigzero = bigint(0); function getuint64bigint(dataview, byteoffset, littleendian) { // split 64-bit number into two 32-bit (4-byte) parts const left = bigint(dataview.getuint32(byteoffset|0, !!littleendian)>>>0); const right = bigint(dataview.getuint32((byteoffset|0) + 4|0, !!littleendian)>>>0); // combine the two 32-bit values and return return littleendian ?
...And 22 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
36 by svg, svg attribute the by attribute specifies a relative offset value for an attribute that will be modified during an animation.
... 39 class reference, svg, svg attribute assigns a class name or set of class names to an element.
...their custom data are available via the svgelement interface of the element the attributes belong to, with the svgelement.dataset property.
...And 22 more matches
prefwindow - Archive of obsolete content
each pane will usually group together a set of related preferences.
...you can also set the lastselected attribute on the prefwindow tag to the id of the pane to start with.
... normally, you would not set this attribute as it will be set automatically such that the default pane is the same as the one showing when the preferences dialog was last closed.
...And 21 more matches
tabbrowser - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] this element is used for holding a set of read-only views of web documents.
... attributes autocompleteenabled, autocompletepopup, autoscroll, contentcontextmenu, contenttooltip, handlectrlpageupdown, onbookmarkgroup, onnewtab, tabmodalpromptshowing properties browsers, cangoback, cangoforward, contentdocument, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowseratindex, getbrowserindexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalprompt...
...box, goback, gobackgroup, goforward, goforwardgroup, gohome, gotoindex, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithflags, removealltabsbut, removecurrenttab, removeprogresslistener, removetab, removetabsprogresslistener,replacegroup, selecttabatindex, seticon, showonlythesetabs, stop, unpintab attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
...And 21 more matches
Responsive images - Learn web development
objective: learn how to use features like srcset and the <picture> element to implement responsive image solutions on websites.
...here's a simple example: this works well on a wide screen device, such as a laptop or desktop (you can see the example live and find the source code on github.) we won't discuss the css much in this lesson, except to say that: the body content has been set to a maximum width of 1200 pixels — in viewports above that width, the body remains at 1200px and centers itself in the available space.
... the header image has been set so that its center always stays in the center of the header, no matter what width the heading is set at.
...And 21 more matches
Introduction to automated testing - Learn web development
commercial cross-browser testing apps like lambdatest, sauce labs, browserstack, and testingbot are based on selenium, but allow you to access their set up remotely using a simple interface, saving you the hassle of setting up your own testing system.
... we will look at how to set up your own selenium-based testing system in the next article.
... in this article, we'll look at how to set up a task runner, and use the basic functionality of commercial systems like the ones mentioned above.
...And 21 more matches
PKCS11 Implement
installing modules and informing the user of changes in the cryptographic modules settings.
...if the ckf_removable_device flag is set, nss also calls c_getslotinfo whenever it looks up slots to make sure the token is present.
... if the ckf_removable_device flag is not set, nss uses that token information without checking again.
...And 21 more matches
Python binding for NSS
nss/nspr objects which have "get" and "set" api function calls are exposed as python properties.
...also, any "global" values which are set in python-nss are actually thread-local.
... examples of this are the various callbacks which can be set and their parameters.
...And 21 more matches
sslintro.html
warning: some of the ssl header files provided as part of nss 2.0 include both public apis documented in the nss 2.0 documentation set and private apis intended for internal use by the nss implementation of ssl.
... initialization initialization includes setting up configuration files, setting global defaults, and setting up callback functions.
... pk11_setpasswordfunc.
...And 21 more matches
Using IndexedDB - Web APIs
if everything succeeds, a success event (that is, a dom event whose type property is set to "success") is fired with request as its target.
...otherwise, if there was any problem, an error event (that is, a dom event whose type property is set to "error") is fired at request.
... creating or updating the version of the database when you create a new database or increase the version number of an existing database (by specifying a higher version number than you did previously, when opening a database), the onupgradeneeded event will be triggered and an idbversionchangeevent object will be passed to any onversionchange event handler set up on request.result (i.e., db in the example).
...And 21 more matches
Signaling and video calling - Web APIs
note: if you try out the example on glitch, please note that any changes made to the code will immediately reset any connections.
...the server supports several message types to handle tasks, such as registering new users, setting usernames, and sending public chat messages.
... an icecandidate event is sent to the rtcpeerconnection to complete the process of adding a local description using pc.setlocaldescription(offer).
...And 21 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
when the instrument plays, it will move across this set of beats and loop the bar.
...however, instead of using the standard waves that come by default, we're going to create our own using the periodicwave interface and values set in a wavetable.
... the oscillator now we can create an oscillatornode and set its wave to the one we've created: function playsweep() { let osc = audioctx.createoscillator(); osc.setperiodicwave(wave); osc.frequency.value = 440; osc.connect(audioctx.destination); osc.start(); osc.stop(audioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it?
...And 21 more matches
Keyed collections - JavaScript
« previousnext » this chapter introduces collections of data which are indexed by a key; map and set objects contain elements which are iterable in the order of insertion.
... let sayings = new map(); sayings.set('dog', 'woof'); sayings.set('cat', 'meow'); sayings.set('elephant', 'toot'); sayings.size; // 3 sayings.get('dog'); // woof sayings.get('fox'); // undefined sayings.has('bird'); // false sayings.delete('dog'); sayings.has('dog'); // false for (let [key, value] of sayings) { console.log(key + ' goes ' + value); } // "cat goes meow" // "elephant goes toot" sayings.clear(); sayings.size; // 0 ...
...objects allow you to set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key.
...And 21 more matches
Date - JavaScript
host system) time zone and offset.
... 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()).
...(negative values are returned for prior times.) date.prototype.gettimezoneoffset() returns the time-zone offset in minutes for the current locale.
...And 21 more matches
Elements - Archive of obsolete content
css: div { -moz-binding: url(mybinding.xml#default); } dom: elementreference.style.mozbinding = "url(mybinding.xml#default)"; in both cases above we are using binding with id="default" contained in file mybinding.xml starting with firefox 3, you can also use a data: url to embed the binding inline: div { -moz-binding: url(data:text/xml;charset=utf-8,%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cbindings%20id%3d%22xbltestbindings%22%20xmlns%3d%22http%3a//www.mozilla.org/xbl%22%3e%0a%20%20%3cbinding%20id%3d%22xbltest%22%3e%3ccontent%3epass%3c/content%3e%3c/binding%3e%0a%3c/bindings%3e%0a); } since data: urls don't support fragment identifiers, the first binding found in the embedded xml is used instead.
... for clarity's sake, here's what the embedded xml in the previous example looks like: <?xml version="1.0"?> <bindings id="xbltestbindings" xmlns="http://www.mozilla.org/xbl"> <binding id="xbltest"><content>pass</content></binding> </bindings> only css declarations provide an easy way to attach bindings to any set of elements.
...by setting this attribute, you can have an element have the layout and display characteristics of an existing element.
...And 20 more matches
listbox - Archive of obsolete content
navigation, itemcount, listboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> <listbox id="thelist" rows="10" width="400"> <listhead> <listheader label="1ct ...
...ementbyid('thelist'); gems = [ {gem: "ruby", price: "$3,500 - $4,600"}, {gem: "emerald", price: "$700 - 4,250"}, {gem: "blue sapphire", price: "$3,400 - $4,500"}, {gem: "diamond", price: "$5,600 - $16,000"} ]; for (var i = 0; i < gems.length; i++) { var row = document.createelement('listitem'); var cell = document.createelement('listcell'); cell.setattribute('label', gems[i].gem); row.appendchild(cell); cell = document.createelement('listcell'); cell.setattribute('label', gems[i].price ); row.appendchild(cell); thelist.appendchild(row); } attributes disabled type: boolean indicates whether the element is disabled or not.
... if this attribute is set, the element is disabled.
...And 20 more matches
menulist - Archive of obsolete content
tem, contains, getindexofitem, getitematindex, insertitemat, removeallitems, removeitemat, select examples <menulist> <menupopup> <menuitem label="option 1" value="1"/> <menuitem label="option 2" value="2"/> <menuitem label="option 3" value="3"/> <menuitem label="option 4" value="4"/> </menupopup> </menulist> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...if this attribute is set, the element is disabled.
...And 20 more matches
Index - Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites.
... 13 aprender y obtener ayuda beginner, learn, learning, web development, getting help it is great that you are putting some time into learning a new set of skills, but there are good practices to employ that will make your learning more effective.
... 20 how do you set up a local testing server?
...And 20 more matches
nsIMsgDBHdr
it is also mandatory to set msghdr.folder.msgdatabase = null after performing this kind of operations to prevent leaking.
... method overview astring getproperty(in string propertyname); void setproperty(in string propertyname, in astring propertystr); void setstringproperty(in string propertyname, in string propertyvalue); string getstringproperty(in string propertyname); unsigned long getuint32property(in string propertyname); void setuint32property(in string propertyname, in unsigned long propertyval); void markread(in boolean read); void markflagged(in boolean flagged); void markhasattachments(in boolean hasattachments); void setprioritystring(in string priority); unsigned long orflags(in unsigned long flags); unsigned long andflags(in unsigned long ...
...flags); void setreferences(in string references); acstring getstringreference(in long refnum); void setrecipientsarray(in string names, in string addresses,in unsigned long numaddresses); void setcclistarray(in string names, in string addresses,in unsigned long numaddresses); void setbcclistarray(in string names, in string addresses,in unsigned long numaddresses);new in thunderbird 3.1 [noscript] void getauthorcollationkey(out octetptr key, out unsigned long len); [noscript] void getsubjectcollationkey(out octetptr key, out unsigned long len); [noscript] void getrecipientscollationkey(out octetptr key, out unsigned long len); attributes attribute type description isread boolean readon...
...And 20 more matches
Using HTTP cookies - HTTP
WebHTTPCookies
cookies are mainly used for three purposes: session management logins, shopping carts, game scores, or anything else the server should remember personalization user preferences, themes, and other settings tracking recording and analyzing user behavior cookies were once used for general client-side storage.
... creating cookies after receiving an http request, a server can send one or more set-cookie headers with the response.
...additional restrictions to a specific domain and path can be set, limiting where the cookie is sent.
...And 20 more matches
HTTP Index - HTTP
WebHTTPIndex
30 reason: credential is not supported if the cors header ‘access-control-allow-origin’ is ‘*’ cors, corsnotsupportingcredentials, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the cors request was attempted with the credentials flag set, but the server is configured using the wildcard ("*") as the value of access-control-allow-origin, which doesn't allow the use of credentials.
... 33 reason: expected ‘true’ in cors header ‘access-control-allow-credentials’ cors, corsmissingallowcredentials, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the cors request requires that the server permit the use of credentials, but the server's access-control-allow-credentials header's value isn't set to true to enable their use.
...browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script.
...And 20 more matches
Details of the object model - JavaScript
a class defines all of the properties that characterize a certain set of objects (considering methods and fields in java, or members in c++, to be properties).
... a class is abstract rather than any particular member in a set of objects it describes.
... for example, the employee class could represent the set of all employees.
...And 20 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
in order to set universalxpconnect privileges, you need to run the code in listing 2.
... listing 2: setting privileges netscape.security.privilegemanager.enableprivilege('universalxpconnect'); note: this is unneeded when the code is part of an extension, and will result in rejection if submitted to addons.mozilla.org.
...on windows vista, it will be located at c:\users\username\appdata\roaming\mozilla\firefox\profiles\random number.default\ ; on windows xp or 2000, it will be c:\documents and settings\username\application data\mozilla\firefox\profiles\random number.default\ ; on linux, it will be ~/.mozilla/firefox/random number.default/ ; on mac os x, it will be ~/library/application support/firefox/profiles/random number.default/ in the interests of security, delete these lines from prefs.js after finishing these tests.
...And 19 more matches
richlistbox - Archive of obsolete content
vigation, itemcount, scrollboxobject, selectedcount, selectedindex, selecteditem, selecteditems, seltype, suppressonselect, tabindex, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensureindexisvisible, getindexoffirstvisiblerow, getindexofitem, getitematindex, getnumberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <richlistbox> <richlistitem> <description>a xul description!</description> </richlistitem> <richlistitem> <button label="a xul button"/> </richlistitem> </richlistbox> the richlistbox element contains multiple richlistitem elements, which ca...
...if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...And 19 more matches
tree - Archive of obsolete content
ArchiveMozillaXULtree
« xul reference home [ examples | attributes | properties | methods | related ] a container which can be used to hold a tabular or hierarchical set of rows of elements.
... if you would like to allow the tree to be horizontally scrolled, simply set the width attributes for each column to make the tree wider than its containing object.
...the custom view should be attached to the tree by setting its view property.
...And 19 more matches
UI pseudo-classes - Learn web development
:valid and :invalid, and :in-range and :out-of-range: target form controls that are valid/invalid according to form validation constraints set on them, or in-range/out-of-range.
...with the disabled html attribute set), and read-write or read-only form controls (e.g.
... with the readonly html attribute set).
...And 19 more matches
Working with Svelte stores - Learn web development
a store is simply an object with a subscribe() method that allows interested parties to be notified whenever the store value changes, and an optional set() method that allows you to set new values for the store.
... this setup allows us to work with stores in a reactive way.
...if you implement the subscribe() and set() methods, like we'll do later, the reactive $store syntax will also apply to your stores.
...And 19 more matches
Mozilla internal string guide
*/ void replacetabs(nsastring& data) { char16_t* cur = data.beginwriting(); char16_t* end = data.endwriting(); for (; cur < end; ++cur) { if (char16_t('\t') == *cur) *cur = char16_t(' '); } } you may change the length of a string via setlength().
... int pos = 0; while (cur < end) { if (char16_t('\t') != *cur) { ++pos; ++cur; } else { len += 3; data.setlength(len); // after setlength, read `cur` and `end` again cur = data.beginwriting() + pos; end = data.endwriting(); // move the remaining data over if (pos < len - 1) memmove(cur + 4, cur + 1, (len - 1 - pos) * sizeof(char16_t)); // fill the tab with spaces *cur = char16_t(' '); *(cur + 1) = char16_t(' '); *(cur + 2) = char16_t(' '...
...); *(cur + 3) = char16_t(' '); pos += 4; cur += 4; } } } if a string buffer becomes smaller while writing it, use setlength to inform the string class of the new size: /** * remove every tab character from `data` */ void removetabs(nsastring& data) { int len = data.length(); char16_t* cur = data.beginwriting(); char16_t* end = data.endwriting(); while (cur < end) { if (char16_t('\t') == *cur) { len -= 1; end -= 1; if (cur < end) memmove(cur, cur + 1, (end - cur) * sizeof(char16_t)); } else { cur += 1; } } data.setlength(len); } note that using beginwriting() to make a string longer is not ok.
...And 19 more matches
NS ConvertUTF16toUTF8 external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
NS LossyConvertUTF16toASCII external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
PromiseFlatCString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsACString (External)
16toascii_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_(external)"></map> method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsCAutoString (External)
class declaration method overview get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfindchar ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsCStringContainer (External)
class declaration method overview beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare(const char*, print32 (*) compare(const nsacstring&, print32 (*) equals(const char*, print32 (*) equals(const nsacstring&, print32 (*) operator< operator<= operator== operator>= operat...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char* begin char* end pruint32 newsize char beginwriting(pruint32) - source parameters pruint32 alen endwriting char endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsCString external
class declaration method overview constructors get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsDependentCString external
class declaration method overview constructors rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsDependentCSubstring external
class declaration method overview constructors rebind beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral operator= replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar rfin...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsLiteralCString (External)
class declaration method overview rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsLiteralString (External)
class declaration method overview rebind get operator= adopt beginreading endreading charat operator[] first beginwriting endwriting setlength length isempty setisvoid isvoid assign assignliteral replace append appendliteral operator+= insert cut truncate stripchars stripwhitespace trim defaultcomparator compare equals operator< operator<= operator== operator>= operator> operator!= equalsliteral find rfind findchar ...
... const - source parameters pruint32 apos operator[] char operator[](pruint32) const - source parameters pruint32 apos first char first() const - source beginwriting pruint32 beginwriting(char**, char**, pruint32) - source get the length, begin writing, and optionally set the length of a string all in one operation.
... parameters char** begin char** end pruint32 newsize char* beginwriting(pruint32) - source parameters pruint32 alen endwriting char* endwriting() - source setlength prbool setlength(pruint32) - source parameters pruint32 alen length pruint32 length() const - source isempty prbool isempty() const - source setisvoid void setisvoid(prbool) - source parameters prbool val isvoid prbool isvoid() ...
...And 19 more matches
nsIHTMLEditor
id insertelementatselection(in nsidomelement aelement, in boolean adeleteselection); void insertfromdrop(in nsidomevent aevent); void inserthtml(in astring ainputstring); void inserthtmlwithcontext(in astring ainputstring, in astring acontextstr, in astring ainfostr, in astring aflavor, in nsidomdocument asourcedoc, in nsidomnode adestinationnode, in long adestinationoffset, in boolean adeleteselection); void insertlinkaroundselection(in nsidomelement aanchorelement); boolean isanonymouselement(in nsidomelement aelement); void makeorchangelist(in astring alisttype, in boolean entirelist, in astring abullettype); boolean nodeisblock(in nsidomnode node); void pastenoformatting(in long aselectiontype); void rebuildd...
...siatom aproperty, in astring aattribute, in astring avalue); void removeinlineproperty(in nsiatom aproperty, in astring aattribute); void removeinsertionlistener(in nsicontentfilter infilter); void removelist(in astring alisttype); void replaceheadcontentswithhtml(in astring asourcetoinsert); void selectelement(in nsidomelement aelement); void setbackgroundcolor(in astring acolor); void setbodyattribute(in astring aattr, in astring avalue); void setcaretafterelement(in nsidomelement aelement); void setcssinlineproperty(in nsiatom aproperty, in astring aattribute, in astring avalue); void setdocumenttitle(in astring atitle); void setinlineproperty(in nsiatom aproperty, in astring aattribute, in a...
...string avalue); void setparagraphformat(in astring aparagraphformat); void updatebaseurl(); attributes attribute type description iscssenabled boolean a boolean which is true is the htmleditor has been instantiated with css knowledge and if the css pref is currently checked.
...And 19 more matches
nsIMsgFolder
inherits from: nsisupports method overview void startfolderloading(); void endfolderloading(); void updatefolder(in nsimsgwindow awindow); nsimsgfilterlist getfilterlist(in nsimsgwindow msgwindow); void setfilterlist(in nsimsgfilterlist filterlist); void forcedbclosed(); void delete(); void deletesubfolders(in nsisupportsarray folders, in nsimsgwindow msgwindow); void propagatedelete(in nsimsgfolder folder, in boolean deletestorage,in nsimsgwindow msgwindow); void recursivedelete(in boolean deletestorage, in nsimsgwindow msgwindow); void createsu...
...ow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesummarytotals(in boolean force); void summarychanged(); long getnumunread(in boolean deep); long gettotalmessages(in boolean deep); void clearnewmessages(); void clearrequirescleanup(); void setflag(in unsigned long flag); void clearflag(in unsigned long flag); boolean getflag(in unsigned long flag); void toggleflag(in unsigned long flag); void onflagchange(in unsigned long flag); void setprefflag(); nsimsgfolder getfolderswithflag(in unsigned long flags, in unsigned long resultsize, out unsigned long numfolders); nsisupports...
... void acquiresemaphore(in nsisupports semholder); void releasesemaphore(in nsisupports semholder); boolean testsemaphore(in nsisupports semholder); void getnewmessages(in nsimsgwindow awindow, in nsiurllistener alistener); void writetofoldercache(in nsimsgfoldercache foldercache, in boolean deep); long getnumnewmessages(in boolean deep); void setnumnewmessages(in long numnewmessages); acstring generatemessageuri(in nsmsgkey msgkey); void addmessagedispositionstate(in nsimsgdbhdr amessage,in nsmsgdispositionstate adispositionflag); void markmessagesread(in nsisupportsarray messages, in boolean markread); void markallmessagesread(); void markmessagesflagged(in nsisupportsarray messages, in boolea...
...And 19 more matches
nsIWritablePropertyBag2
xpcom/ds/nsiwritablepropertybag2.idlscriptable this interface extends nsipropertybag2 with methods for setting properties.
... 1.0 66 introduced gecko 1.8 inherits from: nsipropertybag2 last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setpropertyasacstring(in astring prop, in acstring value); void setpropertyasastring(in astring prop, in astring value); void setpropertyasautf8string(in astring prop, in autf8string value); void setpropertyasbool(in astring prop, in boolean value); void setpropertyasdouble(in astring prop, in double value); void setpropertyasint32(in astring prop, in print32 value); void setpropertyasint64(in astring prop, in print64 value); void setpropertyasinterface(in astring prop, in nsisupports value); void setpropertyasuint32(in astring prop, in p...
...ruint32 value); void setpropertyasuint64(in astring prop, in pruint64 value); methods setpropertyasacstring() void setpropertyasacstring( in astring prop, in acstring value ); parameters prop property to set the value of.
...And 19 more matches
WebGLRenderingContext - Web APIs
webglrenderingcontext.viewport() sets the viewport.
... webglrenderingcontext.blendcolor() sets the source and destination blending factors.
... webglrenderingcontext.blendequation() sets both the rgb blend equation and alpha blend equation to a single equation.
...And 19 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
the location and movement of the user's headset represent their head's position and orientation in the virtual environment.
... representing a position using a reference space as covered in defining spatial relationships with reference spaces in geometry and reference spaces in webxr, reference spaces establish a local coordinate system which is offset from another coordinate system that is itself defined by some other space.
... the first is described above: applying a reference space to an offset (or vice-versa, since the result is the same) to determine the transform matrix that represents the resulting location in the space's coordinate system.
...And 19 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
this article demonstrates how to use a constantsourcenode to link multiple parameters together so they share the same value, which can be changed by simply setting the value of the constantsourcenode.offset parameter.
...for example, perhaps you have a set of oscillators, and two of them need to share the same, configurable volume, or you have a filter that's been applied to certain inputs but not to all of them.
...since constantsourcenode's offset value is simply sent straight through to all of its outputs, it acts as a splitter for that value, sending it to each connected parameter.
...And 19 more matches
Variable fonts guide - CSS: Cascading Style Sheets
this allows for common typographic techniques such as setting different size headings in different weights for better readability at each size, or using a slightly narrower width for data-dense displays.
...the lower-level syntax (font-variation-settings) was the first mechanism implemented in order to test the early implementations of variable font support, and is necessary to utilize new or custom axes beyond the five registered ones.
...therefore wherever possible, the appropriate property should be used, with the lower-level syntax of font-variation-settings only being used to set values or axes not available otherwise.
...And 19 more matches
ui/button/action - Archive of obsolete content
by default the badge's color is red, but you can set your own color using the badgecolor property, specified as a css <color> value: var { togglebutton } = require("sdk/ui/button/toggle"); var button = togglebutton({ id: "my-button1", label: "my button1", icon: "./icon-16.png", onchange: changed, badge: 0, badgecolor: "#00aaaa" }); function changed(state) { button.badge = state.badge + 1; if (state.checked) { bu...
... disabling buttons you can disable a button by setting its disabled property to true.
... you can set state to be specific to a window or tab using the button's state() method.
...And 18 more matches
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
methods add(items) clear() contexton(node) hide() insertbefore(newitems, target) item(target) popupon(node) remove(target) replace(target, newitems) reset() set(items) show(anchornode) add(items) adds items to the menu.
...this method and set() are the recommended methods of adding items to a menu.
... reset() reverts all the changes to the menu that the feature has made.
...And 18 more matches
Space Manager Detailed Design - Archive of obsolete content
* * @return pr_true if there are bands and pr_false if there are no bands */ prbool ymost(nscoord& aymost) const; /** * returns a band starting at the specified y-offset.
... * * the local coordinate space origin, the y-offset, and the max size * describe a rectangle that's used to clip the underlying band of * available space, i.e.
... * {0, ayoffset, amaxsize.width, amaxsize.height} in the local * coordinate space * * @param ayoffset the y-offset of where the band begins.
...And 18 more matches
Adding Properties to XBL-defined Elements - Archive of obsolete content
the xbl interface javascript and the dom provide access to get and set the properties of elements.
...that way, all you need is to get a reference to the element (using document.getelementbyid or a similar function) and then get or set the additional properties and call the methods on it.
...you can use the name from a script to get and set the value.
...And 18 more matches
menuseparator - Archive of obsolete content
if this value is set, it overrides an assigned key set in the key attribute.
... accesskey type: character this should be set to a character that is used as a shortcut key.
... command type: id set to the id of a command element that is being observed by the element.
...And 18 more matches
preference - Archive of obsolete content
attributes disabled, instantapply, inverted, name, onchange, readonly, tabindex, type properties defaultvalue, disabled, hasuservalue, inverted, locked, name, preferences, readonly, tabindex, type, value, valuefrompreferences methods reset examples <preferences> <preference id="pref_id" name="preference.name" type="int"/> </preferences> see preferences system for a complete example.
...if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...And 18 more matches
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.
...using a very simple technique of setting the max-width property to 100%, images would scale down smaller if their containing column became narrower than the image's intrinsic size, but never grow larger.
... it is important to understand that responsive web design isn't a separate technology — it is a term used to describe an approach to web design or a set of best practices, used to create a layout that can respond to the device being used to view the content.
...And 18 more matches
Styling lists - Learn web development
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 investigate the list elements using browser developer tools, you'll notice a couple of styling defaults: the <ul> and <ol> elements have a top and bottom margin of 16px (1em) and a padding-left of 40px (2.5em.) the list items (<li> elements) have no set defaults for spacing.
... the <dl> element has a top and bottom margin of 16px (1em), but no padding set.
...ub, and find the source code too.) the css used for the text styling and spacing is as follows: /* general styles */ html { font-family: helvetica, arial, sans-serif; font-size: 10px; } h2 { font-size: 2rem; } ul,ol,dl,p { font-size: 1.5rem; } li, p { line-height: 1.5; } /* description list styles */ dd, dt { line-height: 1.5; } dt { font-weight: bold; } the first rule sets a sitewide font and a baseline font size of 10px.
...And 18 more matches
Basic native form controls - Learn web development
in this particular article we will look at the original set of form controls, available in all browsers since the early days of the web.
... objective: to understand in detail the original set of native form widgets available in browsers for collecting data, and how to implement them using html.
... you've already met some form elements, including <form>, <fieldset>, <legend>, <textarea>, <label>, <button>, and <input>.
...And 18 more matches
TypeScript support in Svelte - Learn web development
typescript: optional static typing for javascript typescript is a superset of javascript that provides features such as optional static typing, classes, interfaces, and generics.
... best of all, javascript code is valid typescript code; typescript is a superset of javascript.
...in this section we'll show you how to setup a svelte project with typescript support to give it a try.
...And 18 more matches
Displaying Places information using views
you may specify the attribute directly in the xul or set its corresponding property via javascript.
...for more complicated queries or queries whose uris you plan on changing, you will want to set the view's place property dynamically using javascript.
... note that in the latter case it is not sufficient to call setattribute on the element; use the element's place property instead.
...And 18 more matches
Starting WebLock
this is where a new service that manages sets of related data comes in handy.
... the nsicategoryservice maintains sets of name-value pairs like the one below.
...each category contains a set of name-value pairs.
...And 18 more matches
nsISelectionController
void charactermove(in boolean forward, in boolean extend); boolean checkvisibility(in nsidomnode node, in short startoffset, in short endoffset); void completemove(in boolean forward, in boolean extend); void completescroll(in boolean forward); boolean getcaretenabled(); short getdisplayselection(); nsiselection getselection(in short type); void intralinemove(in boolean forward, in boolean extend); void line...
...olean forward, in boolean extend); void repaintselection(in short type); void scrollhorizontal(in boolean left); void scrollline(in boolean forward); void scrollpage(in boolean forward); void scrollselectionintoview(in short type, in short region, in short flags); void selectall(); void setcaretenabled(in boolean enabled); void setcaretreadonly(in boolean readonly); void setcaretvisibilityduringselection(in boolean visibility); void setcaretwidth(in short pixels); obsolete since gecko 1.8 void setdisplayselection(in short toggle); void wordextendfordelete(in boolean forward); native code only!
... selection_on 2 selection_disabled 3 selection_attention 4 scroll constants constant value description scroll_synchronous 1<<1 if set scrolls the selection into view before returning.
...And 18 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
crédit de transcription 00:04.000 --> 00:05.000 transcrit par célestes™ ::cue(#\31) { color: lime; } ::cue(#crédit\ de\ transcription) { color: red; } positioning of text tracks is also supported, by including positioning information after the timings in a cue, as seen below (see cue settings for more information): webvtt 00:00:00.000 --> 00:00:04.000 position:10%,line-left align:left size:35% where did he go?
... optional cue settings with at least one space before the first and between each setting.
...00:30.739 --> 00:00:34.074 00:00:34.159 --> 00:00:35.743 00:00:35.827 --> 00:00:40.122 example 11 - overlapping cue timing examples 00:00:00.000 --> 00:00:10.000 00:00:05.000 --> 00:01:00.000 00:00:30.000 --> 00:00:50.000 example 12 - non-overlapping cue timing examples 00:00:00.000 --> 00:00:10.000 00:00:10.000 --> 00:01:00.581 00:01:00.581 --> 00:02:00.100 00:02:01.000 --> 00:02:01.000 cue settings cue settings are optional components used to position where the cue payload text will be displayed over the video.
...And 18 more matches
Border-radius generator - CSS: Cascading Style Sheets
============================================================ */ .section { clear: both; padding: 0px; margin: 0px; } /* grouping * ========================================================================== */ .group:before, .group:after { content: ""; display: table; } .group:after { clear:both; } .group { zoom: 1; /* for ie 6/7 (trigger haslayout) */ } /* grid column setup * ========================================================================== */ .col { display: block; float:left; margin: 1% 0 1% 1.6%; } .col:first-child { margin-left: 0; } /* all browsers except ie6 and lower */ /* * ui component */ .ui-input-slider-container { height: 20px; margin: 10px 0; font-family: "segoe ui", arial, helvetica, sans-serif; -moz-user-select: none; user-...
...-slider-right { width: 16px; cursor: pointer; background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center left no-repeat; } .ui-input-slider-right { background: url("https://mdn.mozillademos.org/files/5679/arrows.png") center right no-repeat; } .ui-input-slider-name { width: 90px; padding: 0 10px 0 0; text-align: right; text-transform: lowercase; } .ui-input-slider-btn-set { width: 25px; background-color: #2c9fc9; border-radius: 5px; color: #fff; font-weight: bold; line-height: 14px; text-align: center; } .ui-input-slider-btn-set:hover { background-color: #379b4a; cursor: pointer; } /* * ui component */ /* checkbox */ .ui-checkbox { text-align: center; font-size: 16px; font-family: "segoe ui", arial, helvetica, sans-serif; line-height: 1.5em; co...
... -moz-user-select: text; -webkit-user-select: text; -ms-user-select: text; user-select: text; float: right; } javascript content 'use strict'; /** * ui-inputslidermanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { var value = parseint(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); subscribe(obj.topic, function(value) { input.value = value + obj.unit; }); return inp...
...And 18 more matches
this - JavaScript
it can't be set by assignment during execution, and it may be different each time the function is called.
... es5 introduced the bind() method to set the value of a function's this regardless of how it's called, and es2015 introduced arrow functions which don't provide their own this binding (it retains the this value of the enclosing lexical context).
... since the following code is not in strict mode, and because the value of this is not set by the call, this will default to the global object, which is window in a browser.
...And 18 more matches
Enhanced Extension Installation - Archive of obsolete content
if it is, a small set of metadata about it is written to the appropriate datasource (name, version, a flag to tell the system to properly install it on the next startup), and it is added to the appropriate type container.
...a copy of the xpi file the item was installed from is set aside since the xpinstall system cleans up the temporary file it hands to the extension system.
...[hklm|hkcu]\software\mozilla\firefox\extensions given these goals, and the likelihood of future goals, such as potential for extensions to the xulrunner framework, common drop zones for xpis etc it makes sense to have the set of install locations be customizable.
...And 17 more matches
JXON - Archive of obsolete content
there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example).
...don't use yourrequest.responsetext!
... in order to avoid conflicts, the representation of nodes and attributes names is case insensitive (always rendered in lower case), so objects' local property names set using javascript must always have some kind of capitalization (that is, at least one capital letter somewhere in their names), as you can see below.
...And 17 more matches
panel - Archive of obsolete content
ArchiveMozillaXULpanel
<panel id="thepanel"> <hbox align="start"> <image src="warning.png"/> <vbox> <description value="you have 6 new messages."/> <hbox> <button label="read mail"/> <button label="new message"/> </hbox> </vbox> </hbox> </panel> <description value="6 new messages" popup="thepanel"/> attributes backdrag type: boolean setting the backdrag attribute on a xul panel lets the user move the panel by clicking and dragging anywhere on its background area.
... close type: boolean if the panel has a titlebar, set the panel's close attribute to true to have a close button appear on the titlebar.
...if it is not set, it defaults to the platform behavior.
...And 17 more matches
Introducing a complete toolchain - Learn web development
we'll go all the way from setting up a sensible development environment and putting transformation tools in place to actually deploying your app on netlify.
... in this article we'll introduce the case study, set up our development environment, and set up our code transformation tools.
... tools used in our toolchain in this article we're going to use the following tools and features: jsx, a react-related set of syntax extensions that allow you to do things like defining component structures inside javascript.
...And 17 more matches
NSS tools : modutil
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
... o with the -changepw command, the password on the nss internal module cannot be set or changed, since this password is stored in the key database.
... usage and examples creating database files before any operations can be performed, there must be a set of security databases available.
...And 17 more matches
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
... o with the -changepw command, the password on the nss internal module cannot be set or changed, since this password is stored in the key database.
... usage and examples creating database files before any operations can be performed, there must be a set of security databases available.
...And 17 more matches
Introduction to the JavaScript shell
after following the build documentation and installing the built shell using make install, you can run the shell in interactive mode using the command: js [ if you get " symbol lookup error: ./js: undefined symbol: pr_setcurrentthreadname" e.g.
... environment options there are some environment variables that can be set to alter js shell behavior.
... if value is specified, it must be convertable to a positive uint32; gcparam() sets gc parameter name to value.
...And 17 more matches
nsITextInputProcessor
next, you can set the composition string or dispatch keyboard events.
... the following example sets "foo-bar-buzz", "bar" is selected clause to convert, and caret position is the end of the selected clause: // first, sets composition string.
... tip.setpendingcompositionstring("foo-bar-buzz"); // next, append clauses.
...And 17 more matches
Index - Firefox Developer Tools
found 158 pages: # page tags and summary 1 firefox developer tools developing mozilla, guide, tools, web development, web development:tools, l10n:priority firefox developer tools is a set of web developer tools built into firefox.
...the referent’s properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent’s getters and setters.
... 25 tutorial: set a breakpoint this page shows how you can try out the debugger api yourself using firefox’s scratchpad.
...And 17 more matches
BluetoothCharacteristicProperties - Web APIs
full support 56notes disabled notes linux and versions of windows earlier than 10.disabled from version 56: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support 56notes disabled notes linux and versions of windows earlier than 10.disabled from version 56: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
...And 17 more matches
Window - Web APIs
WebAPIWindow
window.location gets/sets the location, or current url, of the window object.
... window.name gets/sets the name of the window.
... window.pagexoffset read only an alias for window.scrollx.
...And 17 more matches
@font-feature-values - CSS: Cascading Style Sheets
@styleset specifies a feature name that will work with the styleset() functional notation of font-variant-alternates.
... a stylset feature value definition allows an unlimited number of values: ident1: 2 4 12 1 maps to the opentype values ss02, ss04, ss12, and ss01.
... formal syntax @font-feature-values <family-name># { <feature-value-block-list> }where <family-name> = <string> | <custom-ident>+<feature-value-block-list> = <feature-value-block>+where <feature-value-block> = <feature-type> '{' <feature-value-declaration-list> '}'where <feature-type> = @stylistic | @historical-forms | @styleset | @character-variant | @swash | @ornaments | @annotation<feature-value-declaration-list> = <feature-value-declaration>where <feature-value-declaration> = <custom-ident>: <integer>+; examples using @styleset in a @font-feature-values rule /* at-rule for "nice-style" in font one */ @font-feature-values font one { @styleset { nice-style: 12; } } /* at-rule for "nice-style" in font two */...
...And 17 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
everything we do with flexbox refers back to these axes, so it is worth understanding how they work from the outset.
... the cross axis the cross axis runs perpendicular to the main axis, therefore if your flex-direction (main axis) is set to row or row-reverse the cross axis runs down the columns.
...to create a flex container, we set the value of the area's container's display property to flex or inline-flex.
...And 17 more matches
OpenType font features guide - CSS: Cascading Style Sheets
these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings.
... 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.
...they are all defined and shown here, but many will only work using the lower-level font-feature-settings property.
...And 17 more matches
box-shadow - CSS: Cascading Style Sheets
you can set multiple effects separated by commas.
... a box shadow is described by x and y offsets relative to the element, blur and spread radius, and color.
... syntax /* keyword values */ box-shadow: none; /* offset-x | offset-y | color */ box-shadow: 60px -16px teal; /* offset-x | offset-y | blur-radius | color */ box-shadow: 10px 5px 5px black; /* offset-x | offset-y | blur-radius | spread-radius | color */ box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2); /* inset | offset-x | offset-y | color */ box-shadow: inset 5em 1em gold; /* any number of shadows, separated by commas */ box-shadow: 3px 3px red, -1...
...And 17 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
36 html attribute reference attribute, attributes, beginner, configuring, element attributes, elements, html, reference, settings, web elements in html have attributes; these are additional values that configure the elements or adjust their behavior in various ways to meet the criteria the users want.
...depending on the element, the attribute can be a cors settings attribute.
... 44 html attribute: multiple attribute, attributes, constraint validation the boolean multiple attribute, if set, means the form control accepts one or more values.
...And 17 more matches
Promise - JavaScript
note: a promise is said to be settled if it is either fulfilled or rejected, but not pending.
... you will also hear the term resolved used with promises — this means that the promise is settled or “locked in” to match the state of another promise.
... chained promises the methods promise.then(), promise.catch(), and promise.finally() are used to associate further action with a promise that becomes settled.
...And 17 more matches
Repackaging Firefox - Archive of obsolete content
using an extension makes it far easier to keep track of your changes easily when the time comes to upgrade to new versions of firefox, and also ensures, when set-up correctly, that users are able to safely receive firefox updates from mozilla.
... if you already have an extension that you want to bundle with firefox, and don't want to bundle an extra extension solely to set a few defaults, you can do everything you need to do in your existing extension.
... however, it's still recommended that you look through this tutorial, as it contains tips specific for creating extensions of this type, and there are a few options that you will need to set to ensure a smooth upgrade path for users.
...And 16 more matches
MenuItems - Archive of obsolete content
<keyset> <key id="open-key" modifiers="accel" key="o"/> <key id="close-key" modifiers="accel" key="c"/> </keyset> <menubar> <menu label="view"> <menupopup> <menuitem label="open" key="open-key"/> <menuitem label="close" key="close-key"/> </menupopup> </menu> </menubar> the two menuitems are associated with a key using the key attribute.
... it should be set to the id of a key element within the same document.
... 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.
...And 16 more matches
Fundamental CSS comprehension - Learn web development
grab the css resources text file — this contains a set of raw selectors and rulesets that you'll need to study and combine to answer part of this assessment.
... basic setup: first of all, create a new file in the same directory as your html and image files.
... the first two rulesets in the css resource file are yours, for free!
...And 16 more matches
CSS values and units - Learn web development
previous overview: building blocks next every property used in css has a value or set of values that are allowed for that property, and taking a look at any property page on mdn will help you understand the values that are valid for any particular property.
... in the following example we have set the color of our heading using a keyword, and the background using the rgb() function: h1 { color: black; background-color: rgb(197,93,161); } a value in css is a way to define a collection of allowable sub-values.
...the first box has a width set in pixels.
...And 16 more matches
Legacy layout methods - Learn web development
you imagine your layout as a set number of columns (e.g.
...first, of all, apply the following to your html to provide some basic setup: body { width: 90%; max-width: 900px; margin: 0 auto; } the body will be 90% of the viewport wide until it gets to 900px wide, in which case it will stay fixed at this width and center itself in the viewport.
...if we want the two <div>s to be floated alongside one another, we need to set their widths to total 100% of the width of their parent element or smaller so they can fit alongside one another.
...And 16 more matches
Styling links - Learn web development
styling some links now we've looked at the default states in some detail, let's look at a typical set of link styles.
... to start off with, we'll write out our empty rulesets: a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { } this order is important because the link styles build on one another, for example the styles in the first rule will apply to all the subsequent ones, and when a link is being activated, it is also being hovered over.
... next, we use the a:link and a:visited selectors to set a couple of color variations on unvisited and visited links, so they are distinct.
...And 16 more matches
Graceful asynchronous programming with Promises - Learn web development
this is useful for setting up a sequence of async operations to work correctly.
... the code that the video chat application would use might look something like this: function handlecallbutton(evt) { setstatusmessage("calling..."); navigator.mediadevices.getusermedia({video: true, audio: true}) .then(chatstream => { selfviewelem.srcobject = chatstream; chatstream.gettracks().foreach(track => mypeerconnection.addtrack(track, chatstream)); setstatusmessage("connected"); }).catch(err => { setstatusmessage("failed to connect"); }); } this function starts by usi...
...ng a function called setstatusmessage() to update a status display with the message "calling...", indicating that a call is being attempted.
...And 16 more matches
Making decisions in your code — conditionals - Learn web development
a set of curly braces, inside which we have some code — this can be any code we like, and it only runs if the condition returns true.
... another set of curly braces, inside which we have some more code — this can be any code we like, and it only runs if the condition is not true — or in other words, the condition is false.
...it'd be up to us to provide a mechanism for the parent to set the shoppingdone variable to true if the child did the shopping.
...And 16 more matches
React interactivity: Events and state - Learn web development
it should end up looking something like this: function handlesubmit(e) { e.preventdefault(); alert('hello, world!'); } to use this function, add an onsubmit attribute to the <form> element, and set its value to the handlesubmit function: <form onsubmit={handlesubmit}> now if you head back to your browser and click on the "add" button, your browser will show you an alert dialog with the words "hello, world!" — or whatever you chose to write there.
... write the following above your handlesubmit() function, inside form(): const [name, setname] = usestate('use hooks!'); what's going on in this line of code?
... we are setting the initial name value as "use hooks!".
...And 16 more matches
NSS functions
function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mxr 3.2 and later nssssl_versioncheck mxr 3.2.1 and later ssl_authcertificate mxr 3.2 and later ssl_authcertificatehook mxr 3.2 and later ssl_badcerthook mxr 3.2 and later ssl_certdbhandleset mxr 3.
...2 and later ssl_canbypass mxr 3.11.7 and later ssl_cipherpolicyget mxr 3.2 and later ssl_cipherpolicyset mxr 3.2 and later ssl_cipherprefget mxr 3.2 and later ssl_cipherprefgetdefault mxr 3.2 and later ssl_cipherprefset mxr 3.2 and later ssl_cipherprefsetdefault mxr 3.2 and later ssl_clearsessioncache mxr 3.2 and later ssl_configmpserversidcache mxr 3.2 and later ssl_configsecureserver mxr 3.2 and later ssl_configserversessionidcache mxr 3.2 and later ssl_datapending mxr 3.2 and later ssl_forcehandshake mxr 3.2 and later ssl_forcehandshakewithtimeout mxr 3.11.4 and later ssl_ge...
...nd later ssl_handshakecallback mxr 3.2 and later ssl_importfd mxr 3.2 and later ssl_inheritmpserversidcache mxr 3.2 and later ssl_invalidatesession mxr 3.2 and later ssl_localcertificate mxr 3.4 and later ssl_optionget mxr 3.2 and later ssl_optiongetdefault mxr 3.2 and later ssl_optionset mxr 3.2 and later ssl_optionsetdefault mxr 3.2 and later ssl_peercertificate mxr 3.2 and later ssl_preencryptedfiletostream mxr 3.2 and later ssl_preencryptedstreamtofile mxr 3.2 and later ssl_rehandshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake m...
...And 16 more matches
JSAPI Cookbook
lean"; var isobject = typeof v === "object" && v !== null; /* jsapi */ js::rootedvalue v(cx, computesomevalue()); bool isstring = v.isstring(); bool isnumber = v.isnumber(); bool isint32 = v.isint32(); // note: internal representation, not numeric value bool isnull = v.isnull(); bool isboolean = v.isboolean(); bool isobject = v.isobject(); // note: not broken like typeof === "object" is :-) to set a value use a correspondingly named member mutator function, or assign the result of the correspondingly named standalone function: // javascript var v; v = 0; v = 0.5; v = somestring; v = null; v = undefined; v = false; /* jsapi */ js::rootedvalue v(cx); js::rootedstring somestring(cx, ...); v.setint32(0); // or: v = js::int32value(0); v.setdouble(0.5); // or: v = js::double...
...value(0.5); v.setstring(somestring); // or: v = js::stringvalue(somestring); v.setnull(); // or: v = js::nullvalue(); v.setundefined(); // or: v = js::undefinedvalue(); v.setboolean(false); // or: v = js::booleanvalue(false); finding the global object many of these recipes require finding the current global object first.
...} defining a function // javascript function justforfun() { return null; } /* jsapi */ bool justforfun(jscontext *cx, unsigned argc, js::value *vp) { js::callargs args = js::callargsfromvp(argc, vp); args.rval().setnull(); return true; } ...
...And 16 more matches
IAccessibleEditableText
the substrings used with this interface are specified as follows: if startoffset is less than endoffset, the substring starts with the character at startoffset and ends with the character just before endoffset.
... if endoffset is lower than startoffset, the result is the same as a call with the two arguments exchanged.
...refer to the @ref _specialoffsets "special offsets for use in the iaccessibletext and iaccessibleeditabletext methods" for information about a special offset constant that can be used in iaccessibleeditabletext methods.
...And 16 more matches
Storage
reset the statement.
... binding one set of parameters if you only have one row to insert, or are using the synchronous api you'll need to use this method.
... binding multiple sets of parameters starting in gecko 1.9.2 (firefox 3.6), there's a new, more convenient way to bind multiple sets of parameters at once prior to executing your statement asynchronously.
...And 16 more matches
BluetoothRemoteGATTDescriptor - Web APIs
bluetoothremotegattdescriptor.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise.
... full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
...And 16 more matches
HTMLMediaElement - Web APIs
htmlmediaelement.controlslist read only returns a domtokenlist that helps the user agent select what controls to show on the media element whenever the user agent shows its own set of controls.
... htmlmediaelement.crossorigin a domstring indicating the cors setting for this media element.
...setting this value seeks the media to the new time.
...And 16 more matches
Geometry and reference spaces in WebXR - Web APIs
however, in order to provide the ability to present scenes in true 3d using xr headsets and other such equipment, webxr has additional concepts that must be understood.
...like an architect or a set designer, you have the power to create moods and experiences through a physical environment.
... the directionality of the coordinate system can be seen in the following diagram: an xrrigidtransform called the origin offset is used to transform points from the space's own effective coordinate system to the xr device's native coordinate system.
...And 16 more matches
Web audio spatialization basics - Web APIs
this is done by setting the different properties of the pannernode object instance in relation to that movement, to emulate spacialization.
... let's create our context and listener and set the listener's position to emulate a person looking into our room: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); const listener = audioctx.listener; const posx = window.innerwidth/2; const posy = window.innerheight/2; const posz = 300; listener.positionx.value = posx; listener.positiony.value = posy; listener.positionz.value = posz-...
...here we are setting the listener to be in the middle of the viewport and slightly in front of our boombox.
...And 16 more matches
background-position - CSS: Cascading Style Sheets
the background-position css property sets the initial position for each background image.
... the position is relative to the position layer set by background-origin.
...ax /* keyword values */ background-position: top; background-position: bottom; background-position: left; background-position: right; background-position: center; /* <percentage> values */ background-position: 25% 75%; /* <length> values */ background-position: 0 0; background-position: 1cm 2cm; background-position: 10ch 8em; /* multiple images */ background-position: 0 0, center; /* edge offsets values */ background-position: bottom 10px right 20px; background-position: right 3em bottom 10px; background-position: bottom 10px right; background-position: top right 10px; /* global values */ background-position: inherit; background-position: initial; background-position: unset; the background-position property is specified as one or more <position> values, separated by commas.
...And 16 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
use both width and height to set the intrinsic size of the image, allowing it to take up space before it loads, to mitigate content layout shifts.
... responsive image hints with sizes and srcset (see also the <picture> element and our responsive images tutorial).
... image loading errors if an error occurs while loading or rendering an image, and an onerror event handler has been set on the error event, that event handler will get called.
...And 16 more matches
Object.defineProperty() - JavaScript
an accessor descriptor is a property described by a getter-setter pair of functions.
...when the property is accessed, this function is called without arguments and with this set to the object through which the property is accessed (this may not be the object on which the property is defined due to inheritance).
... set a function which serves as a setter for the property, or undefined if there is no setter.
...And 16 more matches
Introduction to using XPath in JavaScript - XPath
document.evaluate this method evaluates xpath expressions against an xml based document (including html documents), and returns a xpathresult object, which can be a single node or a set of nodes.
... specifying the return type the returned variable xpathresult from document.evaluate can either be composed of individual nodes (simple types), or a collection of nodes (node-set types).
... node-set types the xpathresult object allows node-sets to be returned in 3 principal different types: iterators snapshots first nodes iterators when the specified result type in the resulttype parameter is either: unordered_node_iterator_type ordered_node_iterator_type the xpathresult object returned is a node-set of matched nodes which will behave as an iterator, allowing us to access the ...
...And 16 more matches
Focus and Selection - Archive of obsolete content
this attribute should be set to a number.
...that means that you can order the elements by setting indices on elements in sequence.
... usually, however, you would not set the tabindex attribute.
...And 15 more matches
browser - Archive of obsolete content
attributes autocompleteenabled, autocompletepopup, autoscroll, disablehistory, disableglobalhistory, disablesecurity, droppedlinkhandler, homepage, showcaret, src, type properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, gotoindex, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption...
... label="mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox> attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
... autoscroll type: boolean set to false to disable autoscroll for this browser.
...And 15 more matches
datepicker - Archive of obsolete content
there are several ways to set the selected day.
... in xul, the value attribute may be set to a value of the form yyyy-mm-dd to initialize the datepicker to a certain date.
... to change the selected date, the value property may be used to set a new value in the form yyyy-mm-dd.
...And 15 more matches
menu - Archive of obsolete content
ArchiveMozillaXULmenu
if this value is set, it overrides an assigned key set in the key attribute.
... accesskey type: character this should be set to a character that is used as a shortcut key.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...And 15 more matches
radio - Archive of obsolete content
ArchiveMozillaXULradio
ties accesskey, accessibletype, control, crop, disabled, image, label, radiogroup, selected, tabindex, value examples <radiogroup> <radio id="orange" label="red" accesskey="r"/> <radio id="violet" label="green" accesskey="g" selected="true"/> <radio id="yellow" label="blue" accesskey="b" disabled="true"/> </radiogroup> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... command type: id set to the id of a command element that is being observed by the element.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...And 15 more matches
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selectedindex, tabbox, tabindex, tooltiptextnew, value, properties accessibletype, disabled, itemcount, selectedindex, selecteditem, tabindex, value, methods advanceselectedtab, appenditem, getindexofitem, getitematindex, insertitemat, removeitemat examples (example needed) attributes closebutton obsolete since gecko 1.9.2 type: bo...
...olean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends.
...you can set an image to the "new tab" and "close" buttons by applying them to the tabs-newbutton and tabs-closebutton classes respectively.
...And 15 more matches
The box model - Learn web development
if we set display: flex; on an element, the outer display type is block, but the inner display type is changed to flex.
... any direct children of this box will become flex items and will be laid out according to the rules set out in the flexbox spec, which you'll learn about later on.
...these elements would normally be inline, however, one of the elements has a class of block, and we have set it to display: block.
...And 15 more matches
Client-side form validation - Learn web development
this is called client-side form validation, and helps ensure data submitted matches the requirements set forth in the various form controls.
...when you enter data, the browser and/or the web server will check to see that the data is in the correct format and within the constraints set by the application.
... minlength and maxlength: specifies the minimum and maximum length of textual data (strings) min and max: specifies the minimum and maximum values of numerical input types type: specifies whether the data needs to be a number, an email address, or some other specific preset type.
...And 15 more matches
Introduction to events - Learn web development
in the case of the web, events are fired inside the browser window, and tend to be attached to a specific item that resides in it — this might be a single element, set of elements, the html document loaded in the current tab, or the entire browser window.
...we are listening for the click event firing, by setting the onclick event handler property to equal an anonymous function containing code that generates a random rgb color and sets the <body> background-color equal to it.
...btn.textcontent, or btn.style), but it is a special type — when you set it to be equal to some code, that code is run when the event fires on the button.
...And 15 more matches
Debugging on Mac OS X
macos 10.15 went further, requiring applications to be notarized with hardened runtime enabled in order to launch (ignoring workarounds.) when run on earlier macos versions, notarization and hardened runtime settings have no effect.
...to work around that, the steps below have you initialize the project outside the mozilla source tree, close the project, copy the .xcodeproj project "file" into the source tree, and then reopen the project to finish setting it up.
...after you click ok, xcode should open the settings window for the new scheme.
...And 15 more matches
JS::CompileOptions
callers should set this flag for cross-origin scripts, and it will be propagated appropriately to child scripts and passed back in jserrorreports.
... bool setfile(jscontext *cx, const char *f) duplicate null-terminated string f for filename().
... bool setfileandline(jscontext *cx, const char *f, unsigned l) duplicate null-terminated string f for filename() and set lineno property.
...And 15 more matches
NS_ConvertASCIItoUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat 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 assi...
...gn assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsautostring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
NS_ConvertUTF8toUTF16
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat 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 assi...
...gn assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsautostring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsAdoptingString
method overview constructors operator= operator const prunichar* operator[] get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsxpidlstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsAutoString
names: nsautostring for wide characters nscautostring for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsfixedstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsDependentString
method overview constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsFixedString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat 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 assi...
...gn assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsPromiseFlatString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat 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 assi...
...gn assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsString
method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsastring_internal data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsXPIDLString
names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const prunichar* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 15 more matches
nsICacheEntryDescriptor
inherits from: nsicacheentryinfo last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void close(); void doom(); void doomandfailpendingrequests(in nsresult status); string getmetadataelement(in string key); void markvalid(); nsiinputstream openinputstream(in unsigned long offset); nsioutputstream openoutputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get the access granted to this descriptor.
... cacheelement nsisupports get or set the cache data element.
... securityinfo nsisupports get or set security info on the cache entry for this descriptor.
...And 15 more matches
Debugger - Firefox Developer Tools
it is an accessor property with a getter and setter: assigning to it enables or disables this debugger instance; reading it produces true if the instance is enabled, or false otherwise.
...setting this to false inhibits the ahead-of-time asm.js compiler and forces asm.js code to run as normal javascript.
... this is an accessor property with a getter and setter.
...And 15 more matches
Element - Web APIs
WebAPIElement
when used as a setter, replaces the element with nodes parsed from the given string.
...set using the part attribute), returned as a domtokenlist.
... element.scrollleft is a number representing the left scroll offset of the element.
...And 15 more matches
Using the Web Animations API - Web APIs
and unlike pure, declarative css, javascript also lets us dynamically set values from properties to durations.
... the css version here’s a tumbling animation written in css showing alice falling down the rabbit hole that leads to wonderland (see the full code on codepen): notice that the background moves, alice spins, and her color changes at an offset from her spinning.
... representing keyframes the first thing we need is to create a keyframe object corresponding to our css @keyframes block: var alicetumbling = [ { transform: 'rotate(0) translate3d(-50%, -50%, 0)', color: '#000' }, { color: '#431236', offset: 0.3}, { transform: 'rotate(360deg) translate3d(-50%, -50%, 0)', color: '#000' } ]; here we’re using an array containing multiple objects.
...And 15 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
this is only useful in elements that are editable, such as <input> and <textarea> or elements whose html contenteditable attribute is set.
... borders see the section borders for a list of the css properties you can use to set the colors of a box's borders.
...this outline is different from the border in that it doesn't get space set aside for it in the document (so it may overlap other content).
...And 15 more matches
HTML attribute reference - HTML: Hypertext Markup Language
accept-charset <form> list of supported charsets.
... autocapitalize global attribute sets whether input is automatically capitalized when entered by user autocomplete <form>, <input>, <select>, <textarea> indicates whether controls in this form can by default have their values automatically completed by the browser.
... charset <meta>, <script> declares the character encoding of the page or script.
...And 15 more matches
<input type="datetime-local"> - HTML: Hypertext Markup Language
the edge datetime-local control looks like the below; clicking the date and the time parts of the value bring up two separate pickers for you, so you can easily set both the date and the time.
... you can set a default value for the input by including a date and time inside the value attribute, like so: <label for="party">enter a date and time for your party booking:</label> <input id="party" type="datetime-local" name="partydate" value="2017-06-01t08:30"> one thing to note is that the displayed date and time formats differ from the actual value; the displayed date and time are formatted according...
... you can also get and set the date value in javascript using the htmlinputelement.value property, for example: var datecontrol = document.queryselector('input[type="datetime-local"]'); datecontrol.value = '2017-06-01t08:30'; there are several methods provided by javascript's date that can be used to convert numeric date information into a properly-formatted string, or you can do it manually.
...And 15 more matches
widget - Archive of obsolete content
you can set the width of a widget, but the height is fixed so as to fit in the add-on bar.
...widgets.widget({ id: "auto-update-widget", label: "widget that updates content on a timer", content: "0", contentscript: 'settimeout(function() {' + ' document.body.innerhtml++;' + '}, 2000)', contentscriptwhen: "ready" }); // a widget created with a specified width, that grows.
... var mywidget = widgets.widget({ id: "widget-effect", label: "wide widget that grows wider on a timer", content: "i'm getting longer.", width: 50, }); require("sdk/timers").setinterval(function() { mywidget.width += 10; }, 1000); // a widget communicating bi-directionally with a content script.
...And 14 more matches
Using Breakpoints in Venkman - Archive of obsolete content
one of the basic tasks of debugging any language is setting breakpoints.
...when you set a breakpoint in a debugging application such as venkman, you can take advantage of the suspension to examine variables, objects, and other featues of the execution.
... this article describes breakpoints in javascript and how to use venkman to set and examine breakpoints.
...And 14 more matches
Binding Implementations - Archive of obsolete content
a binding implementation provides a new set of methods and properties that can be invoked directly from the bound element.
...the first type of property is a raw value that is set directly on the element itself.
... the second type of property is one that defines functions that are invoked when the property is either retrieved or set.
...And 14 more matches
Menus - Archive of obsolete content
button a menu may be attached to a button by setting the type attribute of the button to 'menu'.
...this type of menu would be used when you want to have a set of commands yet don't want to use a menu bar, for example in a dialog box.
...when another item is selected, the label of the item is set as the label of the menulist.
...And 14 more matches
checkbox - Archive of obsolete content
attributes accesskey, checked, command, crop, disabled, src, label, preference, tabindex properties accesskey, accessibletype, checked, command, crop, disabled, src, label, tabindex examples <checkbox label="enable javascript" checked="true"/> <checkbox label="enable java" checked="false"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... use hasattribute() to determine whether this attribute is set instead of getattribute().
... for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect.
...And 14 more matches
scale - Archive of obsolete content
ArchiveMozillaXULscale
set the orient attribute to vertical to use a vertical scale.
...the home and end keys set the scale's value to the minimum and maximum values, respectively.
...if this attribute is set, the element is disabled.
...And 14 more matches
toolbar - Archive of obsolete content
you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar.
... attributes autohide, currentset, customindex, customizable, defaultset, grippyhidden, grippytooltiptext, height, iconsize, mode, toolbarname properties accessibletype, currentset, firstpermanentchild, lastpermanentchild, toolbarname, toolboxid methods insertitem style classes chromeclass-toolbar 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.
...And 14 more matches
XForms Repeat Element - Archive of obsolete content
introduction a repeat element contains markup and is itself bound to a nodeset in an instance document (see the spec).
... for each node in the nodeset, the contents of the repeat element will be displayed in the form.
... that node will serve as the context node for any relative xpath expressions in that set of repeated markup.
...And 14 more matches
Building up a basic demo with A-Frame - Game development
environment setup let's start by setting up an environment to create something with a-frame.
... (optional) set up a vr device such as oculus rift or google cardboard.
... html structure the first step is to create an html document — inside your project directory, create a new index.html file, and save the follow html inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: a-frame demo</title> <script src="aframe.min.js"></script> </head> <body> <!-- html goes here --> </body> </html> this contains some basic information like the document charset and <title>.
...And 14 more matches
Cascade and inheritance - Learn web development
also significant here is the concept of inheritance, which means that some css properties by default inherit values set on the current element's parent element, and some don't.
...this can seem like a set of tricky concepts to understand.
... inheritance inheritance also needs to be understood in this context — some css property values set on parent elements are inherited by their child elements, and some aren't.
...And 14 more matches
Flexbox - Learn web development
to do this, we set a special value of display on the parent element of the elements you want to affect.
... in this case we want to lay out the <article> elements, so we set this on the <section>: section { display: flex; } this causes the <section> element to become a flex container, and its children to become flex items.
...this is because the default values given to flex items (the children of the flex container) are set up to solve common problems such as this.
...And 14 more matches
How to structure a web form - Learn web development
the <fieldset> and <legend> elements the <fieldset> element is a convenient way to create groups of widgets that share the same purpose, for styling and semantic purposes.
... you can label a <fieldset> by including a <legend> element just below the opening <fieldset> tag.
... the text content of the <legend> formally describes the purpose of the <fieldset> it is included inside.
...And 14 more matches
Getting started with HTML - Learn web development
if you make a mistake, you can clear your work using the reset button.
...</textarea> <div class="controls"> <input id="reset" type="button" value="reset" /> <input id="solution" type="button" value="show solution" /> </div> html { font-family: 'open sans light',helvetica,arial,sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = do...
...cument.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<em>this is my text.</em>'; var solutionentry = htmlsolution; text...
...And 14 more matches
Inheritance in JavaScript - Learn web development
= 10; this.height = 20; } you could inherit the width and height properties by doing this (as well as the other steps described below, of course): function blueglassbrick() { brick.call(this); this.opacity = 0.5; this.color = 'blue'; } note that we've only specified this inside call() — no other parameters are required as we are not inheriting any properties from the parent that are set via parameters.
... setting teacher()'s prototype and constructor reference all is good so far, but we have a problem.
...after adding the last line, teacher.prototype's constructor property is now equal to person(), because we just set teacher.prototype to reference an object that inherits its properties from person.prototype!
...And 14 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
add the edittask() function inside your app component, in the same place as the other functions: function edittask(id, newname) { const editedtasklist = tasks.map(task => { // if this task has the same id as the edited task if (id === task.id) { // return {...task, name: newname} } return task; }); settasks(editedtasklist); } pass edittask into our <todo /> components as a prop in the same way we did with deletetask: const tasklist = tasks.map(task => ( <todo id={task.id} name={task.name} completed={task.completed} key={task.id} toggletaskcompleted={toggletaskcompleted} deletetask={deletetask} edittask={edittask} /> )); now open todo.js.
...first, import usestate into the todo component like we did before with the app component, by updating the first import statement to this: import react, { usestate } from "react"; we'll now use this to set an isediting state, the default state of which should be false.
... add the following line just inside the top of your todo(props) { … } component definition: const [isediting, setediting] = usestate(false); next, we're going to rethink the <todo /> component — from now on, we want it to display one of two possible “templates", rather than the single template it's used so far: the "view" template, when we are just viewing a todo; this is what we’ve used in rest of the tutorial so far.
...And 14 more matches
Embedding API for Accessibility
text zoom on a per-window basis the nsidomwindow::gettextzoom(float *zoomfactor) and nsidomwindow::settextzoom(float zoomfactor) methods can be used to set a wide range of text zoom factors on a content window.
...for double-sized text, use nsidomwindow::settextzoom(2.0); using accessibility preferences there are a number of prefs related to accessibility.
...be aware that in debug builds, this can cause a great number of assertions (bug 71598) to use prefs in embedding, use something like the following code: #include "nsipref.h"; nsresult rv; nscomptr<nsipref> prefs(do_getservice(ns_pref_contractid, &rv)); prefs->setboolpref("bool.pref.name", pr_true /* or pr_false */); prefs->setintpref("int.pref.name", newvalue); prefs->setcharpref("string.pref.name", newcharstarvalue); to manually add a pref to your settings, add a line like the following to your prefs.js: user_pref("accessibility.browsewithcaret", true); accessibility prefs reference the following is a description of what accessibility prefs giv...
...And 14 more matches
Multiple Firefox profiles
a profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox.
...having different profiles would help separate work and personal life, or allow each family member to have his or her own set of bookmarks, settings, and add-ons.
...it takes little time to set up a new profile, and once it is complete, all of your firefox versions will update separately and can be run simultaneously.
...And 14 more matches
Exact Stack Rooting
storing a gcpointer in a gcthing storing your gcpointer inside of a gcthing that is already in the liveset is the easiest way to keep a gcthing to the liveset.
... gcpointers that reside in gcthings fall into one of these cases: storage in a normal property, storage in a reserved slot, or storage with js_{get|set}private.
... do not use js_setprivate.
...And 14 more matches
JIT Optimization Strategies
optimization information is currently collected for the following operations: getproperty (obj.prop) setproperty (obj.prop = val) getelement (obj[elemname]) setelement (obj[elemname] = val) call (func(...)) at each operation site, ionmonkey tries a battery of strategies, from the most optimized but most restrictive to the least optimized but least restrictive.
... setproperty setprop_commonsetter optimizes access to properties which are implemented by a setter function, where the setter is shared between multiple types.
... this optimization applies most often when the property access site is polymorphic, but all the object types are derived variants of a single base class, where the property access refers to a setter on the base class.
...And 14 more matches
JSPropertyOp
jspropertyop and jsstrictpropertyop are the type of property getter and setter callbacks in the jsapi.
... they are also the types of the jsclass.addproperty, getproperty, and setproperty callbacks, which are called during object property accesses.
...a jspropertyop may be installed on an individual property as a getter or setter; or it may be installed on a jsclass to hook property gets, sets, or adds.
...And 14 more matches
TPS Tests
the python test runner will read a test file (in javascript format), setup one or more firefox profiles with the necessary extensions and preferences, then launch firefox and pass the test file to the extension.
... the extension will read the test file and perform a series of actions specified therein, such as populating a set of bookmarks, syncing to the sync server, making bookmark modifications, etc.
... a test file may contain an arbitrary number of sections, each involving the same or different profiles, so that one test file may be used to test the effect of syncing and modifying a common set of data (from a single sync account) over a series of different events and clients.
...And 14 more matches
NS_ConvertUTF16toUTF8
class declaration a helper class that converts a utf-16 string to utf-8 method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercas...
...eequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscautostring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
NS_LossyConvertUTF16toASCII
class declaration a helper class that converts a utf-16 string to ascii in a lossy manner method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty isvoid isterminated charat operator[] first last countchar findchar equals equalsascii equalsliteral(const char equalsliteral(char lowercaseequals...
...ascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscautostring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsAdoptingCString
method overview constructors operator= operator const char* operator[] get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsxpidlcstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsCAutoString
names: nsautostring for wide characters nscautostring for narrow characters method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat ...
...ualsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsfixedcstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsCString
method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsacstring_internal data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsDependentCString
method overview constructors assertvalid rebind operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsFixedCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat 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(c...
...har assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsPromiseFlatCString
class declaration method overview constructors operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat 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(c...
...har assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsXPIDLCString
names: nsxpidlstring for wide characters nsxpidlcstring for narrow characters method overview constructors operator const char* operator[] operator= get find rfind rfindchar findcharinset rfindcharinset compare equalsignorecase tofloat tointeger mid left right setcharat stripchars stripwhitespace replacechar replacesubstring trim compresswhitespace assignwithconversion appendwithconversion appendint appendfloat beginreading endreading beginwriting endwriting data length isempty ...
...s equalsascii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nscstring data members no public members.
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 14 more matches
nsIChannel
inherits from: nsirequest last changed in gecko 19.0 (firefox 19.0 / thunderbird 19.0 / seamonkey 2.16) once a channel is created (via nsiioservice.newchannel()), parameters for that request may be set by using the channel attributes, or by calling queryinterface() to retrieve a subclass of nsichannel for protocol-specific parameters.
... method overview void asyncopen(in nsistreamlistener alistener, in nsisupports acontext); nsiinputstream open(); attributes attribute type description contentcharset acstring the character set of the channel's content if available and if applicable.
... setting contentcharset before the channel has been opened provides a hint to the channel on what the charset should be.
...And 14 more matches
nsICompositionStringSynthesizer
stringsynthesizer = domwindowutils.createcompositionstringsynthesizer(); for example, when you create a composition whose composing string is "foo-bar-buzz" and "bar" is selected to convert, then, first, you need to start composition: domwindowutils.sendcompositionevent("compositionstart", "", ""); next, dispatch composition string with crause information and caret information (optional): // set new composition string with .setstring().
... compositionstringsynthesizer.setstring("foo-bar-buzz"); // set clause information with .appendclause().
... compositionstringsynthesizer.appendclause("foo-".length, compositionstringsynthesizer.attr_convertedtext); compositionstringsynthesizer.appendclause("bar".length, compositionstringsynthesizer.attr_selectedconvertedtext); compositionstringsynthesizer.appendclause("-buzz".length, compositionstringsynthesizer.attr_convertedtext); // set caret position in the composition string.
...And 14 more matches
nsISelection
as a service: var selection = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsiselection); method overview void addrange(in nsidomrange range); void collapse(in nsidomnode parentnode, in long offset); [noscript,notxpcom,nostdcall] boolean collapsed(); void collapsenative(in nsidomnode parentnode, in long offset); native code only!
... void collapsetoend(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only!
... anchoroffset long the offset within the (text) node where the selection begins.
...And 14 more matches
Intersection Observer API - Web APIs
this set of values serves to grow or shrink each side of the root element's bounding box before computing intersections.
... targeting an element to be observed once you have created the observer, you need to give it a target element to watch: let target = document.queryselector('#listitem'); observer.observe(target); // the callback we setup for the observer will be executed now for the first time // it waits until we assign a target to our observer (even if the target is currently not visible) whenever the target meets a threshold specified for the intersectionobserver, the callback is invoked.
... the root intersection rectangle can be adjusted further by setting the root margin, rootmargin, when creating the intersectionobserver.
...And 14 more matches
A simple RTCDataChannel sample - Web APIs
starting up when the script is run, we set up an load event listener, so that once the page is fully loaded, our startup() function is called.
... function startup() { connectbutton = document.getelementbyid('connectbutton'); disconnectbutton = document.getelementbyid('disconnectbutton'); sendbutton = document.getelementbyid('sendbutton'); messageinputbox = document.getelementbyid('message'); receivebox = document.getelementbyid('receivebox'); // set event listeners for user interface widgets connectbutton.addeventlistener('click', connectpeers, false); disconnectbutton.addeventlistener('click', disconnectpeers, false); sendbutton.addeventlistener('click', sendmessage, false); } this is quite straightforward.
... we grab references to all the page elements we'll need to access, then set event listeners on the three buttons.
...And 14 more matches
Using DTMF with WebRTC - Web APIs
when the tone buffer is empty, indicating that all the tones have been sent, a tonechange event with its tone property set to "" (an empty string) is delivered to the connection object.
...this will be obtained while setting up the connection, in the gotstream() function shown in adding the audio to the connection.
...they'll get set up when the page is first loaded.
...And 14 more matches
Inputs and input sources - Web APIs
by combining these two types of input with the changing of viewing position and/or orientation through the headset or other mechanisms, you can create an interactive simulated environment.
... properties of input sources each individual xrinputsource has a set of properties that describe the input's available axes and buttons, which hand the user's holding it in, and how the input source is used to handle targeting within the 3d space.
...it can also be set to none if the controller isn't hand-held, or if it's unknown which hand the controller is in.
...And 14 more matches
Using CSS transitions - CSS: Cascading Style Sheets
css transitions let you decide which properties to animate (by listing them explicitly), when the animation will start (by setting a delay), how long the transition will last (by setting a duration), and how the transition will run (by defining a timing function, e.g.
...as it doesn't make sense to animate some properties, the list of animatable properties is limited to a finite set.
... note: the set of properties that can be animated is changing as the specification develops.
...And 14 more matches
Style System Overview - Archive of obsolete content
“reset”: 'border', 'background', etc.
... detail: !important declarations cause an extra rule object cssimportantrule to be created since they are in a separate part of the cascade other nsistylerule implementations nshtmlmappedattributes represents stylistic html attributes turned into a style rule (one instance per unique set of attributes) bodyrule handles marginwidth/marginheight mixes on body and on frame.
... the cascade stylesetimpl manages the different origins of rules in the cascade (ua, user, author) style set gets the nsistyleruleprocessor implementations from the style sheets, and the css stylesheets force one cssruleprocessor per origin (rather than one per stylesheet).
...And 13 more matches
JavaScript Client API - Archive of obsolete content
engine governs the synchronizing of a specific set of information.
...it is possible for other components, including 3rd party extensions, to supplement the set of engines and synchronize their own data.
...have a look at one of the following files: services/sync/modules/engines/bookmarks.js services/sync/modules/engines/history.js setting up a js module the code for your custom sync engine should live in a js module.
...And 13 more matches
Template Logging - Archive of obsolete content
this corresponds to the id attribute set on a generated row.
...these types of errors are also logged to the console, however, these types of errors are logged whether the logging flag is set or not.
... querytype attribute doesn't specify a valid query processor this error indicates that the querytype attribute is set to an unrecognized value.
...And 13 more matches
XBL Example - Archive of obsolete content
you could put anything within the pages, however, this widget might be useful for a set of images.
...the selectedindex is inherited by the deck, so we may set the initial page in the xul.
...we could set a value, but instead it will calculated later.
...And 13 more matches
treecol - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...if the cycler attribute is not set, the cell is a regular text cell.
... dragging type: boolean this attribute will be set to true if the column is being dragged.
...And 13 more matches
Building up a basic demo with the PlayCanvas engine - Game development
environment setup to start developing with playcanvas, you don't need much.
... <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: playcanvas demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <script src="playcanvas-latest.js"></script> <canvas id="application-canvas"></canvas> <script> var canvas = document.getelementbyid("application-canvas"); /* all our javascript code goes here */ </script> </bo...
...dy> </html> it contains some basic information like the document <title>, and some css to set the width and height of the <canvas> element that playcanvas will use to 100% so that it will fill the entire available viewport space.
...And 13 more matches
JavaScript basics - Learn web development
these include: browser application programming interfaces (apis) built into web browsers, providing functionality such as dynamically creating html and setting css styles; collecting and manipulating a video stream from a user's webcam, or generating 3d graphics and audio samples.
... following that, the code set the value of the myheading variable's textcontent property (which represents the content of the heading) to hello world!.
...here we select the <html> element, setting its onclick handler property equal to an anonymous (i.e.
...And 13 more matches
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes (recursive callbacks) yes (nested callbacks) no code example an example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } loadasset('coffee.jpg', 'b...
... further information introducing asynchronous javascript, in particular async callbacks settimeout() settimeout() is a method that allows you to run a function after an arbitrary amount of time has passed.
... single delayed operation repeating operation multiple sequential operations multiple simultaneous operations yes yes (recursive timeouts) yes (nested timeouts) no code example here the browser will wait two seconds before executing the anonymous function, then will display the alert message (see it running live, and see the source code): let mygreeting = settimeout(function() { alert('hello, mr.
...And 13 more matches
Midas
internet explorer supports the ability to make an entire document editable by setting the designmode property of the document object; this is how midas is invoked in gecko.
... properties document.designmode by setting this property to "on", the document becomes editable.
... this command will set the background color of the document.
...And 13 more matches
gtstd.html
upgraded documentation may be found in the current nss reference getting started with ssl chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases.
... ssl, pkcs #11, and the default security databases setting up the certificate and key databases building nss programs ssl, pkcs #11, and the default security databases the basic relationships among the nss libraries are described in introduction to network security services.
...you can use communicator to set up client certificate databases by obtaining certificates from either a public ca or from a certificate server such as netscape certificate management system.
...And 13 more matches
Places utilities for JavaScript
r); boolean showminimaladdmultibookmarkui(array nsiuri aurilist); boolean showbookmarkproperties(int aid); boolean showfolderproperties(int aid); boolean showaddfolderui(string atitle, int adefaultinsertionpoint, boolean ashowpicker); array object getannotationsforuri(nsiuri auri); array object getannotationsforitem(int aitemid); void setannotationsforuri(nsiuri auri, object aannos); void setannotationsforuri(int aitemid, object aannos); getviewfornode(nsidomnode anode); void markpageastyped(string aurl); void markpageasfollowedbookmark(string aurl); boolean checkurlsecurity(nsinavhistoryresultnode aurinode); string getquerystringforfolder(int afolderid); string getdes...
...criptionfromdocument(nsidomdocument doc); string setpostdataforbookmark(int aboomarkid, string apostdata); string getpostdataforbookmark(int aboomarkid); array string geturlandpostdataforkeyword(string akeyword); string getitemdescription(int aitemid); nsinavhistoryresultnode getmostrecentbookmarkforuri(nsiuri auri); nsinavhistoryresultnode getmostrecentfolderforfeeduri(nsiuri auri); nsinavhistoryresultnode geturlsforcontainernode(nsinavhistoryresultnode anode); void opencontainernodeintabs(nsinavhistoryresultnode anode, nsidomevent aevent); void openurinodesintabs(array nsinavhistoryresultnode anodes, nsidomevent aevent); void createmenuitemfornode(nsinavhistoryresultnode anode, acontainersmap); ...
...if set, the folder picker would be hidden unless ashowpicker is set to true, in which case the dialog only uses the folder identifier from the insertion point as the initially selected item in the folder picker.
...And 13 more matches
nsIAccessibleEditableText
the operations it supports includes setting text attributes and text contents while also replacing old text of an object with new text.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void copytext(in long startpos, in long endpos); void cuttext(in long startpos, in long endpos); void deletetext(in long startpos, in long endpos); void inserttext(in astring text, in long position); void pastetext(in long position); void setattributes(in long startpos, in long endpos, in nsisupports attributes); unimplemented void settextcontents(in astring text); attributes attribute type description associatededitor nsieditor returns an editor associated with the accessible.
... void copytext( in long startpos, in long endpos ); parameters startpos start offset of the text to be copied into the clipboard.
...And 13 more matches
nsIMsgIdentity
inherits from: nsisupports method overview void clearallvalues(); void copy(in nsimsgidentity identity); astring getunicharattribute(in string name); void setunicharattribute(in string name, in astring value); acstring getcharattribute(in string name); void setcharattribute(in string name, in acstring value); boolean getboolattribute(in string name); void setboolattribute(in string name, in boolean value); long getintattribute(in string name); void setintattribute(in string name, in long value); ...
...if this is set, this is the smtp server that should be used for the message send.
...if this is set, the return receipt menu item on the compose window will be checked.
...And 13 more matches
nsIMsgIncomingServer
e, in nsimsgwindow amsgwindow, out boolean okayvalue); astring getunicharattribute(in string name); astring getunicharvalue(in string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in acstring oldname, in acstring newname); void performbiff(in nsimsgwindow amsgwindow); void performexpand(in nsimsgwindow amsgwindow); void removefiles(); void setboolattribute(in string name, in boolean value); void setboolvalue(in string attr, in boolean value); void setcharattribute(in string name, in acstring value); void setcharvalue(in string attr, in acstring value); void setdefaultlocalpath(in nsilocalfile adefaultlocalpath); void setfilevalue(in string relpref, in string abspref, in nsilocalfile avalue); void setfilterlist(in nsimsgfilt...
...erlist afilterlist); void setintattribute(in string name, in long value); void setintvalue(in string attr, in long value); void setunicharattribute(in string name, in astring value); void setunicharvalue(in string attr, in astring value); void shutdown(); void storepassword(); astring tostring(); void writetofoldercache(in nsimsgfoldercache foldercache); attributes attribute type description accountmanagerchrome astring read only.
...by default this value is set to true via global pref 'allows_specialfolders_usage' (mailnews.js).
...And 13 more matches
nsINavHistoryQuery
this is important because, if the user has their profile on a networked drive, query latency can be non-negligible method overview nsinavhistoryquery clone(); void getfolders([optional ]out unsigned long count, [retval,array,size_is(count)] out long long folders); void gettransitions([optional] out unsigned long count, [retval,array,size_is(count)] out unsigned long transitions); void setfolders([const,array, size_is(foldercount)] in long long folders, in unsigned long foldercount); void settransitions([const,array, size_is(count)] in unsigned long transitions, in unsigned long count); attributes attribute type description absolutebegintime prtime read only: retrieves the begin time value that the currently loaded reference points + offset resolve to.
... absoluteendtime prtime read only: retrieves the end time value that the currently loaded reference points + offset resolve to.
...setting it to an empty string is a real query and will match any uri that has no host name (local files and such).
...And 13 more matches
nsISelectionPrivate
method overview void addselectionlistener(in nsiselectionlistener newlistener); void endbatchchanges(); void getcachedframeoffset(in nsiframe aframe, in print32 inoffset, in nspointref apoint); native code only!
... void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalarray(in nsinode beginnode, in print32 beginoffset, in nsinode endnode, in print32 endoffset, in boolean allowadjacent, in rangearray results); native code only!
... void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code only!
...And 13 more matches
Autoconfiguration in Thunderbird
in many cases, people should be able to download and install thunderbird, enter their real name, email address and password in the account setup wizard and have a fully functioning mail client and get and send their mail as securely as possible.
... mechanisms thunderbird gets the server settings via different means, each of which is intended for different cases: ispdb the ispdb is a central database, currently hosted by the thunderbird project, but free to use for any client.
... it contains settings for the world's largest isps.
...And 13 more matches
AbstractRange - Web APIs
endcontainer read only the dom node in which the end of the range, as specified by the endoffset property, is located.
... endoffset read only an integer value indicating the offset, in characters, from the beginning of the node's contents to the beginning of the range represented by the range object.
... startcontainer read only the dom node in which the beginning of the range, as specified by the startoffset property, is located.
...And 13 more matches
Using files from web applications - Web APIs
example: showing file(s) size the following example shows a possible use of the size property: <!doctype html> <html> <head> <meta charset="utf-8"> <title>file(s) size</title> </head> <body> <form name="uploadform"> <div> <input id="uploadinput" type="file" name="myfiles" multiple> selected files: <span id="filenum">0</span>; total size: <span id="filesize">0</span> </div> <div><input type="submit" value="send file"></div> </form> <script> function updatesize() { let nbytes = 0, ...
...after creating the new filereader object, we set up its onload function and then call readasdataurl() to start the read operation in the background.
...our implementation of this routine sets the img element's src attribute to the loaded image which results in the image appearing in the thumbnail on the user's screen.
...And 13 more matches
A basic 2D WebGL animation example - Web APIs
the standard webgl global gl_position is then set to the transformed and rotated vertex's position.
...then we set the global gl_fragcolor to the value of the uniform uglobalcolor, which is set by the javascript code to the color being used to draw the square.
...ctor; let uglobalcolor; let urotationvector; let avertexposition; // animation timing let previoustime = 0.0; let degreespersecond = 90.0; initializing the program is handled through a load event handler called startup(): window.addeventlistener("load", startup, false); function startup() { glcanvas = document.getelementbyid("glcanvas"); gl = glcanvas.getcontext("webgl"); const shaderset = [ { type: gl.vertex_shader, id: "vertex-shader" }, { type: gl.fragment_shader, id: "fragment-shader" } ]; shaderprogram = buildshaderprogram(shaderset); aspectratio = glcanvas.width/glcanvas.height; currentrotation = [0, 1]; currentscale = [1.0, aspectratio]; vertexarray = new float32array([ -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, -0.5,...
...And 13 more matches
Coordinate systems - CSS: Cascading Style Sheets
the position is specified as the number of pixels offset from the origin along each dimension of the context.
... dimensions in the coordinate systems used by web technologies, convention dictates that the horizontal offset is called the x-coordinate, where a negative value indicates a position to the left of the origin and a positive value is to the right of the origin.
... the y-coordinate specifies the vertical offset, with a negative value being above the origin and a positive value being below the origin.
...And 13 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
in this first example, i am using flexbox to lay out a set of boxes.
... i have also set the flex-wrap property to wrap, so that if the space in the container becomes too narrow to maintain the flex basis, items will wrap onto a new row.
...we do not need to set anything on the items themselves; they will lay themselves out one into each cell of the created grid.
...And 13 more matches
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
property purpose border-block sets border-color, border-style, and border-width for both block borders.
... border-block-color sets border-color for both block borders.
... border-block-style sets border-style for both block borders.
...And 13 more matches
font - CSS: Cascading Style Sheets
WebCSSfont
the font css shorthand property sets all the different properties of an element's font.
... alternatively, it sets an element's font to a system font.
... as with any shorthand property, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties).
...And 13 more matches
mask - CSS: Cascading Style Sheets
WebCSSmask
as well as the properties listed below, the mask shorthand also resets mask-border to its initial value.
... it is therefore recommended to use the mask shorthand rather than other shorthands or the individual properties to override any mask settings earlier in the cascade.
... this will ensure that mask-border has also been reset to allow the new styles to take effect.
...And 13 more matches
Getting Started - Developer guides
at this stage, you need to tell the xmlhttp request object which javascript function will handle the response, by setting the onreadystatechange property of the object and naming it after the function to call when the request changes state, like this: httprequest.onreadystatechange = nameofthefunction; note that there are no parentheses or parameters after the function name, because you're assigning a reference to the function, rather than actually calling it.
... the optional third parameter sets whether the request is asynchronous.
... note that if you want to post data, you may have to set the mime type of the request.
...And 13 more matches
Localizations and character encodings - Developer guides
the <meta> element's charset attribute is used to specify the page's character encoding.
... to specify that a page is using, for example, the utf-8 character encoding (as per the recommendation), simply place the following line in the <head> block: <meta charset="utf-8"> details and browser internals when the encoding is declared by web content like the html specification requires, firefox will use that encoding for turning the bytes into the internal representation.
...for most locales, the fallback encoding is windows-1252 (often called iso-8859-1), which was the encoding emitted by most windows applications in the 1990s and a superset of the encoding emitted by most unix applications in the 1990s as a deployed in the america has and in western europe.
...And 13 more matches
Index - HTTP
WebHTTPHeadersIndex
browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script.
... 3 accept-charset content negotiation, http, http header, reference, request header the accept-charset request http header advertises which character set the client is able to understand.
...browsers usually don't set this header as the default value for each content type is usually correct and transmitting it would allow easier fingerprinting.
...And 13 more matches
dominant-baseline - SVG: Scalable Vector Graphics
when the initial value, auto, would give an undesired result, this property can be used to explicitly set the desired scaled-baseline-table.
... if the computed baseline-shift value actually shifts the baseline, then the baseline-table font-size component is set to the value of the font-size attribute on the element on which the dominant-baseline attribute occurs, otherwise the baseline-table font-size remains the same as that of the element.
... use-script the dominant-baseline and the baseline-table components are set by determining the predominant script of the character data content.
...And 13 more matches
Understanding WebAssembly text format - WebAssembly
getting and setting locals and parameters locals/parameters can be read and written by the body of the function with the local.get and local.set instructions.
... the local.get/local.set commands refer to the item to be got/set by its numeric index: parameters are referred to first, in order of their declaration, followed by locals in order of their declaration.
...you could swap out the i32 for any of the other available types, and change the value of the const to whatever you like (here we’ve set the value to 42).
...And 13 more matches
Running Tamarin performance tests - Archive of obsolete content
running the performance tests requires the following steps: set the avm environment variable to the path of the avmshell executable.
... set the builtinabc environment variable to the path of the builtin.abc.
... (in the tamarin-redux/generated directory) set the shellabc environment variable to the path of the shell_toplevel.abc.
...And 12 more matches
Tamarin build documentation - Archive of obsolete content
example call to build on an x86_64 machine with the 10.5 sdk: $ ../configure.py --mac-sdk=105 --target=x86_64-darwin if asc is not set, you will need to add asc.jar to the utils directory in tamarin-redux (bug 631641).
... download ftp://ftp.mozilla.org/pub/js/tamarin/builds/asc/latest/asc.jar put it in utils/ building tamarin for android 2.3.3 on mac public sdk/ndk setup to build tamarin for android you will need an sdk/ndk.
... the setup procedure below creates an android sdk/ndk entirely from publicly available sources.
...And 12 more matches
Install script template - Archive of obsolete content
ion); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall(software_name, software_name, version); if (err != 0) cancelinstall(err); } //addfiles to current browser block var pluginsfolder = getfolder("plugins"); //verify disk space if(verifydiskspace(pluginsfolder, plugin_size+component_size)) { // start installing plugin shared library reseterror(); // install the plugin shared library to the current browser's plugin directory errblock1 = addfile (plid, version, plugin_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + plugin_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } // start installing xpt file if this is a scriptable plugin // install to the plugins dire...
...ory can be avoided for xpt files errblock1 = addfile (plid, version, component_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + component_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } } else { logcomment("cancelling current browser install due to lack of space..."); cancellinstall(); } // secondary install block, which sets up plugins and xpt in another location in addition to the current browser errblock2 = createsecondaryinstall(); // performinstall block, in which error conditions from previous blocks are checked.
... if(errblock2 == success) { // now take care of writing plids to the win32 registry err = writeplidsolution(); if(err!=success) { logcomment("could not write win32 keys as specified: " + err); } else { logcomment("plid entries are present in the win32 registry"); } } reseterror(); err = performinstall(); if (err == success) refreshplugins(true); // call refreshplugins(true) if you'd like the web page which invoked the plugin to // reload.
...And 12 more matches
Popup Menus - Archive of obsolete content
first, an example: <popupset> <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> </popupset> as can be seen here, a simple popup menu with three commands on it has been created.
...you will also notice that the id has been set on the menupopup element itself.
... the popupset element surrounds the entire popup menu declaration.
...And 12 more matches
richlistitem - Archive of obsolete content
if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...to change the selection, set either the selectedindex or selecteditem property of the containing element.
...And 12 more matches
timepicker - Archive of obsolete content
to specify the initial, use the value attribute set to a value of either the form hh:mm:ss or hh:mm.
...to avoid this, you can use the workaround described here, i.e., use window.settimeout(actual-event-handler-function, 0); to queue up your event handler to run after the rest of the picker's change event handlers.
...if this attribute is set, the element is disabled.
...And 12 more matches
Looping code - Learn web development
in pseudocode, this would look something like the following: loop(food = 0; foodneeded = 10) { if (food >= foodneeded) { exit loop; // we have enough food; let's go home } else { food += 2; // spend an hour collecting 2 more food // loop will then run again } } so the amount of food needed is set at 10, and the amount the farmer currently has is set at 0.
...let's say we wanted to draw 100 random circles on a <canvas> element (press the update button to run the example again and again to see different random sets): hidden code <!doctype html> <html> <head> <meta charset="utf-8"> <title>random canvas circles</title> <style> html { width: 100%; height: inherit; background: #ddd; } canvas { display: block; } body { margin: 0; } button { position: absolute; top: 5px; left: 5px; ...
... inside the parentheses we have three items, separated by semi-colons: an initializer — this is usually a variable set to a number, which is incremented to count the number of times the loop has run.
...And 12 more matches
Fetching data from the server - Learn web development
originally page loading on the web was simple — you'd send a request for a website to a server, and as long as nothing went wrong, the assets that made the web page would be downloaded and displayed on your computer.
... the trouble with this model is that whenever you want to update any part of the page, for example, to display a new set of products or load a new page, you've got to load the entire page again.
... to speed things up even further, some sites also store assets and data on the user's computer when they are first requested, meaning that on subsequent visits they use the local versions instead of downloading fresh copies when the page is first loaded.
...And 12 more matches
Index
if the user already has an email account, the user can switch to the original account setup wizard.
... 13 autoconfig: how to create a configuration file autoconfiguration, thunderbird authoritative definition 14 autoconfiguration in thunderbird moved to autoconfiguration 15 buddy icons in mail seth spitzer mozilla is now able to show icons in the message header area and the addressbook card pane.
... (see this document for info about that.) for the addressbook card pane, the icon will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for card>.gif if aim.session.screenname is not set, the icon will not appear.
...And 12 more matches
AudioListener - Web APIs
properties the position, forward, and up value are set and retrieved using different syntaxes.
... retrieval is done by accessing, for example, audiolistener.positionx, while setting the same property is done with audiolistener.positionx.value.
... methods audiolistener.setorientation() sets the orientation of the listener.
...And 12 more matches
Background Tasks API - Web APIs
falling back to settimeout because the background tasks api is fairly new, your code may need to be able to work on browsers that don't yet support it.
... you can do so with a simple shim that uses settimeout() as a fallback option.
... this isn't a polyfill, since it's not functionally identical; settimeout() doesn't let you make use of idle periods, but instead runs your code when possible, leaving us to do the best we can to avoid causing the user to experience performance lag.
...And 12 more matches
Using Service Workers - Web APIs
but the overriding problem is that there still isn’t a good overall control mechanism for asset caching and custom network requests.
... the previous attempt — appcache — seemed to be a good idea because it allowed you to specify assets to cache really easily.
...using a service worker you can easily set an app up to use cached assets first, thus providing a default experience even when offline, before then getting more data from the network (commonly known as offline first).
...And 12 more matches
Rendering and the WebXR frame animation callback - Web APIs
once your webxr environment has been set up and an xrsession created to represent an ongoing xr environment session, you need to provide frames of the scene to the xr device for rendering.
... before you can render the virtual environment, you need to establish a webxr session by creating an xrsession using the navigator.xr.requestsession() method; you also need to associate the session with a framebuffer and perform other setup tasks.
... these setup tasks are described in the article setting up and shutting down a webxr session.
...And 12 more matches
WebXR Device API - Web APIs
the webxr device api implements the core of the webxr feature set, managing the selection of output devices, render the 3d scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers.
... webxr-compatible devices include fully-immersive 3d headsets with motion and orientation tracking, eyeglasses which overlay graphics atop the real world scene passing through the frames, and handheld mobile phones which augment reality by capturing the world with a camera and augment that scene with computer-generated imagery.
...once both eyes' perspectives on the scene have been rendered, the resulting framebuffer is delivered to the webxr device to be presented to the user through their headset or other appropriate display device.
...And 12 more matches
Using Web Workers - Web APIs
back in the main thread, we use onmessage again, to respond to the message sent back from the worker: myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); } here we grab the message event data and set it as the textcontent of the result paragraph, so the user can see the result of the calculation.
...previously executed code (including code deferred using window.settimeout()) will still be functional though.
...when the onmessage event handler in the parent thread is setup, or when the start() method is explicitly called in the parent thread).
...And 12 more matches
ARIA live regions - Accessibility
aria-live: the aria-live=politeness_setting is used to set the priority with which screen reader should treat updates to live regions - the possible settings are: off, polite or assertive.
... the default setting is off.
... html <fieldset> <legend>planet information</legend> <label for="planetsselect">planet:</label> <select id="planetsselect" aria-controls="planetinfo"> <option value="">select a planet&hellip;</option> <option value="mercury">mercury</option> <option value="venus">venus</option> <option value="earth">earth</option> <option value="mars">mars</option> </select> <button id="renderplanet...
...And 12 more matches
Accessibility: What users can do to browse more safely - Accessibility
this article discusses making web content accessible for those with vestibular disorders, and those who support them, by taking advantage of personalization and accessibility settings built into the operating systems.
... taking advantage of personalization settings can help prevent exposure to content leading to seizures and / or other physical reactions.
... personalization and accessibility settings from the article, "understanding success criterion 2.3.1: three flashes or below threshold" "flashing can be caused by the display, the computer rendering the image or by the content being rendered.
...And 12 more matches
Architecture - Accessibility
when you have an nsiaccessiblehypertext, you can ask for its links, which is the subset of children from the nsiaccessible hierarchy that are not text or whitespace.
...the children of a hypertext object are a superset of the links it exposes.
... how does an at deal with text (a) to get the embedded object for an embedded object char: linkindex = iahypertext::getlinkindex(offset) iahyperlink*object = iahypertext::getlink(linkindex) iaccessible* accessible = qi/qs(object) (b) to get the offset in the parent text for a given embedded object: qi/qa to iahyperlink if not successful, then it is not embedded in text, so it's position in parent should be determined just by ia2::indexinparent, which will return its child offset within the parent.
...And 12 more matches
font-size - CSS: Cascading Style Sheets
WebCSSfont-size
the font-size css property sets the size of the font.
...t-size: xx-small; font-size: x-small; font-size: small; font-size: medium; font-size: large; font-size: x-large; font-size: xx-large; font-size: xxx-large; /* <relative-size> values */ font-size: smaller; font-size: larger; /* <length> values */ font-size: 12px; font-size: 0.8em; /* <percentage> values */ font-size: 80%; /* global values */ font-size: inherit; font-size: initial; font-size: unset; the font-size property is specified in one of the following ways: as one of the absolute-size or relative-size keywords as a <length> or a <percentage>, relative to the parent element's font size values xx-small, x-small, small, medium, large, x-large, xx-large, xxx-large absolute-size keywords, based on the user's default font size (which is medium).
... keywords keywords are a good way to set the size of fonts on the web.
...And 12 more matches
position - CSS: Cascading Style Sheets
WebCSSposition
the position css property sets how an element is positioned in a document.
... relative the element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, bottom, and left.
... the offset does not affect the position of any other elements; thus, the space given for the element in the page layout is the same as if position were static.
...And 12 more matches
<input type="range"> - HTML: Hypertext Markup Language
WebHTMLElementinputrange
events change and input supported common attributes autocomplete, list, max, min, and step idl attributes list, value, and valueasnumber methods stepdown() and stepup() validation there is no pattern validation available; however, the following forms of automatic validation are performed: if the value is set to something which can't be converted into a valid floating-point number, validation fails because the input is suffering from a bad input.
...the default value is halfway between the specified minimum and maximum—unless the maximum is actually less than the minimum, in which case the default is set to the value of the min attribute.
...rangeelem.min : rangeelem.min + (rangeelem.max - rangeelem.min)/2; if an attempt is made to set the value lower than the minimum, it is set to the minimum.
...And 12 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
always set the label and tooltiptext attributes of a toolbarbutton.
... setting the image for a toolbar button is done with css: #xulschoolhello-hello-world-button { list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } it's not really that simple to set the image for a toolbar button, because we need to consider the appearance of the button on different systems, and also consider the different button states, but we'll get into that further ahead.
... <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.
...And 11 more matches
Handling Preferences - Archive of obsolete content
preferences are used to store settings and information to change their default behavior.
...this is where the user's settings are stored.
... user preferences: the file user.js in the user's profile directory holds additional preferences the user has set.
...And 11 more matches
Adding preferences to an extension - Archive of obsolete content
establish the defaults in order to set a default preference for the stock to monitor, we need to add a new folder to our extension's package, called "defaults", which in turn contains another folder called "preferences".
...er to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("extensions.stockwatcher2."); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.refreshinformation(); window.setinterval(this.refreshinformation, 10*60*1000); } }, our object has two member variables.
... now that we're monitoring the preferences, we can set up to watch the stock information and display it in the status bar panel.
...And 11 more matches
Running Tamarin acceptance tests - Archive of obsolete content
running the tamarin test suite requires the following steps: set the avm environment variable to the path of the avmplus executable (avmshell).
...set the builtinabc environment variable to the path of the generated/builtin.abc.
...set the asc environment variable, as described above.
...And 11 more matches
Splitters - Archive of obsolete content
set this to open, the default, to have the split panel initially open, or set it to collapsed to have one of the panels shrunk down (collapsed) and the other occupying all of the space.
... collapse this indicates which side of the panel should collapse when the splitter notch (or grippy) is clicked or set into a collapsed state.
... set this to before for the element before the splitter, or after for the element after the splitter.
...And 11 more matches
description - Archive of obsolete content
the text can be set either with the value attribute or by placing text inside the open and close description tags.
... the value attribute is used to set text that appears in a single line.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...And 11 more matches
radiogroup - Archive of obsolete content
if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...And 11 more matches
Building up a basic demo with Three.js - Game development
in this article we'll take you through the real basics of using three, including setting up a development environment, structuring the necessary html, the fundamental objects of three, and how to build up a basic demo.
... environment setup to start developing with three.js, you don't need much.
... html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: three.js demo</title> <style> body { margin: 0; padding: 0; } canvas { width: 100%; height: 100%; } </style> </head> <body> <script src="three.min.js"></script> <script> var width = window.innerwidth; var height = window.innerheight; /* all our javascript code goes here */ </script> </body> </html> it contains some basic information like the document <title>...
...And 11 more matches
HTML text fundamentals - Learn web development
if you make a mistake, you can always reset it using the reset button.
... my legs are made of cardboard and i am married to a fish.</textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solu...
...tion = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); var htmlsolution = '<h1>my short story</h1>\n<p>i am a statistician and my name is trish.</p>\n<p>my legs are made of cardboard...
...And 11 more matches
Getting started with Vue - Learn web development
objective: to setup a local vue development environment, create a starter app, and understand the basics of how it works.
...there are a few preset ones, and you can make your own.
..."in dedicated config files" will put your config settings for things like eslint into their own, dedicated files.
...And 11 more matches
Release phase
you've setup up your local and remote environments, you've selected your l10n tools and projects, done some localization and even some testing!
...we'll primarily focus on getting your release repository setup and the mercurial commands you'll need to know to use that repository.
...hs] default = hg.mozilla.org/releases/l10n-central/x-testing default-push = ssh://hg.mozilla.org/releases/l10n-central/x-testing if you haven't already cloned the remote repository, enter this command: hg clone ssh://hg.mozilla.org/releases/l10n-central/x-testing mercurial will let you know that it's cloning the repository: destination directory: x-testing requesting all changes adding changesets adding manifests adding file changes added 4 changesets with 242 changes to 239 files updating to branch default 239 files updated, 0 files merged, 0 files removed, 0 files unresolved the default push url is the same as the default pull url (i.e., ssh://hg.mozilla.org/releases/l10n-central/x-testing).
...And 11 more matches
NSS environment variables
there is a separate set of environment variables that affect how nss is built, documented below.
... variable type description introduced in version nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below).
... nss_ssl_enable_renegotiation string ([0|n|n], [1|u|u], [2|r|r], [3|t|t]) (definition for nss 3.12.6 and above) sets how tls renegotiation is handled [1|u|u]: ssl_renegotiate_unrestricted server and client are allowed to renegotiate without any restrictions.
...And 11 more matches
NSS Tools modutil
you can use the tool to add and delete pkcs #11 modules, change passwords, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
... with the -changepw command, the password on the netscape internal module cannot be set or changed, since this password is stored in key3.db.
... creating a set of security management database files (key3.db, cert8.db, and secmod.db): -create displaying basic module information or detailed information about the contents of a given module: -list [modulename] adding a pkcs #11 module, which includes setting a supporting library file, enabling ciphers, and setting default provider status for various security mechanisms: -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] adding a pkcs #11 module from an existing jar file: -jar jar-fil...
...And 11 more matches
JS_DefineProperty
syntax bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handlevalue value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, int32_t value, unsigned attrs,...
... jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineproperty(jscontext *cx, js::handleobject obj, const char *name, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlevalue value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t ...
...namelen, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, uint32_t value, unsigned attrs, jsnative getter = nullp...
...And 11 more matches
nsIDialogParamBlock
inherits from: nsisupports last changed in gecko 1.7 method overview print32 getint( in print32 inindex ); wstring getstring( in print32 inindex ); void setint( in print32 inindex, in print32 inint ); void setnumberstrings( in print32 innumstrings ); void setstring( in print32 inindex, in wstring instring); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports.
... methods getint() get a previously set integer.
... return value the previously set integer, or 0 if no integer has been previously set at that index.
...And 11 more matches
nsINavHistoryService
toolkit/components/places/nsinavhistoryservice.idlscriptable this interface provides complex query functions, more fine-grained getters and setters.
...yquery aqueries, in unsigned long aquerycount, in nsinavhistoryqueryoptions options); void addobserver(in nsinavhistoryobserver observer, in boolean ownsweak); void removeobserver(in nsinavhistoryobserver observer); void runinbatchmode(in nsinavhistorybatchcallback acallback, in nsisupports aclosure); void importhistory(in nsifile file); astring getcharsetforuri(in nsiuri auri); astring setcharsetforuri(in nsiuri auri, in astring acharset); attributes attribute type description hashistoryentries boolean true if there is any history.
... transition_typed 2 this transition type is set when the user typed the url to get to the page.
...And 11 more matches
Using the clipboard
ass var res = nssupportsstring(); // store the javascript string that we want to wrap in the new nsisupportsstring object res.data = str; return res; } // create a constructor for the built-in transferable class const nstransferable = components.constructor("@mozilla.org/widget/transferable;1", "nsitransferable"); // create a wrapper to construct an nsitransferable instance and set its source to the given window, when necessary function transferable(source) { var res = nstransferable(); if ('init' in res) { // when passed a window object, find a suitable privacy context for it.
...trans.settransferdata("text/unicode", supportsstring(str), str.length * 2); the first line gets the transferring component which implements nsitransferable.
...then, the function settransferdata is called which copies the data from the string into the transferable.
...And 11 more matches
Debugger.Object - Firefox Developer Tools
the referent's properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent's getters and setters.
... unless otherwise specified, these methods are not invocation functions; if a call would cause debuggee code to run (say, because it gets or sets an accessor property whose handler is debuggee code, or because the referent is a proxy whose traps are debuggee code), the call throws a debugger.debuggeewouldrun exception.
... setproperty(name,value) storevalue as the value of the referent's property namedname, creating the property if it does not exist.name must be a string;value must be a debuggee value.
...And 11 more matches
Edit fonts - Firefox Developer Tools
for standard (static) fonts, you will be able to change the settings listed below size the font-size for the inspected element.
... this can be set using em, rem, %, px, vh, or vw units.
... note: if you want to use a different unit such as pt for font-size or line-height, you can set the property value applied to the currently inspected element to use that unit via the rules view, and the font editor will automatically pick it up and make it available in the associated units dropdown menu.
...And 11 more matches
BasicCardResponse - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true) and the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicating the countries in which to support payments (for example, us,ca.).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true) and the dom.payments.request.supportedregions preference (needs to be set to a comma-delineated list of one or more 2-character iso country codes indicating the countries in which to support payments (for example, us,ca.).
...no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...And 11 more matches
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
var cell = document.createelement("td"); var celltext = document.createtextnode("cell in row "+i+", column "+j); cell.appendchild(celltext); row.appendchild(cell); } // add the row to the end of the table body tblbody.appendchild(row); } // put the <tbody> in the <table> tbl.appendchild(tblbody); // appends <table> into <body> body.appendchild(tbl); // sets the border attribute of tbl to 2; tbl.setattribute("border", "2"); } note the order in which we created the elements and the text node: first we created the <table> element.
... example: setting the background color of a paragraph getelementsbytagname(tagnamevalue) is a method available in any dom element or the root document element.
... html <body> <input type="button" value="set paragraph background color" onclick="set_background()"> <p>hi</p> <p>hello</p> </body> javascript function set_background() { // get a list of all the body elements (there will only be one), // and then select the zeroth (or first) such element mybody = document.getelementsbytagname("body")[0]; // now, get all the p elements that are descendants of the body mybodyelements = mybody.getelementsbytagname("p"); // get the second item of the list of p elements myp = mybodyelements[1]; myp.style.background = "rgb(255,0,0)"; } in this example, we set the myp vari...
...And 11 more matches
MouseEvent.initMouseEvent() - Web APIs
this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
... 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.
...sets the value of event.bubbles.
...And 11 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
syntax void gl.vertexattribpointer(index, size, type, normalized, stride, offset); parameters index a gluint specifying the index of the vertex attribute that is to be modified.
... stride a glsizei specifying the offset in bytes between the beginning of consecutive vertex attributes.
... offset a glintptr specifying an offset in bytes of the first component in the vertex attribute array.
...And 11 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
cameras and relative movement when a classic live-action movie is filmed, the actors are on a set and move about the set as they perform, with one or more cameras watching their moves.
... the cameras may be fixed in place, but they may also be set up to move around as well, tracking the movement of the performers, dollying in and out to achieve emotional impact, and so forth.
... in business applications, the 3d camera is used to simply set the apparent size and perspective when rendering things such as graphs and charts.
...And 11 more matches
Window.open() - Web APIs
WebAPIWindowopen
tip: note that in some browsers, users can override the windowfeatures settings and enable (or prevent the disabling of) features position and size features windowfeatures parameter can specify the position and size of the new window.
...an offset is universally implemented by browser manufacturers (it is 29 pixels in ie6 sp2 with the default theme) and its purpose is to help users to notice new windows opening.
... if the most recently used window was maximized, then there is no offset: the new window will be maximized as well.
...And 11 more matches
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
the following code would set the flex-grow property to 2, flex-shrink to 1 and flex-basis to auto.
... in the following examples i am working with flex-direction set to row, therefore the size of items will always come from their width.
...if flex-basis is set to auto then to work out the initial size of the item the browser first checks if the main size of the item has an absolute size set.
...And 11 more matches
Basic Shapes - CSS: Cascading Style Sheets
inset() the inset() type defines a rectangle, which may not seem very useful as simply floating an item will give you a rectangular shape around it.
... however the inset() types enables the definition of offsets, thus pulling the content in over the shape.
... therefore inset() takes four values for the top, right, bottom and left values plus a final value for border-radius.
...And 11 more matches
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
each property has a set of valid values, defined by a formal grammar, as well as a semantic meaning, implemented by the browser engine.
... css declarations setting css properties to specific values is the core function of the css language.
... css rulesets if style sheets could only apply a declaration to each element of a web page, they would be pretty useless.
...And 11 more matches
border-style - CSS: Cascading Style Sheets
the border-style shorthand css property sets the line style for all four sides of an element's border.
... constituent properties this property is a shorthand for the following css properties: border-bottom-style border-left-style border-right-style border-top-style syntax /* keyword values */ border-style: none; border-style: hidden; border-style: dotted; border-style: dashed; border-style: solid; border-style: double; border-style: groove; border-style: ridge; border-style: inset; border-style: outset; /* vertical | horizontal */ border-style: dotted solid; /* top | horizontal | bottom */ border-style: hidden double dashed; /* top | right | bottom | left */ border-style: none solid dotted dashed; /* global values */ border-style: inherit; border-style: initial; border-style: unset; the border-style property may be specified using one, two, three, or four values.
...unless a background-image is set, the computed value of the same side's border-width will be 0, even if the specified value is something else.
...And 11 more matches
Constraint validation - Developer guides
basic, usual constraints can be checked, without the need for javascript, by setting new attributes; more complex constraints can be tested using the constraint validation api.
... by setting values on validation-related attributes, allowing basic constraints to be described in a simple way, without the need for javascript.
... typemismatch constraint violation for both of these input types, if the multiple attribute is set, several values can be set, as a comma-separated list, for this input.
...And 11 more matches
<input type="date"> - HTML: Hypertext Markup Language
WebHTMLElementinputdate
you can set a default value for the input with a date inside the value attribute, like so: <input type="date" value="2017-06-01"> the displayed date format will differ from the actual value — the displayed date is formatted based on the locale of the user's browser, but the parsed value is always formatted yyyy-mm-dd.
... you can get and set the date value in javascript with the input element's value and valueasnumber properties.
... for example: var datecontrol = document.queryselector('input[type="date"]'); datecontrol.value = '2017-06-01'; console.log(datecontrol.value); // prints "2017-06-01" console.log(datecontrol.valueasnumber); // prints 1496275200000, a unix timestamp this code finds the first <input> element whose type is date, and sets its value to 2017-06-01 (june 1st, 2017).
...And 11 more matches
Working with objects - JavaScript
mycar.color; // undefined properties of javascript objects can also be accessed or set using a bracket notation (for more details see property accessors).
... defining getters and setters a getter is a method that gets the value of a specific property.
... a setter is a method that sets the value of a specific property.
...And 11 more matches
Gradients in SVG - SVG: Scalable Vector Graphics
basic example <svg width="120" height="240" version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient1"> <stop class="stop1" offset="0%"/> <stop class="stop2" offset="50%"/> <stop class="stop3" offset="100%"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> <stop offset="0%" stop-color="red"/> <stop offset="50%" stop-color="black" stop-opacity="0"/> <stop offset="100%" stop-color="blue"/> </lineargradient> <style type="text/css"><![c...
...these nodes tell the gradient what color it should be at certain positions by specifying an offset attribute for the position, and a stop-color attribute.
...you can insert as many stop colors as you like to create a blend that's as beautiful or hideous as you need, but the offsets should always increase from 0% (or 0 if you want to drop the % sign) to 100% (or 1).
...And 11 more matches
context-menu - Archive of obsolete content
declarative contexts you can specify some simple, declarative contexts when you create a menu item by setting the context property of the options object passed to its constructor, like this: var cm = require("sdk/context-menu"); cm.item({ label: "my menu item", context: cm.urlcontext("*.mozilla.org") }); constructor description pagecontext() the page context.
... the simplest method is to set the menu item's label property.
... this example updates the item's label based on the number of times it's been clicked: var numclicks = 0; var myitem = require("sdk/context-menu").item({ label: "click me: " + numclicks, contentscript: 'self.on("click", self.postmessage);', onmessage: function () { numclicks++; this.label = "click me: " + numclicks; // setting myitem.label is equivalent.
...And 10 more matches
preferences/service - Archive of obsolete content
this enables add-ons to get and set system-wide settings.
... globals functions set(name, value) sets the application preference name to value.
... example: var name = "extensions.checkcompatibility.nightly"; require("sdk/preferences/service").set(name, false); get(name, defaultvalue) gets the application preference name.
...And 10 more matches
Inline options - Archive of obsolete content
here is an example of an options.xul file: <?xml version="1.0"?> <!doctype mydialog system "chrome://myaddon/locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="bool" pref="extensions.myaddon.bool" title="boolean" desc="stored as a boolean preference" /> </vbox> note that it's limited to <setting> tags.
... setting types there are several types of <setting>s, each with a different type attribute: type attribute displayed as preference stored as bool checkbox boolean boolint checkbox integer (use the attributes on and off to specify what values to store) integer textbox integer string textbox string color colorpicker string (in the #123456 format) file browse button and label string directory browse button and label string menulist menulist dependent on the menu item values radio radio buttons depende...
...to set a description, either use the desc attribute, or a text node as a child of the <setting> tag.
...And 10 more matches
MMgc - Archive of obsolete content
each instance manages its own set of objects; objects are not allowed to reference objects in other gc instances.
...kfinalize and krcobject are used internally by the gc; you should not need to set them in your user code.
... 0xfbfbfbfb a block given back to the heap manager is memset to this (fb == free block).
...And 10 more matches
Introducing the Audio API extension - Archive of obsolete content
those samples may or may not have been played yet at the time of the event and have not been adjusted for mute or volume settings on the media element.
...mebuffer[1]; raw.innerhtml = text; } var raw = document.getelementbyid('raw'); var audio = document.getelementbyid('audio-element'); audio.addeventlistener('mozaudioavailable', audioavailable, false); audio.addeventlistener('loadedmetadata', loadedmetadata, false); </script> </body> </html> creating an audio stream it is also possible to create and setup an <audio> element for raw writing from script (i.e., without a src attribute).
...users must create an audio object and then use the mozsetup() function to specify the number of channels and the frequency (in hz).
...And 10 more matches
Venkman Introduction - Archive of obsolete content
clicking in the left margin of this view will set a breakpoint at that line.
... if the breakpoint is successfully set, the margin will show the letter "b" on a red background, and both the loaded scripts view and interactive session view will provide feedback.
...breakpoints cannot be set on lines which do not contain executable code, such as blank and comment lines.
...And 10 more matches
Keyboard Shortcuts - Archive of obsolete content
you might want to set up more general keyboard shortcuts however.
...an example is shown below: <keyset> <key id="sample-key" modifiers="shift" key="r"/> </keyset> this sample defines a keyboard shortcut that is activated when the user presses the shift key and r.
... the key element must be placed inside a keyset element.
...And 10 more matches
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
(using advanced features, progress meters or checkboxes also can be added to the tree) a tree consists of two parts, the set of columns, and the tree body.
... the set of columns is defined by a number of treecol elements, one for each column.
...to modify the appearance of a tree cell, the view must instead associate a set of keywords for a row and cell.
...And 10 more matches
dialog - Archive of obsolete content
the buttons attribute may be used to set which buttons should appear in the dialog box.
...you can set its label with the buttonlabelextra1 attribute.
...you can set its label with the buttonlabelextra2 attribute.
...And 10 more matches
notification - Archive of obsolete content
persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them.
... this may be used to close a set of notifications as a group without affecting other notifications.
...be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
...And 10 more matches
tooltip - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
... noautohide type: boolean if this attribute is set to false or omitted, the tooltip will automatically disappear after a few seconds.
... if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element.
...And 10 more matches
WAI-ARIA basics - Learn web development
a whole new set of problems as web apps started to get more complex and dynamic, a new set of accessibility features and problems started to appear.
... enter wai-aria wai-aria (web accessibility initiative - accessible rich internet applications) is a specification written by the w3c, defining a set of additional html attributes that can be applied to elements to provide additional semantics and improve accessibility wherever it is lacking.
...in these situations, aria can help to provide what's missing with a combination of roles like button, listbox, or tabgroup, and properties like aria-required or aria-posinset to provide further clues as to functionality.
...And 10 more matches
Introduction to CSS layout - Learn web development
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.
...everything in normal flow has a value of display, used as the default way that elements they are set on behave.
...this is due to them becoming flex items and being affected by some initial values that flexbox sets on the flex container.
...And 10 more matches
How CSS is structured - Learn web development
you reference an external css stylesheet from an html <link> element: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my css experiment</title> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>hello world!</h1> <p>this is my first css example</p> </body> </html> the css stylesheet file might look like this: h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } the href attribute of the <link> element needs to referen...
... the html for an internal stylesheet might look like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my css experiment</title> <style> h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } </style> </head> <body> <h1>hello world!</h1> <p>this is my first css example</p> </body> </html> in some circumstances, internal stylesheets can be useful.
...the implementation of an inline style in an html document might look like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my css experiment</title> </head> <body> <h1 style="color: blue;background-color: yellow;border: 1px solid black;">hello world!</h1> <p style="color:red;">this is my first css example</p> </body> </html> avoid using css in this way when possible.
...And 10 more matches
Advanced form styling - Learn web development
firefox settled on this because web developers mostly seemed to be using the -webkit- prefixed version, so it was better for compatibility.
... interestingly, setting border/background on the search field also fixes this problem, as it disables or "breaks" the aqua appearance too.
...ndows 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> <p> <label> <input type="checkbox" name="fruit-3" value="strawber...
...And 10 more matches
Debugging on Windows
enable it by going its configuration menu in "debug > other debugging targets > child process debugging settings", and ticking the box.
... changing/setting the executable to debug vc++ 6.0: to change or set the executable to debug, go to project > settings..., debug tab and select general from the drop down list.
... command line parameters and environment variables vc++ 6.0: to change or set the command line options, go to project > settings..., debug tab and select general from the drop down list.
...And 10 more matches
JavaScript-DOM Prototypes in Mozilla
prototype setup on an xpconnect wrapped dom node in mozilla when a dom node is accessed from javascript in mozilla, the native c++ dom node is wrapped using xpconnect and the wrapper is exposed to javascript as the javascript representation of the dom node.
...all the methods that are supposed to show up on this jsobject are actually not properties of the object itself, but rather properties of the prototype of the jsobject for the wrapper (unless the c++ object's class info has the flag nsixpcscriptable::dont_share_prototype set, but lets assume that's not the case here).
... var obj = document.images[0]; here, obj will not really have any properties (except for the standard jsobject properties such as constructor, and the non-standard __parent__, __proto__, etc.), all the dom functionality of obj comes from obj's prototype (obj.__proto__) that xpconnect sets up when exposing the first image in document to javascript.
...And 10 more matches
SpiderMonkey 1.8.5
getters and setters of type jspropertyop took an id parameter of type jsval.
...many getters and setters simply ignore the id anyway; if the value is needed, use js_idtovalue.
... the type of setters has changed from jspropertyop to jsstrictpropertyop (to accomodate es5 strict mode).
...And 10 more matches
Places Developer Guide
overview places is the umbrella term for a set of apis for managing browsing history and uri metadata first introduced in firefox 3.
...var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice); var query = history.getnewquery(); query.setfolders([myfolderid], 1); var result = history.executequery(query, history.getnewqueryoptions()); // the root property of a query result is an object representing the folder you specified above.
...wser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice); var query = history.getnewquery(); // specify folders to be searched var folders = [bookmarks.toolbarfolder, bookmarks.bookmarksmenufolder, bookmarks.unfiledbookmarksfolder]; query.setfolders(folders, folders.length); // specify terms to search for, matches against title, url and tags query.searchterms = "firefox"; var options = history.getnewqueryoptions(); options.querytype = options.query_type_bookmarks; var result = history.executequery(query, options); // the root property of a query result is an object representing the folder you specified above.
...And 10 more matches
nsIDBFolderInfo
omponents.interfaces.nsidbfolderinfo); method overview long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages(in long delta); boolean getbooleanproperty(in string propertyname, in boolean defaultvalue); void getcharacterset(out acstring charset, out boolean overriden); void getcharactersetoverride(out boolean charactersetoverride); obsolete since gecko 1.8 string getcharptrcharacterset(); string getcharptrproperty(in string propertyname); void getlocale(in nsstring result); native code only!
...obsolete since gecko 1.8 astring getproperty(in string propertyname); nsidbfolderinfo gettransferinfo(); unsigned long getuint32property(in string propertyname, in unsigned long defaultvalue); void initfromtransferinfo(in nsidbfolderinfo transferinfo); long orflags(in long flags); void setbooleanproperty(in string propertyname, in boolean apropertyvalue); void setcharacterset(in string charset); void setcharactersetoverride(in boolean charactersetoverride); obsolete since gecko 1.8 void setcharptrproperty(in string apropertyname, in string apropertyvalue); void sethighwater(in nsmsgkey highwater, in boolean force); ...
... void setlocale(in nsstring locale); native code only!
...And 10 more matches
nsIMessenger
method overview void setdisplaycharset(in acstring acharset); void setwindow(in nsidomwindow ptr, in nsimsgwindow msgwindow); void openurl(in acstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredo...
...transactiontype(); void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocumentcharset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring amsgfilename); void openattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, si...
... methods setdisplaycharset() sets the character set for the displayed message.
...And 10 more matches
Examine and edit CSS - Firefox Developer Tools
you can: toggle pseudo-classes; toggle classes; add a new rule; change the display based on the color scheme preference (as of firefox 72, you must set devtools.inspector.color-scheme-simulation.enabled to true in the configuration editor to enable this feature); change the display based on print media rules.
... to view user-agent styles (i.e., browser-default css rules), enable "inspector > show browser styles" under the developer tool settings panel.
... (note that this setting is independent of the "browser styles" checkbox in the computed view.) user-agent styles are displayed against a different background, and the link to the filename and line number contains the prefix (user agent): element {} rule the element {} rule at the top of the rules list isn't actually a css rule.
...And 10 more matches
about:debugging - Firefox Developer Tools
when about:debugging opens, on the left-hand side, you'll see a sidebar with two options and information about your remote debugging setup: setup use the setup tab to configure the connection to your remote device.
... if your about:debugging page is different from the one displayed here, go to about:config, find and set the option devtools.aboutdebugging.new-enabled to true.
... setup tab connecting to a remote device firefox supports debugging over usb with android devices, using the about:debugging page.
...And 10 more matches
Using the CSS Painting API - Web APIs
registerpaint('headerhighlight', class { /* define if alphatransparency is allowed alpha is set to true by default.
... if set to false, all colours used on the canvas will be fully opaque */ static get contextoptions() { return { alpha: true }; } /* ctx is the 2d drawing context a subset of the html5 canvas api.
...the 2d rendering context is a subset of the html5 canvas api; the version available to houdini (called the paintrenderingcontext2d) is a further subset containing most of the features available in the full canvas api with the exception of the canvasimagedata, canvasuserinterface, canvastext, and canvastextdrawingstyles apis.
...And 10 more matches
Basic animations - Web APIs
save the canvas state if you're changing any setting (such as styles, transformations, etc.) which affect the canvas state and you want to make sure the original state is used each time a frame is drawn, you need to save that original state.
... scheduled updates first there's the window.setinterval(), window.settimeout(), and window.requestanimationframe() functions, which can be used to call a specific function over a set period of time.
... setinterval(function, delay) starts repeatedly executing the function specified by function every delay milliseconds.
...And 10 more matches
Transformations - Web APIs
the current values of the following attributes: strokestyle, fillstyle, globalalpha, linewidth, linecap, linejoin, miterlimit, linedashoffset, shadowoffsetx, shadowoffsety, shadowblur, shadowcolor, globalcompositeoperation, font, textalign, textbaseline, direction, imagesmoothingenabled.
...each time the restore() method is called, the last saved state is popped off the stack and all saved settings are restored.
... a save and restore canvas state example this example tries to illustrate how the stack of drawing states functions by drawing a set of consecutive rectangles.
...And 10 more matches
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
number_type 1 a result set containing a single number.
... string_type 2 a result set containing a single string.
... boolean_type 3 a result set containing a single boolean value.
...And 10 more matches
HTMLMarqueeElement - Web APIs
htmlmarqueeelement.behavior sets how the text is scrolled within the marquee.
... htmlmarqueeelement.bgcolor sets the background color through color name or hexadecimal value.
... htmlmarqueeelement.direction sets the direction of the scrolling within the marquee.
...And 10 more matches
Key Values - Web APIs
vk_modechange (0x1f) gdk_key_mode_switch (0xff7e) gdk_key_script_switch (0xff7e) qt::key_mode_switch (0x0100117e) keycode_switch_charset (95) "nextcandidate" the next candidate function key.
... keyboardevent.key value description virtual keycode windows mac linux android "hangulmode" the hangul (korean character set) mode key, which toggles between hangul and english entry modes.
... vk_oem_finish (0xf1) gdk_key_katakana (0xff26) qt::key_katakana (0x01001126) "romaji" [5] the romaji key; selects the roman character set.
...And 10 more matches
RTCPeerConnection - Web APIs
if it has not yet been set, this is null.peeridentity read only the read-only rtcpeerconnection property peeridentity returns a javascript promise that resolves to an rtcidentityassertion which contains a domstring identifying the remote peer.pendinglocaldescription read only the read-only property rtcpeerconnection.pendinglocaldescription returns an rtcsessiondescription object describing a pending configuration change fo...
...if this hasn't been set yet, this is null.sctp the read-only sctp property on the rtcpeerconnection interface returns an rtcsctptransport describing the sctp transport over which sctp data is being sent and received.
...the event is sent immediately after the call setremotedescription() and doesn't wait for the result of the sdp negotiation.onconnectionstatechangethe rtcpeerconnection.onconnectionstatechange property specifies an eventhandler which is called to handle the connectionstatechange event when it occurs on an instance of rtcpeerconnection.
...And 10 more matches
User Timing API - Web APIs
mark events are named by the application and can be set at any location in an application.
... the mark's performance entry will have the following property values: entrytype - set to "mark".
... name - set to the "name" given when the mark was created.
...And 10 more matches
Matrix math for the web - Web APIs
these matrices consist of a set of 16 values arranged in a 4x4 grid.
...for a typical position, setting w to 1 will make the math work out.
...able name to each part of the matrix, a column and row number let c0r0 = matrix[ 0], c1r0 = matrix[ 1], c2r0 = matrix[ 2], c3r0 = matrix[ 3]; let c0r1 = matrix[ 4], c1r1 = matrix[ 5], c2r1 = matrix[ 6], c3r1 = matrix[ 7]; let c0r2 = matrix[ 8], c1r2 = matrix[ 9], c2r2 = matrix[10], c3r2 = matrix[11]; let c0r3 = matrix[12], c1r3 = matrix[13], c2r3 = matrix[14], c3r3 = matrix[15]; // now set some simple names for the point let x = point[0]; let y = point[1]; let z = point[2]; let w = point[3]; // multiply the point against each part of the 1st column, then add together let resultx = (x * c0r0) + (y * c0r1) + (z * c0r2) + (w * c0r3); // multiply the point against each part of the 2nd column, then add together let resulty = (x * c1r0) + (y * c1r1) + (z * c1r2) + (w * ...
...And 10 more matches
WebRTC connectivity - Web APIs
it’s any sort of channel of communication to exchange information before setting up a connection, whether by email, post card or a carrier pigeon...
... the caller calls rtcpeerconnection.setlocaldescription() to set that offer as the local description (that is, the description of the local end of the connection).
... after setlocaldescription(), the caller asks stun servers to generate the ice candidates the caller uses the signaling server to transmit the offer to the intended receiver of the call.
...And 10 more matches
Migrating from webkitAudioContext - Web APIs
the example below shows old code which downloads an audio file over the network, and then decoded it using createbuffer(): var xhr = new xmlhttprequest(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { var decodedbuffer = context.createbuffer(xhr.response, false); if (decodedbuffer) { // decoding was successful, do something useful with the audio buffer } else { alert("decoding the audio buffer failed"); } }; converting this code to use decodeaudiodata() is relatively simple, as can be seen below: var xhr = new xmlhttp...
...request(); xhr.open("get", "/path/to/audio.ogg", true); xhr.responsetype = "arraybuffer"; xhr.send(); xhr.onload = function() { context.decodeaudiodata(xhr.response, function onsuccess(decodedbuffer) { // decoding was successful, do something useful with the audio buffer }, function onfailure() { alert("decoding the audio buffer failed"); }); }; note that the decodeaudiodata() method is asynchronous, which means that it will return immediately, and then when the decoding finishes, one of the success or failure callback functions will get called depending on whether the audio decoding was successful.
... renaming of audioparam.settargetvalueattime the settargetvalueattime() method on the audioparam interface has been renamed to settargetattime().
...And 10 more matches
Logical properties for floating and positioning - CSS: Cascading Style Sheets
logical property or value physical property or value float: inline-start float: left float: inline-end float: right clear: inline-start clear: left clear: inline-end clear: right inset-inline-start left inset-inline-end right inset-block-start top inset-block-end bottom text-align: start text-align: left text-align: end text-align: right in addition to these mapped properties there are some additional shorthand properties made possible by being able to address block and inline dimensions.
... these have no mapping to physical properties, aside from the inset property.
... logical property purpose inset-inline sets both of the above inset values for the inline dimension simultaneously.
...And 10 more matches
Audio and Video Delivery - Developer guides
rting browsers goes here --> <a href="audiofile.mp3">download audio</a> <object width="320" height="30" type="application/x-shockwave-flash" data="flashmediaelement.swf"> <param name="movie" value="flashmediaelement.swf" /> <param name="flashvars" value="controls=true&isvideo=false&file=audiofile.mp3" /> </object> </audio> the process is very similar with video — just remember to set isvideo=true in the flashvars value parameters.
... javascript audio var myaudio = document.createelement('audio'); if (myaudio.canplaytype('audio/mpeg')) { myaudio.setattribute('src','audiofile.mp3'); } else if (myaudio.canplaytype('audio/ogg')) { myaudio.setattribute('src','audiofile.ogg'); } myaudio.currenttime = 5; myaudio.play(); we set the source of the audio depending on the type of audio file the browser supports, then set the play-head 5 seconds in and attempt to play it.
... javascript video var myvideo = document.createelement('video'); if (myvideo.canplaytype('video/mp4')) { myvideo.setattribute('src','videofile.mp4'); } else if (myvideo.canplaytype('video/webm')) { myvideo.setattribute('src','videofile.webm'); } myvideo.width = 480; myvideo.height = 320; we set the source of the video depending on the type of video file the browser supports we then set the width and height of the video.
...And 10 more matches
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
value a domstring representing a password, or empty events change and input supported common attributes autocomplete, inputmode, maxlength, minlength, pattern, placeholder, readonly, required, and size idl attributes selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), and setselectionrange() value the value attribute contains a domstring whose value is the current contents of the text editing control being used to enter the password.
...when setting the value of a password control, line feed and carriage return characters are stripped out of the value.
...its value can, however, still be changed from javascript code that directly sets the value of the htmlinputelement.value property.
...And 10 more matches
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
a “simple request” is one that meets all the following conditions: one of the allowed methods: get head post apart from the headers automatically set by the user agent (for example, connection, user-agent, or the other headers defined in the fetch spec as a “forbidden header name”), the only headers which are allowed to be manually set are those which the fetch spec defines as a “cors-safelisted request-header”, which are: accept accept-language content-language content-type (but note the additional requirements below) dpr ...
... the following is an example of a request that will be preflighted: const xhr = new xmlhttprequest(); xhr.open('post', 'https://bar.other/resources/post-here/'); xhr.setrequestheader('x-pingother', 'pingpong'); xhr.setrequestheader('content-type', 'application/xml'); xhr.onreadystatechange = handler; xhr.send('<person><name>arun</name></person>'); the example above creates an xml body to send with the post request.
... also, a non-standard http x-pingother request header is set.
...And 10 more matches
JavaScript data types and data structures - JavaScript
special non-data but structural type for any constructed object instance also used as data structures: new object, new array, new map, new set, new weakmap, new set, new date and almost everything made with new keyword; function : a non-data structure, though it also answers for typeof operator: typeof instance === "function".
...javascript offers other means to represent a set of booleans (like an array of booleans, or an object with boolean values assigned to named properties).
...it is a set of "elements" of 16-bit unsigned integer values.
...And 10 more matches
Inheritance and the prototype chain - JavaScript
since ecmascript 2015, the [[prototype]] is accessed using the accessors object.getprototypeof() and object.setprototypeof().
... here is what happens when trying to access a property: // let's create an object o from function f with its own properties a and b: let f = function () { this.a = 1; this.b = 2; } let o = new f(); // {a: 1, b: 2} // add properties in f function's prototype f.prototype.b = 3; f.prototype.c = 4; // do not set the prototype f.prototype = {b:3,c:4}; this will break the prototype chain // o.[[prototype]] has properties b and c.
... code link setting a property to an object creates an own property.
...And 10 more matches
Codecs used by WebRTC - Web media technologies
supported video codecs webrtc establishes a baseline set of codecs which all compliant browsers are required to support.
...cb is a subset of the main profile, and is specifically designed for low-complexity, low-delay applications such as mobile video and videoconferencing, as well as for platforms with lower performing video processing capabilities.
...sometimes it means requiring a specific value for a parameter, or that a specific set of values be allowed.
...And 10 more matches
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
each individual value can be one of the following : <offset-value>, <syncbase-value>, <event-value>, <repeat-value>, <accesskey-value>, <wallclock-sync-value> or the keyword indefinite.
... six elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <discard>, and <set> animate, animatecolor, animatemotion, animatetransform, set for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>, begin defines when the element should begin, i.e.
...each value can be one of the following: <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event).
...And 10 more matches
Same-origin policy - Web security
(a "tuple" is a set of items that together comprise a whole — a generic form for double/triple/quadruple/quintuple/etc.) the following table gives examples of origin comparisons with the url http://store.company.com/dir/page.html: url outcome reason http://store.company.com/dir2/other.html same origin only the path differs http://store.company.com/dir/inner/another.html ...
...a script can set the value of document.domain to its current domain or a superdomain of its current domain.
... if set to a superdomain of the current domain, the shorter superdomain is used for same-origin checks.
...And 10 more matches
XUL accessibility guidelines - Archive of obsolete content
it can also be set programmatically with the tabindex attribute if needed, but this should be done sparingly and thoroughly tested whenever it is used.
... careful attention should be taken when setting keyboard shortcuts.
...refer to the following resources when setting keyboard shortcuts.
...And 9 more matches
wizard - Archive of obsolete content
windowtype type: string set to a string which can be used to identify the type of window.
... values for window type as found on mxr: http://mxr.mozilla.org/mozilla-release/search?string=windowtype navigator:browser - looks like if window has gbrowser it has this window type devtools:scratchpad - scratchpad windows navigator:view-source - the view source windows properties canadvance type: boolean this property is set to true if the user can press the next button to go to the next page.
...set this property to true to indicate that the user can go to the next page.
...And 9 more matches
Advanced text formatting - Learn web development
the purpose of these lists is to mark up a set of items and their associated descriptions, such as terms and definitions, or questions and answers.
... let's look at an example of a set of terms and definitions: soliloquy in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relaying them to the audience (but not to other characters.) monologue in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present.
...this is usually a feeling, thought, or piece of additional background information.</dd> <dd>in writing, a section of content that is related to the current topic, but doesn't fit directly into the main flow of content so is presented nearby (often in a box off to the side.)</dd> </dl> active learning: marking up a set of definitions it's time to try your hand at description lists; add elements to the raw text in the input field so that it appears as a description list in the output field.
...And 9 more matches
Getting started with React - Learn web development
we'll discover a little bit of detail about its background and use cases, set up a basic react toolchain on our local computer, and create and play with a simple starter app — learning a bit about how react works in the process.
... objective: to set up a local react development environment, create a start app, and understand the basics of how it works hello react as its official tagline states, react is a library for building user interfaces.
...this allows teams to set conventions that work best for them, and to adopt react in any way they would like to.
...And 9 more matches
Strategies for carrying out testing - Learn web development
setting up google analytics first of all, you'll need a google account.
...this is fairly intuitive to set up; the most important field to get right is the website url.
... these test criteria are useful, because: they give you a set of steps to follow when you are performing tests.
...And 9 more matches
Profiling with the Firefox Profiler
set devtools.debugger.remote-enabled to true in about:config for fennec.
... profiling firefox startup start your firefox with the environment variable moz_profiler_startup=1 set.
... startup profiling does not use the settings that you configured in the add-on's panel.
...And 9 more matches
An overview of NSS Internals
nss ships a predefined set of ca certificates.
... this set, including their trust assignments, is provided by nss as a software module, called ckbi (“built-in root certificates”), which also implements the pkcs#11 interface.
... on an organizational level the contents of the set are managed according to the mozilla ca policy.
...And 9 more matches
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
if i don't call setcipherpolicy, is the domestic policy used by default?
... the using jss document describes how to set up your environment to run jss.
...lla/jss/tests/closedbs.java org/mozilla/jss/tests/keyfactorytest.java org/mozilla/jss/tests/digesttest.java org/mozilla/jss/tests/jcasigtest.java org/mozilla/jss/tests/keywrapping.java org/mozilla/jss/tests/listcerts.java org/mozilla/jss/tests/pk10gen.java org/mozilla/jss/tests/sdr.java org/mozilla/jss/tests/selftest.java org/mozilla/jss/tests/setupdbs.java org/mozilla/jss/tests/sigtest.java org/mozilla/jss/tests/symkeygen.java org/mozilla/jss/tests/testkeygen.java org/mozilla/jss/tests/sslclientauth.java org/mozilla/jss/tests/listcacerts.java org/mozilla/jss/tests/keystoretest.java org/mozilla/jss/tests/verifycert.java ssl examples: org/mozilla/jss/tests/sslclientauth.java org/mozill...
...And 9 more matches
Build instructions
make variables may be set on the gmake command line, e.g., gmake variable=value variable=value target1 target2 or defined in the environment, e.g.
... (for posix shells), variable=value; export variable gmake target1 target2 here are some (not all) of the make variables that affect nss builds: build_opt: if set to 1, means do optimized non-debug build.
... use_debug_rtl: if set to 1, on windows, causes build with debug version of the c run-time library.
...And 9 more matches
NSS Tools certutil
when specifying an offset time, use "yymmddhhmmss+hhmm" or "yymmddhhmmss-hhmm".
... -g keysize set a key size to use when generating new public and private key pairs.
...rusted ca to issue client certificates (implies c) c trusted ca to issue server certificates (ssl only) (implies c) u certificate can be used for authentication or signing w send warning (use with other attributes to include a warning when the certificate is used in that context) the attribute codes for the categories are separated by commas, and the entire set of attributes enclosed by quotation marks.
...And 9 more matches
Property attributes
any object property can have zero or more property attributes set.
... an application can set property attributes when creating a property.
... mxr id search for jsprop_enumerate jsprop_readonly the property's value cannot be set.
...And 9 more matches
Animated PNG graphics
MozillaTechAPNG
fully transparent black means red, green, blue and alpha components are all set to zero.
... the 'actl' chunk contains: byte offset field name field type description 0 num_frames unsigned int the number of frames in the apng.
... byte offset field name field type description 0 sequence_number unsigned int sequence number of the animation chunk, starting with 0.
...And 9 more matches
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
primitive input streams type native class contract id interface how to bind to a data source generic nsstorageinputstream n/a nsiinputstream, nsiseekablestream storagestream.newinputstream(); string (8-bit characters) nsstringstream @mozilla.org/io/string-input-stream;1 nsistringinputstream stream.setdata(data, length); file nsfileinputstream @mozilla.org/network/file-input-stream;1 nsifileinputstream stream.init(file, ioflags, perm, behaviorflags); zip nsjarinputstream n/a nsiinputstream zipreader.getinputstream(zipentry); similarly, each of these implements nsioutputstream.
... you can get an nsichannel object from the io service's newchannel(spec, charset, baseuri) method or its .newchannelfromuri(uri) method.
...stream: var outstream = components.classes["@mozilla.org/storagestream;1"] .createinstance(components.interfaces.nsistoragestream) .getoutputstream(); var instream = components.classes["@mozilla.org/io/string-input-stream;1"] .createinstance(components.interfaces.nsistringinputstream); var data = "hello world"; instream.setdata(data, data.length); while (instream.available()) { outstream.writefrom(instream, instream.available()); } note this is an inefficient example: the only important part is how to feed the output stream.
...And 9 more matches
imgIContainer
void init(in print32 awidth, in print32 aheight, in imgicontainerobserver aobserver); obsolete since gecko 2.0 void lockimage(); void removeframe(in gfxiimageframe item); obsolete since gecko 1.9.2 void requestdecode(); void requestdiscard(); void requestrefresh([const] in timestamp atime); violates the xpcom interface guidelines void resetanimation(); void restoredatadone(); native code only!
... obsolete since gecko 2.0 void setdiscardable(in string amimetype); native code only!
... obsolete since gecko 2.0 void setframeblendmethod(in unsigned long framenumber, in print32 ablendmethod); obsolete since gecko 2.0 void setframedisposalmethod(in unsigned long framenumber, in print32 adisposalmethod); obsolete since gecko 2.0 void setframehasnoalpha(in unsigned long framenumber); obsolete since gecko 2.0 void setframetimeout(in unsigned long framenumber, in print32 atimeout); obsolete since gecko 2.0 void startanimation(); obsolete since gecko 2.0 void stopanimation(); obsolete since gecko 2.0 void unlockimage(); attributes attribute type description animated boolean whether this image is animated.
...And 9 more matches
mozIAsyncFavicons
method overview void getfaviconurlforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void getfavicondataforpage(in nsiuri apageuri, in nsifavicondatacallback acallback); void setandfetchfaviconforpage(in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, [optional] in nsifavicondatacallback acallback); void replacefavicondata(in nsiuri afaviconuri, [const,array,size_is(adatalen)] in octet adata, in unsigned long adatalen, in autf8string amimetype, [optional] in prtime aexpiration); void repl...
... setandfetchfaviconforpage() declares that a given page uses a favicon with the given uri and attempts to fetch and save the icon data by loading the favicon uri through a asynchronous network request.
... note: this function is identical to nsifaviconservice.setandloadfaviconforpage() void setandfetchfaviconforpage( in nsiuri apageuri, in nsiuri afaviconuri, in boolean aforcereload, in unsigned long afaviconloadtype, in nsifavicondatacallback acallback optional ); parameters apageuri uri of the page whose favicon is being set.
...And 9 more matches
nsICookiePermission
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nscookieaccess canaccess(in nsiuri auri, in nsichannel achannel); boolean cansetcookie(in nsiuri auri, in nsichannel achannel, in nsicookie2 acookie, inout boolean aissession, inout print64 aexpiry); nsiuri getoriginatinguri(in nsichannel achannel); void setaccess(in nsiuri auri, in nscookieaccess aaccess); constants constant value description access_default 0 nscookieaccess's access default value access_allow 1 nscookieaccess's access allow value access_deny 2 nscookieaccess's access deny value access_session 8 add...
... methods canaccess() tests whether or not the given uri/channel may access the cookie database, either to set or get cookies.
...cansetcookie() tests whether or not the given uri/channel may set a specific cookie.
...And 9 more matches
nsICookieService
netwerk/cookie/public/nsicookieservice.idlscriptable provides methods for setting and getting cookies in the context of a page load.
... batch-deleted a set of cookies were deleted as part of a purge operation.
... cookie-rejected broadcast whenever the user's preferences cause a cookie to be rejected from being set.
...And 9 more matches
nsIDOMElement
name); nsidomnodelist getelementsbytagnamens(in domstring namespaceuri, in domstring localname); boolean hasattribute(in domstring name); boolean hasattributens(in domstring namespaceuri, in domstring localname); void removeattribute(in domstring name) nsidomattr removeattributenode(in nsidomattr oldattr) void removeattributens(in domstring namespaceuri, in domstring localname) void setattribute(in domstring name, in domstring value) nsidomattr setattributenode(in nsidomattr newattr) nsidomattr setattributenodens(in nsidomattr newattr) void setattributens(in domstring namespaceuri, in domstring qualifiedname, in domstring value) attributes attribute type description tagname domstring the element tag name.
...hasattribute() check if the element have this attribute set.
... boolean hasattribute( in domstring name ); parameters name attribute name return value a boolean, true if the given attribute is set.
...And 9 more matches
nsILocalFile
void reveal(); void setrelativedescriptor(in nsilocalfile fromfile, in acstring relativedesc); attributes attribute type description diskspaceavailable print64 the number of bytes available to non-superuser on the disk volume containing the nsilocalfile.
...must be in the native file system character set.
... the result returned from this method may be used with setrelativedescriptor() to initialize a nsilocalfile instance.
...And 9 more matches
nsIPrintingPrompt
returning ns_ok assumes that the printsettings object was correctly filled in and if it does not have valid fields for printer name, and so on.
... defaults for platform service: showprintdialog - displays a native dialog showpagesetup() - displays a xul dialog showprogress() - displays a xul dialog summary for windows embedders: stated once again: there is no "fallback" native platform support in gfx for the displaying of the native print dialog.
...you can then fly you own dialog and then properly fill in the printsettings object before calling nsiwebbrowserprint's print method.
...And 9 more matches
nsISHEntry
boolean hasdetachededitor(); violates the xpcom interface guidelines boolean hasdynamicallyaddedchild(); boolean isdynamicallyadded(); void seteditordata(in nsdocshelleditordataptr adata); violates the xpcom interface guidelines void setissubframe(in boolean aflag); void setscrollposition(in long x, in long y); void settitle(in astring atitle); void setuniquedocidentifier(); void seturi(in nsiuri auri); void setviewerbounds(in nsintrect bounds); native code only!
... void syncpresentationstate(); attributes attribute type description cachekey nsisupports set and get the cache key for the entry.
... statedata nsistructuredclonecontainer get/set data associated with this history state via a pushstate() call, serialized using structured clone.
...And 9 more matches
nsIXPCScriptable
for example, callers must guarantee that they set the *_retval of the various methods that return a boolean to pr_true before making the call.
...j); prbool addproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool delproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool getproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool setproperty(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in jsval id, in jsvalptr vp); prbool enumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); prbool newenumerate(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj, in pruint32 enum_op, in jsvalptr statep, out jsid idp); prbool newresolve(in nsixpc...
...l val); jsobjectptr outerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); jsobjectptr innerobject(in nsixpconnectwrappednative wrapper, in jscontextptr cx, in jsobjectptr obj); void postcreateprototype(in jscontextptr cx, in jsobjectptr proto); attributes attribute type description classname string scriptableflags pruint32 the bitwise or'd set of flags (define below) that indicate the behavior of this object.
...And 9 more matches
Network request list - Firefox Developer Tools
you can override this behavior by checking "enable persistent logs" in the settings.
...a reset columns command is available on the context menu to reset the columns to their initial configuration.
...you can drag to manually set the size of column.
...And 9 more matches
Using dynamic styling information - Web APIs
to modify styles to a document using css syntax, one can insert rules or insert <style> tags whose innerhtml property is set to the desired css.
... modify an element's style the element style property (see also the section "dom style object" below) can also be used to get and set the styles on an element.
... however, this property only returns style attributes that have been set in-line (e.g, <td style="background-color: lightblue"> returns the string "background-color:lightblue", or directly for that element using element.style.propertyname, even though there may be other styles on the element from a stylesheet).
...And 9 more matches
Using Fetch - Web APIs
instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the request from completing.
...set-cookie headers from other sites are silently ignored.
... fetch won’t send cookies, unless you set the credentials init option.
...And 9 more matches
Fullscreen API - Web APIs
dictionaries fullscreenoptions provides optional settings you can specify when calling requestfullscreen().
... view live examples watching for the enter key when the page is loaded, this code is run to set up an event listener to watch for the enter key.
...alternate name alternate name uses the non-standard name: webkitisfullscreenfirefox full support 64 full support 64 no support 49 — 65disabled disabled from version 49 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true).
...And 9 more matches
HTMLElement - Web APIs
htmlorforeignelement.dataset read only returns a domstringmap with which script can read and write the element's custom data attributes (data-*) .
... htmlelement.dropzone read only returns a domsettabletokenlist reflecting the dropzone global attribute and describing the behavior of the element regarding a drop operation.
... htmlelement.itemtype read only returns a domsettabletokenlist… htmlelement.itemid is a domstring representing the item id.
...And 9 more matches
Dragging and Dropping Multiple Items - Web APIs
caution: all of the methods and properties with a moz prefix (such as mozsetdataat() are gecko specific interfaces.
...these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the index of the item to retrieve, modify or remove.
... setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event.
...And 9 more matches
Recommended Drag Types - Web APIs
caution: all methods and properties in this document with a moz prefix, such as mozsetdataat(), will only work with gecko-based browsers.
...for example: event.datatransfer.setdata("text/plain", "this is text to drag"); dragging text in textboxes and selections on web pages is done automatically by the browser, so you do not need to handle it yourself.
...for example: var dt = event.datatransfer; dt.setdata("text/uri-list", "https://www.mozilla.org"); dt.setdata("text/plain", "https://www.mozilla.org"); as usual, set the text/plain type last, as a fallback for the text/uri-list type.
...And 9 more matches
KeyboardEvent() - Web APIs
keyboardeventinitoptional is a keyboardeventinit dictionary, having the following fields: "key", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.key.
... "code", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.code.
... "location", optional and defaulting to 0, of type unsigned long, that sets the value of keyboardevent.location.
...And 9 more matches
Recording a media element - Web APIs
notice that the playback panel doesn't have autoplay set (so the playback doesn't start as soon as media arrives), and it has controls set, which tells it to show the user controls to play, pause, and so forth.
... setting up global variables we start by establishing some global variables we'll need.
...the last, recordingtimems, is set to 5000 milliseconds (5 seconds); this specifies the length of the videos we'll record.
...And 9 more matches
Taking still photos with WebRTC - Web APIs
initialization we start by wrapping the whole script in an anonymous function to avoid global variables, then setting up various variables we'll be using.
... video.addeventlistener('canplay', function(ev){ if (!streaming) { height = video.videoheight / (video.videowidth/width); video.setattribute('width', width); video.setattribute('height', height); canvas.setattribute('width', width); canvas.setattribute('height', height); streaming = true; } }, false); this callback does nothing unless it's the first time it's been called; this is tested by looking at the value of our streaming variable, which is false the first time this method is ru...
... if this is indeed the first run, we set the video's height based on the size difference between the video's actual size, video.videowidth, and the width at which we're going to render it, width.
...And 9 more matches
Using the Web Speech API - Web APIs
speechrecognitionlist.addfromstring(grammar, 1); we then add the speechgrammarlist to the speech recognition instance by setting it to the value of the speechrecognition.grammars property.
... we also set a few other properties of the recognition instance before we move on: speechrecognition.continuous: controls whether continuous results are captured (true), or just a single result each time recognition is started (false).
... speechrecognition.lang: sets the language of the recognition.
...And 9 more matches
Using the Web Storage API - Web APIs
you can access these values like an object, or with the storage.getitem() and storage.setitem() methods.
... these three lines all set the (same) colorsetting entry: localstorage.colorsetting = '#a4509b'; localstorage['colorsetting'] = '#a4509b'; localstorage.setitem('colorsetting', '#a4509b'); note: it's recommended to use the web storage api (setitem, getitem, removeitem, key, length) to prevent the pitfalls associated with using plain objects as key-value stores.
...these mechanisms are available via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties are members of) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved, and removed.
...And 9 more matches
ARIA: grid role - Accessibility
aria-multiselectable if aria-multiselectable is set to true, multiple items in the grid can be selected.
... aria-readonly if the user can navigate the grid but not change the value or values of the grid, the aria-readonly should be set to true.
... page down moves focus down an author-determined number of rows, typically scrolling so the bottom row in the currently visible set of rows becomes one of the first visible rows.
...And 9 more matches
ARIA: listbox role - Accessibility
all selected options have aria-selected set to true.
... all options that are not selected have aria-selected set to false.
... aria-multiselectable include and set to true if the user can select more than one option.
...And 9 more matches
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
in this next example, i have a set of floated cards.
... as a concession for older browsers, i have set a min-height on the items, and hope that my content editors won’t add too much content and make a mess of the layout!
...however, the width i have assigned to the list items themselves still applies, and it now makes those items a third of the width of the track: if i reset the width to auto, then this will stop the float behavior happening for older browsers.
...And 9 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
to round off this set of guides to css grid layout, i am going to walk through a few different layouts, which demonstrate some of the different techniques you can use when designing with grid layout.
...as you can see from this set of examples, there is often more than one way to achieve the result you want with grid layout.
...staying outside of any media queries i am now going to set up the layout for the mobile width.
...And 9 more matches
border - CSS: Cascading Style Sheets
WebCSSborder
the border shorthand css property sets an element's border.
... it sets the values of border-width, border-style, and border-color.
... constituent properties this property is a shorthand for the following css properties: border-color border-style border-width syntax /* style */ border: solid; /* width | style */ border: 2px dotted; /* style | color */ border: outset #f33; /* width | style | color */ border: medium dashed green; /* global values */ border: inherit; border: initial; border: unset; the border property may be specified using one, two, or three of the values listed below.
...And 9 more matches
clamp() - CSS: Cascading Style Sheets
WebCSSclamp
note that using clamp() for font sizes, as in these examples, allows you to set a font-size that grows with the size of the viewport, but doesn't go below a minimum font-size or above a maximum font-size.
... the <body> element's width is set as min(1000px, calc(70% + 100px)).
... this means that the width will be set at 1000px, unless the result of calc(70% + 100px) is less than 1000px, in which case it will be set to that value instead.
...And 9 more matches
revert - CSS: Cascading Style Sheets
WebCSSrevert
thus, it resets the property to its inherited value if it inherits from its parent or to the default value established by the user agent's stylesheet (or by user styles, if any exist).
... if used within the user agent's default styles, this keyword is functionally equivalent to unset.
... the revert keyword works exactly the same as unset in many cases.
...And 9 more matches
transform-origin - CSS: Cascading Style Sheets
the transform-origin css property sets the origin for an element's transformations.
... syntax /* one-value syntax */ transform-origin: 2px; transform-origin: bottom; /* x-offset | y-offset */ transform-origin: 3cm 2px; /* x-offset-keyword | y-offset */ transform-origin: left 2px; /* x-offset-keyword | y-offset-keyword */ transform-origin: right top; /* y-offset-keyword | x-offset-keyword */ transform-origin: top right; /* x-offset | y-offset | z-offset */ transform-origin: 2px 30% 10px; /* x-offset-keyword | y-offset | z-offset */ transform-origin: left 5px -3px; /...
...* x-offset-keyword | y-offset-keyword | z-offset */ transform-origin: right bottom 2cm; /* y-offset-keyword | x-offset-keyword | z-offset */ transform-origin: bottom right 2cm; /* global values */ transform-origin: inherit; transform-origin: initial; transform-origin: unset; the transform-origin property may be specified using one, two, or three values, where each value represents an offset.
...And 9 more matches
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
you can set a default value for the input by including a valid time in the value attribute when creating the <input> element, like so: <label for="appt-time">choose an appointment time: </label> <input id="appt-time" type="time" name="appt-time" value="13:30"> you can also get and set the date value in javascript using the htmlinputelement.value property, for example: var timecontrol = document.queryse...
...if the specified string isn't a valid time, no maximum value is set.
...if the value specified isn't a valid time string, no minimum value is set.
...And 9 more matches
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmarquee
dom interface htmlmarqueeelement attributes behavior sets how the text is scrolled within the marquee.
... bgcolor sets the background color through color name or hexadecimal value.
... direction sets the direction of the scrolling within the marquee.
...And 9 more matches
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
permitted parents <meta charset>, <meta http-equiv>: a <head> element.
... implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmetaelement the type of metadata provided by the meta element can be one of the following: if the name attribute is set, the meta element provides document-level metadata, applying to the whole page.
... if the http-equiv attribute is set, the meta element is a pragma directive, providing information equivalent to what can be given by a similarly-named http header.
...And 9 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
however, this can be useful when creating media elements whose source will be set at a later time, under user control.
... controlslist the controlslist attribute, when specified, helps the browser select what controls to show on the media element whenever the browser shows its own set of controls (e.g.
...if the server does not give credentials to the origin site (by not setting the access-control-allow-origin: http header), the image will be tainted, and its usage restricted.
...And 9 more matches
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
it groups a set of <h1>–<h6> elements.
... <i> the html idiomatic text element (<i>) represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others.
... <tbody> the html table body element (<tbody>) encapsulates a set of table rows (<tr> elements), indicating that they comprise the body of the table (<table>).
...And 9 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
autoplay availability as a general rule, you can assume that media will be allowed to autoplay only if at least one of the following is true: the audio is muted or its volume is set to 0 the user has interacted with the site (by clicking, tapping, pressing keys, etc.) if the site has been whitelisted; this may happen either automatically if the browser determines that the user engages with media frequently, or manually through preferences or other user interface features if the autoplay feature policy is used to grant autoplay support to an <iframe> and its document.
...this sets the autoplay property on the element to true, and when autoplay is true, the media will automatically begin to play as soon as possible after the following have occurred: the page is allowed to use autoplay functionality the element has been created during page load enough media has been received to begin playback and continue to play through to the end of the media without interruption, as...
...nor is there an exception thrown or a callback you can set up or even a flag on the media element that tells you if autoplay worked.
...And 9 more matches
dev/panel - Archive of obsolete content
you can set the constructor up manually if you like, or you can use the add-on sdk core/heritage module to simplify the mechanics of inheriting from panel.
... you can use the class utility function: const { panel } = require("dev/panel"); const { class } = 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: "...", ....
... optional setup function a function that will be called when the panel is created.
...And 8 more matches
JavaScript timers - Archive of obsolete content
but there are some javascript native functions (timers) which allow us to delay the execution of arbitrary instructions: settimeout() setinterval() setimmediate() requestanimationframe() the settimeout() function is commonly used if you wish to have your function called once after the specified delay.
... the setinterval() function is commonly used to set a delay for functions that are executed again and again, such as animations.
... the setimmediate() function can be used instead of the settimeout(fn, 0) method to execute heavy operations in ie.
...And 8 more matches
Adding Events and Commands - Archive of obsolete content
for example: <button label="&xulschoolhello.defaultgreeting.label;" oncommand="xulschoolchrome.browseroverlay.changegreeting(event);" /> then on the javascript code you would have something like this: changegreeting : function(aevent) { // more stuff aevent.target.setattribute("label", somenewgreeting); } the target in this example is the button element, so clicking on it will change its text.
... first you need to add a broadcaster element to your xul code, as a child of a broadcasterset element.
... <broadcasterset id="xulschoolhello-broadcasterset"> <broadcaster id="xulschoolhello-online-broadcaster" /> </broadcasterset> these elements are completely invisible, so you can put them anywhere.
...And 8 more matches
Custom XUL Elements with XBL - Archive of obsolete content
person.setattribute("name", name); person.setattribute("greeting", greeting); // ...
...}, this is where the advantage of xbl is obvious: we only need to create a single node and set some attributes.
... the xbl:inherits attribute lets your inner xul use the attributes that are set on the node.
...And 8 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
changing default search setting from extensions many add-ons, for monetization or other reasons, change several search-related settings at install time.
...due to the large volume of user complaints regarding hidden settings being changed against their will, and not being restored after the add-ons responsible are disabled, mozilla will take any steps necessary to mitigate the impact of offending add-ons.
... in particular, changing the location bar search keyword url in a way which is not automatically reset when the add-on is removed will result in a reset prompt for users.
...And 8 more matches
Index of archived content - Archive of obsolete content
s javascript daemons management label and description lookupnamespaceuri lookupprefix miscellaneous modules on page load page loading post data to window preferences progress listeners queryselector rosetta running applications svg animation svg general scrollbar sidebar stringview tabbox toolbar tree uri parsing view source for xul applications windows xml-related code snippets xml:base support in old ...
...tensions and themes from web pages interaction between privileged and non-privileged pages jetpack processes legacy add-ons legacy extensions for firefox for android api accounts.jsm browserapp addtab closetab deck getbrowserfordocument getbrowserforwindow gettabforbrowser gettabforid gettabforwindow loaduri quit selecttab tabs helperapps.jsm home.jsm ...
... connecting to remote content custom xul elements with xbl getting started with firefox extensions handling preferences intercepting page loads introduction javascript object management local storage mozilla documentation roadmap observer notifications setting up a development environment the box model the essentials of an extension useful mozilla community sites user notifications and alerts xpcom objects performance best practices in extensions search extension tutorial (draft) security best practic...
...And 8 more matches
Monitoring downloads - Archive of obsolete content
setting up when the extension loads, it will do some housekeeping chores.
... the end time and download speed // are both set to 0 at first, since we don't know those yet.
....opendatabase(this.dbfile); statement = dbconn.createstatement("replace into items values " + "(?1, ?2, ?3, 0, 0.0, 0)"); statement.bindstringparameter(0, adownload.source.spec); statement.bindint64parameter(1, adownload.size); statement.bindint64parameter(2, adownload.starttime); statement.execute(); statement.reset(); dbconn.close(); break; // record the completion (whether failed or successful) of the download case components.interfaces.nsidownloadmanager.download_finished: case components.interfaces.nsidownloadmanager.download_failed: case components.interfaces.nsidownloadmanager.download_canceled: this.logtransfercompleted(adownload); break; } }, we...
...And 8 more matches
Building accessible custom components in XUL - Archive of obsolete content
(the firefox interface itself is built in xul, as well as the graphical interface presented by firefox extensions.) xul itself has a much richer set of built-in controls than html.
...(technically, it draws the border inside the element instead of outside.) <code> grid.spreadsheet description:focus, grid.spreadsheet label:focus { outline: 1px dotted black; outline-offset: -2px; } </code> however, neither of those are our biggest problem.
...we need to set the containing grid to be focusable, which will put the spreadsheet itself in the tab order.
...And 8 more matches
OpenClose - Archive of obsolete content
the menu element has an open property which may be set to true to open the menu, or false to close the menu.
... a menu may be closed by a script by setting the open property to false, the reverse of what would be done to open the menu.
...if both menus are open and the open property on the submenu is set to false, the submenu will close, yet the parent file menu will remain open.
...And 8 more matches
Element Positioning - Archive of obsolete content
note that the css global skin of the xul application may also specify a min-width for the buttons and other elements, thus if simply setting the width property does not set the button width as you expect, try also to modify the button min-width property.
... by setting either of the two properties, the element will be created with that width and height.
... flexible elements are those that have a flex attribute set to a value greater than 0.
...And 8 more matches
Using the Editor from XUL - Archive of obsolete content
now we set up the editorshell by calling its init() method, telling it what type of editor we want (text or html), pointing it at the webshellwindow to use, and telling it the content node that it lives on: editorshell.init(); editorshell.seteditortype(editortype); editorshell.webshellwindow = window; editorshell.contentwindow = window._content; the webshellwindow (a settable attribute on nsieditorshe...
... the contentwindow (another settable attribute on nsieditorshell) points to the xul element which is to become editable.
... editorstartup() does some other minor bits of setup before finally kicking off the url load, which the most important part here.
...And 8 more matches
The Implementation of the Application Object Model - Archive of obsolete content
the html content tree structure for a single document is represented as a set of objects that can be accessed and manipulated.
...in a similar fashion, xul's content tree for a single window is represented as a set of objects that can be accessed and manipulated.
...if xul is dropped from the picture, then dialogs would have to be described using native widgetry (unless you're willing to design an html dialog system, which still wouldn't cut it without extending html), and communicator would have to ship with both widget sets.
...And 8 more matches
label - Archive of obsolete content
ArchiveMozillaXULlabel
attributes accesskey, control, crop, disabled, href, value properties accesskey, accessibletype, control, crop, disabled, value style classes header, indent, monospace, plain, small-margin, text-link examples <label value="email address" control="email"/> <textbox id="email"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...if this attribute is set, the element is disabled.
...And 8 more matches
Choosing Standards Compliance Over Proprietary Practices - Archive of obsolete content
following standards is certainly not a new organizational phenomenon; organizations require their employees to follow common rules, or a common set of standards all the time.
...all businesses are expected and required to follow the guidelines set forth by the fasb.
... interoperability the key to interoperability is settling on a standard that has a potential for long-term use.
...And 8 more matches
Advanced styling effects - Learn web development
the css: p { margin: 0; } article { max-width: 500px; padding: 10px; background-color: red; background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.25)); } .simple { box-shadow: 5px 5px 5px rgba(0,0,0,0.7); } this gives us the following result: you'll see that we've got four items in the box-shadow property value: the first length value is the horizontal offset — the distance to the right the shadow is offset from the original box (or left, if the value is negative).
... the second length value is the vertical offset — the distance downwards that the shadow is offset from the original box (or upwards, if the value is negative).
... other box shadow features unlike text-shadow, box-shadow has an inset keyword available — putting this at the start of a shadow declaration causes it to become an inner shadow, rather than an outer shadow.
...And 8 more matches
What’s in the head? Metadata in HTML - Learn web development
let's revisit the simple html document we covered in the previous article: <!doctype html> <html> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <p>this is my page</p> </body> </html> the html head is the contents of the <head> element — unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page.
...in the above example, the head is quite small: <head> <meta charset="utf-8"> <title>my test page</title> </head> in larger pages however, the head can get quite full.
... specifying your document's character encoding in the example we saw above, this line was included: <meta charset="utf-8"> this element simply specifies the document's character encoding — the character set that the document is permitted to use.
...And 8 more matches
Getting started with Svelte - Learn web development
we will see how svelte works and what sets it apart from the rest of the frameworks and tools we've seen so far.
... then we will learn how to setup our development environment, create a sample app, understand the structure of the project, and see how to run it locally and build it for production.
... objective: to setup a local svelte development environment, create and build a starter app, and understand the basics of how it works.
...And 8 more matches
Handling common JavaScript problems - Learn web development
note: eslint takes a bit more setup and configuration than jshint, but it is more powerful too.
... under breakpoints, you'll see the details of the break-point you have set.
...this settles it — our xmlhttprequest call is returning the json as text, not json.
...And 8 more matches
Creating Sandboxed HTTP Connections
setting up an http connection the first step in setting up an http connection from an url (stored in a string) is to create an nsiuri out of it.
...amlistener(callbackfunc); gchannel.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, acontext, astream, asourceoffset, alength) { var scriptableinputstream = components.classes["@mozilla.org/scriptableinputstream;1"] .createinstance(components.interfaces.nsiscriptableinputstream); scriptableinputstream.init(astream); this.mdata += scriptableinputstream.read(alength); }, onstoprequest: function (arequest, acontext, astatus) { if (components.issuccesscode(astatus)) { // re...
...in order to manipulate cookies, the nsichannel needs to be converted into a nsihttpchannel by using queryinterface (qi): var httpchannel = asubject.queryinterface(components.interfaces.nsihttpchannel); cookies are actually part of the http header, nsihttpchannel provides four methods for working with headers: two for getting and setting request headers, and two for getting and setting response headers.
...And 8 more matches
Error codes returned by Mozilla APIs
ns_error_null_pointer (0x80004003) an error occurred because a value was set to null when this was not expected.
... ns_error_file_unrecognized_path (0x80520001) this error occurs when an attempt is made to set a path that isn't valid for the platform.
... ns_error_file_access_denied (0x80520015) an operation was not performed on a file because the file cannot be accessed, typically because the permissions set for the file do not allow the operation.
...And 8 more matches
JNI.jsm
working with arrays creating/preallocating a typed array methods cdata .get(number aindex); cdata .getelements(number astart, number alength); void .set(number aindex, cdata avalue); void .setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); .get() gets the value of the element in the array at given aindex.
... void setelements(number astart, number alength); parameters astart the position to start setting elements of the array in.
... .set() sets an element in the array at given aindex to the given aval.
...And 8 more matches
QA phase
note: remember all of those pre-requisite tools we asked you to install in the initial setup?
... please either follow the above structure closely or adjust the commands below according to your custom setup.
... set your language using the quick locale switcher or locale switcher add-ons by navigating to tools->language->your localization's language code.
...And 8 more matches
NSS API Guidelines
currently, ocsp checking settings are exported through certhi.
...fortezza is a set of security algorithms, used by the u.s.
... here is an example from lib/base/baset.h: #ifdef debug static const char baset_cvs_id[] = "@(#) $rcsfile: nss-guidelines.html, v $ $revision: 48936 $ $date: 2009-08-11 07:45:57 -0700 (tue, 11 aug 2009) $ $name$"; #endif /* debug */ the difference, between this and id, is that id has some useless information (every file is "experimental"), and doesn't have name.
...And 8 more matches
NSS PKCS11 Functions
secmod_loadusermodule secmod_unloadusermodule secmod_openuserdb secmod_closeuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc secmod_loadusermodule load a new pkcs #11 module based on a modulespec.
...this pointer is set with ssl_setpkcs11pinarg during ssl configuration.
...the pk11_findcertfromnickname function calls the password callback function set with pk11_setpasswordfunc and passes it the pointer specified by the wincx parameter.
...And 8 more matches
pkfnc.html
pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc pk11_findcertfromnickname finds a certificate from its nickname.
...this pointer is set with ssl_setpkcs11pinarg during ssl configuration.
... the pk11_findcertfromnickname function calls the password callback function set with pk11_setpasswordfunc and passes it the pointer specified by the wincx parameter.
...And 8 more matches
Web Replay
getting started to enable web replay (macos and firefox nightly only), go to devtools settings and select "enable webreplay".
... rewind to breakpoint when paused, if there are any breakpoints set then the rewind button will run back and stop at the last time a breakpoint was set.
... mainly, pointer values may differ between recording and replay, and the points where gcs occur, and the set of objects collected, may differ.
...And 8 more matches
nsIFocusManager
adeep, out nsidomwindow afocusedwindow); pruint32 getlastfocusmethod(in nsidomwindow window); void movecarettofocus(in nsidomwindow awindow); void elementisfocusable(in nsidomelement aelement, in unsigned long aflags); nsidomelement movefocus(in nsidomwindow awindow, in nsidomelement astartelement, in unsigned long atype, in unsigned long aflags); void setfocus(in nsidomelement aelement, in unsigned long aflags); void windowhidden(in nsidomwindow awindow); native code only!
...setting the activewindow raises it, and focuses the current child window's current element, if any.
... setting this to null or to a non-top-level window throws an ns_error_invalid_arg exception.
...And 8 more matches
nsIMicrosummaryService
ry/service;1"] .getservice(components.interfaces.nsimicrosummaryservice); method overview void addgenerator(in nsiuri generatoruri); nsimicrosummary createmicrosummary(in nsiuri pageuri, in nsiuri generatoruri); nsisimpleenumerator getbookmarks(); nsimicrosummarygenerator getgenerator(in nsiuri generatoruri); nsimicrosummaryset getmicrosummaries(in nsiuri pageuri, in long long bookmarkid); nsimicrosummary getmicrosummary(in long long bookmarkid); boolean hasmicrosummary(in long long bookmarkid); nsimicrosummarygenerator installgenerator(in nsidomdocument xmldefinition); boolean ismicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); nsimicrosummary refreshmi...
...crosummary(in long long bookmarkid); void removemicrosummary(in long long bookmarkid); void setmicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); methods addgenerator() install the microsummary generator from the resource at the supplied uri.
...getbookmarks() get the set of bookmarks with microsummaries.
...And 8 more matches
nsIMsgDatabase
last changed in gecko 1.9 (firefox 3) inherits from: nsidbchangeannouncer method overview void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); void forcefolderdbclosed(in nsimsgfolder afolder); void close(in boolean aforcecommit); void commit(in nsmsgdbcommit committype); void forceclosed(); void clearcachedhdrs; void resethdrcachesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey key); void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgkey key, in nsimsgdbhdr existinghdr, in boolean addhdrtodb); ...
...it); void deleteheader(in nsimsgdbhdr msghdr, in nsidbchangelistener instigator,in boolean commit, in boolean notify); void removeheadermdbrow(in nsimsgdbhdr msghdr); void undodelete(in nsimsgdbhdr msghdr); void markmarked(in nsmsgkey key, in boolean mark, in nsidbchangelistener instigator); void markoffline(in nsmsgkey key, in boolean offline, in nsidbchangelistener instigator); void setlabel(in nsmsgkey key, in nsmsglabelvalue label); void setstringproperty(in nsmsgkey akey, in string aproperty, in string avalue); void markimapdeleted(in nsmsgkey key, in boolean deleted, in nsidbchangelistener instigator); void applyretentionsettings(in nsimsgretentionsettings amsgretentionsettings, in boolean adeleteviafolder); boolean hasnew(); void clearnewlist(in boolean notify); ...
... void setattributesonpendinghdr(in nsimsgdbhdr pendinghdr, in string property, in string propertyval, in long flags); void createcollationkey(in astring sourcestring, out octetptr key, out unsigned long len); native code only!
...And 8 more matches
nsIUTF8ConverterService
inherits from: nsisupports last changed in gecko 1.7 method overview autf8string convertstringtoutf8(in acstring astring, in string acharset, in boolean askipcheck); autf8string converturispectoutf8(in acstring aspec, in string acharset); methods convertstringtoutf8() ensure that astring is encoded in utf-8.
... if not, convert to utf-8 assuming it's encoded in acharset and return the converted string in utf-8.
... autf8string convertstringtoutf8( in acstring astring, in string acharset, in boolean askipcheck, in boolean aallowsubstitution ); parameters astring a string to ensure its utf8ness.
...And 8 more matches
nsIWebProgressListener
this flag is set when a request is initiated.
... the request is complete when onstatechange() is called for the same request with the state_stop flag set.
...this flag is set in addition to state_is_request.
...And 8 more matches
nsIXPConnect
sobjectptr anewscope); obsolete since gecko 1.9.1 nsixpconnectjsobjectholder reparentwrappednativeiffound(in jscontextptr ajscontext, in jsobjectptr ascope, in jsobjectptr anewparent, in nsisupports acomobj); void restorewrappednativeprototype(in jscontextptr ajscontext, in jsobjectptr ascope, in nsiclassinfo aclassinfo, in nsixpconnectjsobjectholder aprototype); void setdebugmodewhenpossible(in prbool mode); native code only!
... void setdefaultsecuritymanager(in nsixpcsecuritymanager amanager, in pruint16 flags); nsixpcfunctionthistranslator setfunctionthistranslator(in nsiidref aiid, in nsixpcfunctionthistranslator atranslator); void setreportalljsexceptions(in boolean reportalljsexceptions); void setsafejscontextforcurrentthread(in jscontextptr cx); void setsecuritymanagerforjscontext(in jscontextptr ajscontext, in nsixpcsecuritymanager amanager, in pruint16 flags); void syncjscontexts(); void updatexows(in jscontextptr ajscontext, in nsixpconnectwrappednative aobject, in pruint32 away); native code only!
... cx the context to use when setting up the evaluation of the script.
...And 8 more matches
XPIDL
ing only chars in range \u0000-\u00ff permitted most of the time you don't want to use this type but autf8string or acstring unsigned long uint32_t uint32_t* number unsigned long long uint64_t uint64_t* number unsigned short uint16_t uint16_t* number wchar char16_t char16_t* string full unicode set permitted wstring const char16_t* char16_t** string full unicode set permitted most of the time you don't want to use this type but astring.
... nsqiresult void* void** object should only be used with methods that act like queryinterface autf8string const nsacstring& nsacstring& string full unicode set permitted (translated to utf-8) acstring const nsacstring& nsacstring& string only chars in range \u0000-\u00ff permitted astring const nsastring& nsastring& string full unicode set permitted jsval const jsval& jsval* anything jsid jsid jsid* not allowed promise mozilla::dom::promise* mozilla::dom...
...attributes in idl are akin to javascript properties, in that they are a getter and (optionally) a setter pair.
...And 8 more matches
DOM Inspector internals - Firefox Developer Tools
dom inspector from a high-level perspective the dom inspector primary ui consists of some toolbars and a panelset.
... the panelset contains two panels.
...(internally, a panel may be loosely referred to as a "pane", but a panelset is always referred to as a "panelset".) a panel's purpose is to manage available viewers.
...And 8 more matches
Break on DOM mutation - Firefox Developer Tools
a dom mutation breakpoint pauses the code when the dom node on which you have set the breakpoint is modified.
... you set a dom mutation breakpoint in the page inspector.
... navigate to the dom node in which you are interested and use the context menu to set the breakpoint.
...And 8 more matches
Debugger.Source - Firefox Developer Tools
the text generation is disabled if the debugger has the allowwasmbinarysource property set, the "[wasm]" value will be returned in this case.
... binary if the instance refers to webassembly code and the debugger has the allowwasmbinarysource property set, a uint8array that contains the webassembly bytecode.
... (on the web, the translator may provide the source map url in a specially formatted comment in the javascript source code, or via a header in the http reply that carried the generated javascript.) this property is writable, so you can change the source map url by setting it.
...And 8 more matches
Responsive Design Mode - Firefox Developer Tools
controlling responsive design mode with responsive design mode enabled, the content area for web pages is set to the screen size for a mobile device.
... initially, it's set to 320 x 480 pixels.
...from left to right, the display includes: name of the selected device - a drop-down list that includes whatever devices you have selected from the device settings screen.
...And 8 more matches
HTMLFormElement - Web APIs
only specified values can be set.
...only specified values can be set.
... htmlformelement.acceptcharset a domstring reflecting the value of the form's accept-charset html attribute, representing the character encoding that the server accepts.
...And 8 more matches
PannerNode - Web APIs
the orientation and position value are set and retrieved using different syntaxes, since they're stored as audioparam values.
...while setting the same property is done with pannernode.positionx.value.
... pannernode.setposition() defines the position of the audio source relative to the listener (represented by an audiolistener object stored in the audiocontext.listener attribute.) pannernode.setorientation() defines the direction the audio source is playing in.
...And 8 more matches
WebGL2RenderingContext.texSubImage3D() - Web APIs
syntax void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, arraybufferview?
... srcdata, optional srcoffset); void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, imagebitmap?
... pixels); void gl.texsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, imagedata?
...And 8 more matches
Keyframe Formats - Web APIs
element.animate(), keyframeeffect.keyframeeffect(), and keyframeeffect.setkeyframes() all accept objects formatted to represent a set of keyframes.
... element.animate([ { // from opacity: 0, color: "#fff" }, { // to opacity: 1, ​ color: "#000" } ], 2000); offsets for each keyframe can be specified by providing an offset value.
... element.animate([ { opacity: 1 }, { opacity: 0.1, offset: 0.7 }, { opacity: 0 } ], 2000); note: offset values, if provided, must be between 0.0 and 1.0 (inclusive) and arranged in ascending order.
...And 8 more matches
Web Audio API best practices - Web APIs
it has cross-browser support and, provides a useful subset of functionality.
... when working with an audiocontext, if you create the audio context from inside a click event the state should automatically be set to running.
... here is a simple example of creating the context from inside a click event: const button = document.queryselector('button'); button.addeventlistener('click', function() { const audioctx = new audiocontext(); }, false); if however, you create the context outside of a user gesture, its state will be set to suspended and it will need to be started after user interaction.
...And 8 more matches
Visualizations with Web Audio API - Web APIs
creating a waveform/oscilloscope to create the oscilloscope visualisation (hat tip to soledad penadés for the original code in voice-change-o-matic), we first follow the standard pattern described in the previous section to set up the buffer: analyser.fftsize = 2048; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); next, we clear the canvas of what had been drawn on it before to get ready for the new visualization display: canvasctx.clearrect(0, 0, width, height); we now define the draw() function: function draw() { in here, we use requestanimationframe() to keep looping...
... the drawing function once it has been started: var drawvisual = requestanimationframe(draw); next, we grab the time domain data and copy it into our array analyser.getbytetimedomaindata(dataarray); next, fill the canvas with a solid colour to start canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); set a line width and stroke colour for the wave we will draw, then begin drawing a path canvasctx.linewidth = 2; canvasctx.strokestyle = 'rgb(0, 0, 0)'; canvasctx.beginpath(); determine the width of each segment of the line to be drawn by dividing the canvas width by the array length (equal to the frequencybincount, as defined earlier on), then define an x variable to define the position to move to for drawing each segment of the line.
... first, we again set up our analyser and data array, then clear the current canvas display with clearrect().
...And 8 more matches
XPathResult.resultType - Web APIs
constants result type defined constant value description any_type 0 a result set containing whatever type naturally results from evaluation of the expression.
... note that if the result is a node-set then unordered_node_iterator_type is always the resulting type.
... unordered_node_iterator_type 4 a result node-set containing all the nodes matching the expression.
...And 8 more matches
XPathResult - Web APIs
methods xpathresult.iteratenext() if the result is a node set, this method iterates over it and returns the next node from it or null if there are no more nodes.
... constants result type defined constant value description any_type 0 a result set containing whatever type naturally results from evaluation of the expression.
... note that if the result is a node-set then unordered_node_iterator_type is always the resulting type.
...And 8 more matches
ARIA: tab role - Accessibility
when working with elements with the tab role, when they are selected or active, they should have their aria-selected attribute set to true, otherwise it should be set to false.
... when a tab is selected or active, its controlled tabpanel should have its aria-expanded and hidden attributes set to true, otherwise they should be set to false.
... required javascript features while there are ways to build tab-like functionality without javascript, there are no substitute combination of html and css only that will provide the same set of functionality that's required above for accessible tabs with content.
...And 8 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
a set of system messages that confer accessibility-related events such as focus changes, changes to document content and state changes in ui objects like checkboxes.
...at least one major screen reader has a feature to turn highlight tracking off, but that's only a global setting, and turning off highlight tracking globally also turns off the speaking of menu items.
...for example, when you set window focus, windows will generate an event_object_focus event an a role_window object it also generated for you.
...And 8 more matches
Using CSS animations - CSS: Cascading Style Sheets
animations consist of two components, a style describing the css animation and a set of keyframes that indicate the start and end states of the animation’s style, as well as possible intermediate waypoints.
... 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.
...to avoid this problem put the element to be animated in a container, and set overflow:hidden on the container.
...And 8 more matches
Box alignment in Flexbox - CSS: Cascading Style Sheets
the first item overrides the align-items values set on the group by setting align-self to center.
... the axes and flex-direction flexbox respects the writing mode of the document, therefore if you are working in english and set justify-content to flex-end this will align the items to the end of the flex container.
... if you are working with flex-direction set to row, this alignment will be in the inline direction.
...And 8 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
the first item overrides the align-items value set on the group by setting align-self to center.
...the first item overrides the align-items set on the group by setting align-self to center.
... when aligning items on the inline axis you will use the properties which begin with justify-: justify-items justify-self justify-content when aligning items on the block axis you will use the properties that begin align-: align-items align-self align-content flexbox adds an additional complication in that the above is true when flex-direction is set to row.
...And 8 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
" "a a a a b b b b" "c c c c d d d d" "c c c c d d d d"; align-items: start; } .item1 { grid-area: a; } .item2 { grid-area: b; } .item3 { grid-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> keep in mind that once you set align-items: start, the height of each child <div> will be determined by the contents of the <div>.
... the align-items property sets the align-self property for all of the child grid items.
... this means that you can set the property individually, by using align-self on a grid item.
...And 8 more matches
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
note: setting the value to anything that isn't a valid, fully-opaque, rgb color in hexadecimal notation will result in the value being set to #000000.
... in particular, you can't use css's standardized color names, or any css function syntax, to set the value.
...#009900aa) will also result in the color being set to #000000.
...And 8 more matches
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
you can set a default value for the input control by including a month and year inside the value attribute, like so: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> one thing to note is that the displayed date format differs from the actual value; most user agents display the month and year in a locale-appropriate form,...
... based on the set locale of the user's operating system, whereas the date value is always formatted yyyy-mm.
... you can also get and set the date value in javascript using the htmlinputelement.value property, for example: <label for="bday-month">what month were you born in?</label> <input id="bday-month" type="month" name="bday-month" value="2017-06"> var monthcontrol = document.queryselector('input[type="month"]'); monthcontrol.value = '1978-06'; additional attributes in addition to the attributes common to <input> elements, month inputs offer the following attributes: attribute description list the id of the <datalist> element that contains the optional pre-defined autocomplete options max the latest year and month to accept as a valid input ...
...And 8 more matches
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value methods select(), setrangetext() and setselectionrange().
...its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property.
...since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use).
...And 8 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
value a domstring representing a url, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size idl attributes list, value, selectionend, selectiondirection methods select(), setrangetext() and setselectionrange().
...its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property.
...since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use).
...And 8 more matches
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
if no value is expressly set for align, the parent node's value is inherited.
...to apply character-based alignment, set the css text-align property to the alignment character (such as "." or ",").
...omitting the attribute or setting it to null in javascript causes the row's cells to inherit the row's parent element's background color.
...And 8 more matches
HTTP headers - HTTP
WebHTTPHeaders
note that only hop-by-hop headers may be set using the connection general header.
... accept-ch-lifetime servers can ask the client to remember the set of client hints that the server supports for a specified period of time, to enable delivery of client hints on subsequent requests to the server’s origin ([rfc6454]).
... accept-charset which character encodings the client understands.
...And 8 more matches
Functions - JavaScript
a function in javascript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output.
...there are often cases where a function needs to be called dynamically, or the number of arguments to a function vary, or in which the context of the function call needs to be set to a specific object determined at runtime.
... this is not different from storing references in other objects, but is often less obvious because one does not set the references directly and cannot inspect them.
...And 8 more matches
Numbers and dates - JavaScript
the date object has a large number of methods for setting, getting, and manipulating dates.
...if you omit hours, minutes, or seconds, the value will be set to zero.
... a set of integer values for year, month, and day.
...And 8 more matches
Regular expression syntax cheatsheet - JavaScript
inside a character set, the dot loses its special meaning and matches a literal dot.
...so to match a pattern across multiple lines, the character set [^] can be used — it will match any character including newlines.
... \u{hhhh} or \u{hhhhh} (only when the u flag is set.) matches the character with the unicode value u+hhhh or u+hhhhh (hexadecimal digits).
...And 8 more matches
Object - JavaScript
with object.setprototypeof).
... object.setprototypeof() sets the object's prototype (its internal [[prototype]] property).
... object.prototype.__definesetter__() associates a function with a property that, when set, executes that function which modifies the property.
...And 8 more matches
Planned changes to shared memory - JavaScript
for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads is therefore available.
... nested documents and dedicated workers will need to set the cross-origin-embedder-policy header as well with the same value.
...same-site (but cross-origin) nested documents and subresources will need to set the cross-origin-resource-policy header with same-site as value.
...And 8 more matches
/loader - Archive of obsolete content
instantiation the loader module provides a loader() function that may be used to instantiate new loader instances: let loader = loader(options); configuration loader() may be provided with a set of configuration options: paths: describes where the loader should find the modules it is asked to load.
... modules: provides a set of module exports.
... globals: provides a set of globals shared across modules loaded via this loader.
...And 7 more matches
Preferences - Archive of obsolete content
there are six methods in nsiprefbranch that read and write preferences: getboolpref(), setboolpref(), getcharpref(), setcharpref(), getintpref(), and setintpref().
...var value = prefs.getboolpref("typeaheadfind"); // get a pref (accessibility.typeaheadfind) prefs.setboolpref("typeaheadfind", !value); // set a pref (accessibility.typeaheadfind) complex types as noted in the previous section, each entry in the preferences database (prefs.js) must have a string, an integer, or a boolean value.
... however, there is a concept of complex types, which makes it easier for developers to save and load nsilocalfile and nsisupportsstring objects in preferences (as strings — note that from the preferences system's point of view, complex values have a nsiprefbranch.pref_string type.) there are two nsiprefbranch methods implementing the concept — setcomplexvalue() and getcomplexvalue().
...And 7 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
the observer is an object which may have a number of properties, each set to a function which handles a particular aspect of drag and drop.
...the type of data being dragged is stored as a set of flavors.
...this property is a function which sets the data that is being dragged.
...And 7 more matches
Editor Embedding Guide - Archive of obsolete content
in calling this method, the editor is created underneath and the event listeners are all prepa if (ns_failed(rv)) return ns_error_failure; // we are not setup??!!
... cmd_fontcolor acts upon the current selection to set the font color.
... cmd_backgroundcolor sets the background color of the document.
...And 7 more matches
Reading textual data - Archive of obsolete content
determining the character encoding of data if you have a network channel (nsichannel), you can try the contentcharset property of it.
...you can fallback to the default character encoding stored in preferences (intl.charset.default, a localized pref value) when reading from a file, the question is harder to answer.
... usage: var charset = /* need to find out what the character encoding is.
...And 7 more matches
Content Panels - Archive of obsolete content
a good example is a step-by-step wizard that guides you through a number of screens, asking a set of questions.
...set the url to appear in the frame with the src attribute.
...the tabbrowser element is actually implemened as a tabbox containing a set of browser elements.
...And 7 more matches
Custom Tree Views - Archive of obsolete content
rowcount this property should be set to the total number of rows in the tree.
... settree( tree ) this method is called once to set the tree element on the view.
... here is an example of defining such as object, which can be called whatever you want: //moz 1.8 var treeview = { rowcount : 10000, getcelltext : function(row,column){ if (column.id == "namecol") return "row "+row; else return "february 18"; }, settree: function(treebox){ this.treebox = treebox; }, iscontainer: function(row){ return false; }, isseparator: function(row){ return false; }, issorted: function(){ return false; }, getlevel: function(row){ return 0; }, getimagesrc: function(row,col){ return null; }, getrowproperties: function(row,props){}, getcellproperties: function(row,col,props){}, getcolumnproperties: function(colid,col,props){} }; the functions in the example not described above do not need to perform any action, ...
...And 7 more matches
Tree View Details - Archive of obsolete content
here, we will examine how to create a hierarchical set of items using the view.
...it simply sets the custom view by retrieving the tree and setting its 'view' property.
...obviously, the new inserted child items will have both values set to false.
...And 7 more matches
Trees and Templates - Archive of obsolete content
the flags attribute set to the value dont-build-content, as used in the example above, indicates that the tree builder should be used.
...the cells should have a label attribute to set the label for the cell.
... this would normally be set to an rdf property so that the label is pulled from the datasource.
...And 7 more matches
key - Archive of obsolete content
ArchiveMozillaXULkey
« xul reference home [ examples | attributes | properties | methods | related ] the key element defines a window-global keyboard shortcut and must be placed inside a keyset element.
... attributes command, disabled, key, keycode, keytext, modifiers, oncommand, phase examples (example needed) attributes command type: id set to the id of a command element that is being observed by the element.
...if this attribute is set, the element is disabled.
...And 7 more matches
calICalendarView - Archive of obsolete content
summary an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects.
... interface code [scriptable, uuid(3e567ccb-2ecf-4f59-b7ca-bf42b0fbf24a)] interface calicalendarview : nsisupports { attribute calicalendar displaycalender; attribute calicalendarviewcontroller controller; void showdate(in calidatetime adate); void setdaterange(in calidatetime astartdate, in calidatetime aenddate); readonly attribute calidatetime startdate; readonly attribute calidatetime enddate; readonly attribute boolean supportsdisjointdates; readonly attribute boolean hasdisjointdates; void setdatelist(in unsigned long acount, [array,size_is(acount)] in calidatetime adates); void getdatelist(out unsigned long acount, [array,s...
...note that in most cases, this attribute will be set by the consumers of calicalendarview very early in an application/extension's loading process.
...And 7 more matches
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.
... examples of settings are an operating system offering access to control lists that set the privileges that users have for files, and an application offering a setting to enable or disable the encryption of sensitive data stored by the application.
... a security configuration issue vulnerability involves the use of security configuration settings that negatively affect the security of the software.
...And 7 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
isting 1 - querying a mysql database from rhino // import the java sql packages importpackage( java.sql ); // load the mysql driver java.lang.class.forname( "com.mysql.jdbc.driver" ); // create connection to the database var conn = drivermanager.getconnection( "jdbc:mysql://localhost/rhino", "urhino", "prhino" ); // create a statement handle var stmt = conn.createstatement(); // get a resultset var rs = stmt.executequery( "select * from employee" ); // get the metadata from the resultset var meta = rs.getmetadata(); // loop over the records, dump out column names and values while( rs.next() ) { for( var i = 1; i <= meta.getcolumncount(); i++ ) { print( meta.getcolumnname( i ) + ": " + rs.getobject( i ) + "\n" ); } print( "----------\n" ); } // cleanup rs.close(); stmt.close(); ...
...the sql statement is prepared, executed, and printed with the help of the metadata obtained from the resultset.
...the sample script in listing 1 could be factored out to it’s own function to retrieve the set of employee information, or abstracted further into a more generic data handler class.
...And 7 more matches
Mozilla XForms User Interface - Archive of obsolete content
the set of "xforms user interface" elements exist to aid form authors in combining host language markup and xforms markup together in order to build user interfaces.
...attribute sets this section describes attributes that are often used on xforms elements.
...ui common the ui common attribute set (see the spec) contains the attributes that are available for the xforms elements that are used to build the user interface presentation in a form.
...And 7 more matches
Building up a basic demo with PlayCanvas editor - Game development
here's what the page looks like — you can create projects and manage them, change their settings etc.
... the box is created with the default values — width, height and depth are set to 1, and it is placed in the middle of the scene.
...click on the plus button in the assets tab, and click on the material option in the dropdown list that appears to create a new material.
...And 7 more matches
Efficient animation for web games - Game development
if you are setting a transform on something that would overlap its container’s bounds, you may want to set overflow: hidden on that container for the duration of the animation.
... use requestanimationframe when you are animating <canvas> content, or when your dom animations absolutely must synchronise with canvas content animations, do make sure to use window.requestanimationframe, and not older methods such as window.settimeout.
...settimeout is that your animations must be time-based instead of frame-based, i.e.
...And 7 more matches
Player paddle and controls - Game development
rendering the paddle from the framework point of view the paddle is very similar to the ball — we need to add a variable to represent it, load the relevant image asset, and then do the magic.
...add the following line below the previous new one: paddle.anchor.set(0.5,1); the paddle is now positioned right where we want it to be.
...we can set the body of the paddle to be immovable, so it won't move when the ball hits it.
...And 7 more matches
Backgrounds and borders - Learn web development
we have set the value to no-repeat so you will only see one star.
...ckground-repeat: no-repeat; background-position: 20px 10%; } you can also mix keyword values with lengths or percentages, for example: .box { background-image: url(star.png); background-repeat: no-repeat; background-position: top 20px; } finally, you can also use a 4-value syntax in order to indicate a distance from certain edges of the box — the length unit, in this case, is an offset from the value that precedes it.
... note: background-position is a shorthand for background-position-x and background-position-y, which allow you to set the different axis position values individually.
...And 7 more matches
The HTML5 input types - Learn web development
e-mail address field this type of field is set using the value email for the type attribute: <input type="email" id="email" name="email"> when this type is used, the user is required to type a valid email address into the field.
...this type of field is set by using the value search for the type attribute: <input type="search" id="search" name="search"> the main difference between a text field and a search field is how the browser styles its appearance.
... the following screenshot (from firefox for android) provides an example: with the number input type, you can constrain the minimum and maximum values allowed by setting the min and max attributes.
...And 7 more matches
How to build custom form controls - Learn web development
we'll see later that it's better to set it through javascript.
... .select:after { content : "▼"; /* we use the unicode character u+25bc; make sure to set a charset meta tag */ position: absolute; z-index : 1; /* this will be important to keep the arrow from overlapping the list of options */ top : 0; right : 0; box-sizing : border-box; height : 100%; width : 2em; padding-top : .1em; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; text-align : center; } nex...
...t, let's style the list of options: .select .optlist { z-index : 2; /* we explicitly said the list of options will always be on top of the down arrow */ /* this will reset the default style of the ul element */ list-style: none; margin : 0; padding: 0; box-sizing : border-box; /* if the values are smaller than the control, the list of options will be as wide as the control itself */ min-width : 100%; /* in case the list is too long, its content will overflow vertically (which will add a vertical scrollbar automatically) but never horizontally (because we haven't set a width, the list will adjust its width automatically.
...And 7 more matches
Build your own function - Learn web development
this is followed by the name we want to give to our function, a set of parentheses, and a set of curly braces.
... finally, add the following code inside the curly braces: const html = document.queryselector('html'); const panel = document.createelement('div'); panel.setattribute('class', 'msgbox'); html.appendchild(panel); const msg = document.createelement('p'); msg.textcontent = 'this is a message box'; panel.appendchild(msg); const closebtn = document.createelement('button'); closebtn.textcontent = 'x'; panel.appendchild(closebtn); closebtn.onclick = function() { panel.parentnode.removechild(panel); } this is quite a lot of code to go through, so we'll walk you through it bit by bit.
... we then use yet another dom api function called element.setattribute() to set a class attribute on our panel with a value of msgbox.
...And 7 more matches
Manipulating documents - Learn web development
this is usually done by using the document object model (dom), a set of apis for controlling html and styling information that makes heavy use of the document object.
...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> th...
...you can set properties of this object to directly update element styles.
...And 7 more matches
Focus management with Vue refs - Learn web development
to give users a better experience, we'll add code to control the focus so that it gets set to the edit field when the edit form is shown.
...in order to set focus, we need to understand a little bit more about how vue works internally.
... instead, if you need to access the underlying dom nodes (like when setting focus), you can use vue refs.
...And 7 more matches
How Mozilla's build system works
there is roughly one moz.build file per directory or per set of related directories.
...the execution environment is strictly controlled, so moz.build files can only perform a limited set of operations.
... assigning to a well-defined set of variables whose name is uppercase.
...And 7 more matches
Gecko Logging
if (moz_log_test(slogger, loglevel::warning)) { int elapsed = time::nowms() - start; if (elapsed > 1000) { moz_log(slogger, loglevel::warning, ("loop took %dms!", elapsed)); } } if (i != 10) { moz_log(slogger, loglevel::error, ("i should be 10!")); } } enabling logging the log level for a module is controlled by setting an environment variable before launching the application.
... it can also be adjusted by setting prefs.
... set moz_log="example_logger:3" in the windows command prompt (cmd.exe), don't use quotes: set moz_log=example_logger:3 if you want this on geckoview example, use the following adb command to launch process: adb shell am start -n org.mozilla.geckoview_example/.geckoviewactivity --es env0 "moz_log=example_logger:3" there are special module names to change logging behavior.
...And 7 more matches
Performance best practices for Firefox front-end engineers
hide your panels if you’re adding a new xul <xul:popup> or <xul:panel> to a document, set the hidden attribute to true by default.
... return window.getcomputedstyle(node).display; }); return display == "none"; } see detecting and avoiding synchronous reflow for a more advanced example of getting layout information, and then setting it safely, without causing flushes.
... here’s a simple example, cribbed from this blog post by paul rouget: div1.style.margin = "200px"; // line 1 var height1 = div1.clientheight; // line 2 div2.classlist.add("foobar"); // line 3 var height2 = div2.clientheight; // line 4 dosomething(height1, height2); // line 5 at line 1, we’re setting some style information on a dom node that’s going to result in a reflow - but (at just line 1) it’s okay, because that reflow will happen after the style calculation.
...And 7 more matches
Embedding Tips
normally it provide some functionality that is required from lots of places such as looking up preference settings, creating new windows, locating files, displaying prompt or password dialog boxes and so on.
...call the nsiwebbrowserprint::print() method supplying a print settings object (e.g.
... that returned from nsiwebbrowserprint::getglobalprintsettings) that you wish to print the page with.
...And 7 more matches
L10n Checks
the easiest way is to just run: $ hg clone http://hg.mozilla.org/users/akalla_aviary.pl/silme-patched/ $ cd silme-patched/ $ sudo python setup.py install or, if you're on windows: $ hg clone http://hg.mozilla.org/users/akalla_aviary.pl/silme-patched/ $ cd silme-patched/ $ python setup.py install running it mercurial source (source) mode l10n checks gathers the directories to compare from an ini file, usually found in $app/locales/l10n.ini.
...ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name.
...options reference locale in the source and xpi modes you can change the default reference locale (en-us) by setting the -r parameter, e.g.: check-l10n-completeness -r pl browser/locales/l10n.ini ../l10n/ de output mode you can change the look and feel of the output by setting the -o parameter to 0 (tree; default), 1 (full tree) or 2 (full relative paths), e.g.: check-l10n-completeness -o 2 browser/locales/l10n.ini ../l10n/ de en-us in the locale directory in the source mode you can tell l10n checks to lo...
...And 7 more matches
GC and CC logs
you'll need to disable sandboxing by setting moz_disable_content_sandbox=t when you run firefox.
...you'll need to disable sandboxing by setting moz_disable_content_sandbox=t when you run firefox.
... on desktop firefox you can override the default location of the log files by setting the moz_cc_log_directory environment variable.
...And 7 more matches
SpiderMonkey 1.8
a handful of changes are not backwards-compatible: the result of assigning to a property with a setter has changed (bug 312354).
... the security apis js_setcheckobjectaccesscallback, js_setprincipalstranscoder, and js_setobjectprincipalsfinder are still present but are deprecated in this release.
... in spidermonkey 1.8.1 they will be removed and replaced with a new set of apis (js_getsecuritycallbacks and friends, bug 451729).
...And 7 more matches
A Web PKI x509 certificate primer
in general, x509 certificates bind a signature to a validity period, a public key, a subject, an issuer, and a set of extensions.
...for ca certificates the keycertsign bit must be set.
...self-sign csr (using sha256) and append the extensions described in the file "openssl x509 -req -sha256 -days 3650 -in example.csr -signkey key.pem -set_serial $any_integer -extfile openssl.ss.cnf -out example.pem" you can now use example.pem as your certfile cas included in firefox when you visit a secure website, firefox will validate the website’s certificate by checking that the certificate that signed it is valid, and checking that the certificate that signed the parent certificate is valid and so forth up to a root certificate that...
...And 7 more matches
Using the Places history service
nsinavhistoryservice: complex query functions, more fine-grained getters and setters.
...new code should use nsinavhistoryservice.setpagedetails.
... nsinavhistoryservice.addvisit: this is an advanced function that allows the caller to set the exact referring visit, the time, the session, etc.
...And 7 more matches
nsINavHistoryQueryOptions
excludequeries boolean set to true to exclude queries ("place:" uris) from the query results.
... excludereadonlyfolders boolean set to true to exclude read-only folders from the query results.
... expandqueries boolean when set, allows items with "place:" uris to appear as containers, with the container's contents filled in from the stored query.
...And 7 more matches
nsIProtocolHandler
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean allowport(in long port, in string scheme); nsichannel newchannel(in nsiuri auri); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description defaultport long the default port is the port the protocol uses by default.
... note: starting with firefox 3, one of uri_loadable_by_anyone, uri_dangerous_to_load, uri_is_ui_resource, or uri_is_local_file must be set on every protocol handler.
... current versions of firefox assume that the uri has uri_loadable_by_anyone set, but this will not work starting with the mozilla 2 platform.
...And 7 more matches
nsISeekableStream
inherits from: nsisupports last changed in gecko 1.7 method overview void seek(in long whence, in long long offset); void seteof(); long long tell(); constants constant value description ns_seek_set 0 specifies that the offset is relative to the start of the stream.
... ns_seek_cur 1 specifies that the offset is relative to the current position in the stream.
... ns_seek_end 2 specifies that the offset is relative to the end of the stream.
...And 7 more matches
nsISocketTransport
inherits from: nsitransport last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: connection setup is triggered by opening an input or output stream, it does not start on its own.
... completion of the connection setup is indicated by a status_connected_to notification to the event sink (if set).
... unsigned long gettimeout(in unsigned long atype); boolean isalive(); void settimeout(in unsigned long atype, in unsigned long avalue); attributes attribute type description connectionflags unsigned long a bitmask that can be used to modify underlying behavior of the socket connection.
...And 7 more matches
nsIWindowMediator
void removelistener(in nsiwindowmediatorlistener alistener); void setzlevel(in nsixulwindow awindow, in pruint32 azlevel); native code only!
... void setzposition(in nsixulwindow inwindow, in unsigned long inposition, in nsixulwindow inbelow); native code only!
...if set to zlevelbelow the window will be placed below iobelow.
...And 7 more matches
nsIAbCard/Thunderbird3
from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pruint32 getpropertyasuint32(in string name); [noscript] boolean getpropertyasbool(in string name); void setproperty(in autf8string name, in nsivariant value); [noscript] void setpropertyasastring(in string name, in astring value); [noscript] void setpropertyasautf8string(in string name, in autf8string value); [noscript] void setpropertyasuint32(in string name, in pruint32 value); [noscript] void setpropertyasbool(in string name, in boolean value); void delet...
... firstname astring shorthand for getproperty and setproperty.
... lastname astring shorthand for getproperty and setproperty.
...And 7 more matches
Mozilla
all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload().
... channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache.
... chrome registration chrome is the set of user interface elements of the application window that are outside the window's content area.
...And 7 more matches
Animation - Web APIs
WebAPIAnimation
animation.effect gets and sets the animationeffectreadonly associated with this animation.
... animation.id gets and sets the string used to identify the animation.
... animation.playbackrate gets or sets the playback rate of the animation.
...And 7 more matches
AudioParam.value - Web APIs
WebAPIAudioParamvalue
the web audio api's audioparam interface property value gets or sets the value of this audioparam at the current time.
... initially, the value is set to audioparam.defaultvalue.
... setting value has the same effect as calling audioparam.setvalueattime with the time returned by the audiocontext's currenttime property..
...And 7 more matches
MediaStreamTrack - Web APIs
properties in addition to the properties listed below, mediastreamtrack has constrainable properties which can be set using applyconstraints() and accessed using getconstraints() and getsettings().
... see capabilities, constraints, and settings to learn how to correctly work with constrainable properties.
... note: you can implement standard "mute" functionality by setting enabled to false.
...And 7 more matches
PointerEvent.PointerEvent() - Web APIs
pointereventinitoptional is a pointereventinit dictionary, having the following fields: pointerid — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.pointerid.
... width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width.
... height — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.height.
...And 7 more matches
RTCPeerConnection.addTrack() - Web APIs
the rtcpeerconnection method addtrack() adds a new media track to the set of tracks which will be transmitted to the other peer.
...ia() to obtain a stream from a user's camera and microphone, then adds each track from the stream to the peer connection, without specifying a stream for each track: async opencall(pc) { const gumstream = await navigator.mediadevices.getusermedia( {video: true, audio: true}); for (const track of gumstream.gettracks()) { pc.addtrack(track); } } the result is a set of tracks being sent to the remote peer, with no stream associations.
...ion to a remote peer: async opencall(pc) { const gumstream = await navigator.mediadevices.getusermedia( {video: true, audio: true}); for (const track of gumstream.gettracks()) { pc.addtrack(track, gumstream); } } the remote peer might then use a track event handler that looks like this: pc.ontrack = ({streams: [stream]} => videoelem.srcobject = stream; this sets the video element's current stream to the one that contains the track that's been added to the connection.
...And 7 more matches
RTCPeerConnection.createOffer() - Web APIs
icerestart optional to restart ice on an active connection, set this to true.
... to emulate this behavior in modern implementations, the presence of this member with a value false, will set the direction of all existing audio transceivers to exclude reception (i.e.
... set to either "sendonly" or "inactive").
...And 7 more matches
Range - Web APIs
WebAPIRange
range.endoffset read only returns a number representing where in the endcontainer the range ends.
... range.startoffset read only returns a number representing where in the startcontainer the range starts.
... range.setstart() sets the start position of a range.
...And 7 more matches
Using the Screen Capture API - Web APIs
there are three new constraints added to mediatrackconstraints (as well as to mediatracksupportedconstraints and mediatracksettings) for configuring a screen capture stream: cursor indicates whether or not to capture the mouse cursor, and if so, whether to do so all the time or only while the mouse is in motion.
... setup first, some constants are set up to reference the elements on the page to which we'll need access: the <video> into which the captured screen contents will be streamed, a box into which logged output will be drawn, and the start and stop buttons that will turn on and off capture of screen imagery.
... the object displaymediaoptions contains the mediastreamconstraints to pass into getdisplaymedia(); here, the cursor property is set to always, indicating that the mouse cursor should always be included in the captured media.
...And 7 more matches
WebGLRenderingContext.texSubImage2D() - Web APIs
syntax // webgl 1: void gl.texsubimage2d(target, level, xoffset, yoffset, width, height, format, type, arraybufferview?
... pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, imagedata?
... pixels); void gl.texsubimage2d(target, level, xoffset, yoffset, format, type, htmlimageelement?
...And 7 more matches
Clearing with colors - Web APIs
set up the rendering context and then just clear it solid green.
... note that css sets the background color of the canvas to black, so when the canvas turns green we know that webgl's magic has worked.
...first, we set the clear color to green, using the method clearcolor().
...And 7 more matches
Animating textures in WebGL - Web APIs
getting access to the video the first step is to create the <video> element that we'll use to retrieve the video frames: // will set to true when video can be copied to texture var copyvideo = false; function setupvideo(url) { const video = document.createelement('video'); var playing = false; var timeupdate = false; video.autoplay = true; video.muted = true; video.loop = true; // waiting for these 2 events ensures // there is data in the video video.addeventlistener('playing', function() { playing ...
...we set it to autoplay, mute the sound, and loop the video.
... we then set up two events to make sure the video is playing and the time has been updated.
...And 7 more matches
Using IIR filters - Web APIs
for instance, if you want to filter lower frequencies from your sound, you can set the type to highpass and then set which frequency to filter from (or cut off).
...and this is where the iir filter node is useful — you can create your own if none of the alaready available settings is right for what you want.
... with the iirfilter node it's up to you to set what feedforward and feedback values the filter needs — this determines the characteristics of the filter.
...And 7 more matches
ARIA Test Cases - Accessibility
- - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - checkbox simple checkbox testcases: set aria-checked="false" for unchecked both remove or set attribute for unchecked case -- also includes an invalid and required checkbox hierarchical (newly added test not in test results yet) dojo nightly build expected at behavior: screen reader should speak the accessible name followed by both the type being checkbox and the state (checked, unchecked).
... markup used: role="checkbox" aria-checked="true" or "false" notes: need testcase where aria-checked attribute is removed instead of set to false results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass fail (changes not spoken) fail fail voiceover (leopard) n/a n/a - fail window-eyes pass pass fail (unchecked presented as checked, ie exposing incorrect state for no aria-checked attribute) fail fail nvda fail on #2 -- repetitive text spoken, first checkbox toggle speaks incorrect state n/a fail fail zoom (leopard) pass n/a pass pass ...
... zoomtext pass - fail fail orca pass n/a - - tristate checkbox testcases: both remove or unset for unchecked case expected at behavior: screen reader should announce accessible name, role and state.
...And 7 more matches
Alerts - Accessibility
here is a simple form: <form method="post" action="post.php"> <fieldset> <legend>please enter your contact details</legend> <label for="name">your name (required):</label> <input name="name" id="name" aria-required="true"/> <br /> <label for="email">e-mail address (required):</label> <input name="email" id="email" aria-required="true"/> <br /> <label for="website">website (optional):</label> <input name="website" id="websi...
...te"/> </fieldset> <label for="message">please enter your message (required):</label> <br /> <textarea name="message" id="message" rows="5" cols="80" aria-required="true"></textarea> <br /> <input type="submit" name="submit" value="send message"/> <input type="reset" name="reset" value="reset form"/> </form> checking for validity and notifying the user form validations consists of several steps: checking if the e-mail address or entered name are valid.
... each field has a set of criteria which must be met in order to pass validation.
...And 7 more matches
Accessibility documentation index - Accessibility
2 aria aria, accessibility, html accessible rich internet applications (aria) is a set of attributes that define ways to make web content and web applications (especially those developed with javascript) more accessible to people with disabilities.
... 5 aria annotations aria, accessibility, wai-aria, annotations, comments, details, suggestions wai-aria version 1.3 sees the addition of a set of new features, collectively known as aria annotations, which allow the creation of accessible annotations inside web documents.
...aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process.
...And 7 more matches
<basic-shape> - CSS: Cascading Style Sheets
the <basic-shape> css data type represents a shape used in the clip-path, shape-outside, and offset-path properties.
... inset() inset( <shape-arg>{1,4} [round <border-radius>]?
... ) defines an inset rectangle.
...And 7 more matches
border-image - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: border-image-outset border-image-repeat border-image-slice border-image-source border-image-width syntax /* source | slice */ border-image: linear-gradient(red, blue) 27; /* source | slice | repeat */ border-image: url("/images/border.png") 27 space; /* source | slice | width */ border-image: linear-gradient(red, blue) 27 / 35px; /* source | slice | width | outset | repeat */ border-image: url("/images/bor...
... <'border-image-outset'> the distance of the border image from the element's outside edge.
...see border-image-outset.
...And 7 more matches
filter - CSS: Cascading Style Sheets
WebCSSfilter
ur(5px); filter: brightness(0.4); filter: contrast(200%); filter: drop-shadow(16px 16px 20px blue); filter: grayscale(50%); filter: hue-rotate(90deg); filter: invert(75%); filter: opacity(25%); filter: saturate(30%); filter: sepia(60%); /* multiple filters */ filter: contrast(175%) brightness(3%); /* use no filter */ filter: none; /* global values */ filter: inherit; filter: initial; filter: unset; with a function, use the following: filter: <filter-function> [<filter-function>]* | none for a reference to an svg <filter> element, use the following: filter: url(file.svg#filter-element-id) interpolation if both the beginning and end filters have a function list of the same length without <url>, each of their filter functions is interpolated according to its specific rules.
...a drop shadow is effectively a blurred, offset version of the input image's alpha mask drawn in a particular color, composited below the image.
... the function accepts a parameter of type <shadow> (defined in css3 backgrounds), with the exception that the inset keyword is not allowed.
...And 7 more matches
grid - CSS: Cascading Style Sheets
WebCSSgrid
the grid css property is a shorthand property that sets all of the explicit and implicit grid properties in a single declaration.
...the sub-properties you don’t specify are set to their initial value, as normal for shorthands.
... also, the gutter properties are not reset by this shorthand.
...And 7 more matches
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
the overflow css shorthand property sets the desired behavior for an element's overflow — i.e.
... constituent properties this property is a shorthand for the following css properties: overflow-x overflow-y syntax /* keyword values */ overflow: visible; overflow: hidden; overflow: clip; overflow: scroll; overflow: auto; overflow: hidden visible; /* global values */ overflow: inherit; overflow: initial; overflow: unset; the overflow property is specified as one or two keywords chosen from the list of values below.
...otherwise, both overflow-x and overflow-y are set to the same value.
...And 7 more matches
pointer-events - CSS: Cascading Style Sheets
the pointer-events css property sets under what circumstances (if any) a particular graphic element can become the target of pointer events.
...siblefill; /* svg only */ pointer-events: visiblestroke; /* svg only */ pointer-events: visible; /* svg only */ pointer-events: painted; /* svg only */ pointer-events: fill; /* svg only */ pointer-events: stroke; /* svg only */ pointer-events: all; /* svg only */ /* global values */ pointer-events: inherit; pointer-events: initial; pointer-events: unset; the pointer-events property is specified as a single keyword chosen from the list of values below.
... none the element is never the target of pointer events; however, pointer events may target its descendant elements if those descendants have pointer-events set to some other value.
...And 7 more matches
Adding captions and subtitles to HTML5 video - Developer guides
"video/sintel-short.webm" type="video/webm"> <track label="english" kind="subtitles" srclang="en" src="captions/vtt/sintel-en.vtt" default> <track label="deutsch" kind="subtitles" srclang="de" src="captions/vtt/sintel-de.vtt"> <track label="español" kind="subtitles" srclang="es" src="captions/vtt/sintel-es.vtt"> </video> as you can see, each <track> element has the following attributes set: kind is given a value of subtitles, indicating the type of content the files contain label is given a value indicating which language that subtitle set is for — for example english or deutsch — these labels will appear in the user interface to allow the user to easily select which subtitle language they want to see.
... the default attribute is set on the english <track> element, indicating to the browser that this is the default subtitle file definition to use when subtitles have been turned on and the user has not made a specific selection.
...similar to the video controls, if a browser supports html5 video subtitles, there will be a button provided within the native control set to access them.
...And 7 more matches
Cross-browser audio basics - Developer guides
here's an example of creating an <audio> element, setting the media to play, playing and pausing, and then playing from 5 seconds into the audio: var myaudio = document.createelement('audio'); if (myaudio.canplaytype('audio/mpeg')) { myaudio.setattribute('src','audiofile.mp3'); } if (myaudio.canplaytype('audio/ogg')) { myaudio.setattribute('src','audiofile.ogg'); } alert('play'); myaudio.play(); alert('stop'); myaudio.pause(); alert('pla...
... myaudio.pause(); note: there is no stop method — to implement a stop function, you'd have to pause the media then set the currenttime property value to 0.
... currenttime the currenttime property gets or sets the current time the audio should play at.
...And 7 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
note: radio buttons are similar to checkboxes, but with an important distinction — radio buttons are grouped into a set in which only one radio button can be selected at a time, whereas checkboxes allow you to turn single values on and off.
... <fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding"> <label for="coding">coding</label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> </fieldset> in this example you will see that we've given each checkbox the same name.
...see the below example: <fieldset> <legend>choose your interests</legend> <div> <input type="checkbox" id="coding" name="interest" value="coding" checked> <label for="coding">coding</label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> </fieldset> providing a bigger hit area for your checkboxes in the above examples, you may have...
...And 7 more matches
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
value a domstring representing a telephone number, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, and size idl attributes list, selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), setselectionrange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an empty string ("").
...its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property.
...since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use).
...And 7 more matches
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
as this attribute is only used when rel="preload" or rel="prefetch" has been set on the <link> element.
... it specifies the type of content being loaded by the <link>, which is necessary for request matching, application of correct content security policy, and setting of correct accept request header.
... font css @font-face image <img> and <picture> elements with srcset or imageset attributes, svg <image> elements, css *-image rules object <object> elements script <script> elements, worker importscripts style <link rel=stylesheet> elements, css @import track <track> elements video <video> elements worker worker, sharedworker crossorigin this enumerated at...
...And 7 more matches
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
the above example demonstrates a number of features of <textarea>: an id attribute to allow the <textarea> to be associated with a <label> element for accessibility purposes a name attribute to set the name of the associated data point submitted to the server when the form is submitted.
...setting these is a good idea for consistency, as browser defaults can differ.
...if this attribute is not specified, the control inherits its setting from the containing element, for example <fieldset>; if there is no containing element when the disabled attribute is set, the control is enabled.
...And 7 more matches
Proxy - JavaScript
this example uses the set handler.
... let validator = { set: function(obj, prop, value) { if (prop === 'age') { if (!number.isinteger(value)) { throw new typeerror('the age is not an integer'); } if (value > 200) { throw new rangeerror('the age seems invalid'); } } // the default behavior to store the value obj[prop] = value; // indicate success return true; } }; const person = new proxy({}, validator); person.age = 100; console.log(person.age); // 100 person.age = 'young'; // throws an exception person.age = 300; // throws an exception extending constructor a function proxy could easily extend a constructor with a new constructor.
...here's how using the set handler.
...And 7 more matches
The building blocks of responsive design - Progressive web apps (PWAs)
border-box sizing the padding does not affect the overall width and height of the containers because we have set the box-sizing of all elements to border-box: *, *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } this basically means that width and height will now set the dimensions of an element all the way up to and including the border, not just the content.
... so if you set width: 40%, the box width will always be 40% of its parent, and any padding and border widths set on the box will be subtracted from the content width, not added to it.
...o through it in parts: @media all and (max-width: 480px) { x-card:nth-child(1), x-card:nth-child(2), x-card:nth-child(3) { width: 100%; float: none; padding: 0; } button { margin-top: 0; border-radius: 0; } x-card:nth-child(1) video, x-card:nth-child(2) img { border-radius: 0px; border: none; padding: 0; background-color: 0; } this first block resets a number of different things from the widescreen layouts that were't required for the mobile app.
...And 7 more matches
Index - XPath
WebXPathIndex
23 count xslt, xslt_reference the count function counts the number of nodes in a node-set and returns an integer.
... 25 document xslt, xslt_reference the document finds a node-set in an external document, or multiple external documents, and returns the resulting node-set.
... 31 generate-id xslt, xslt_reference the generate-id function generates a unique id for the first node in a given node-set and returns a string containing that id.
...And 7 more matches
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
the javascript loads the .xsl file only on the first sort and sets the xslloaded variable to true once it has finished loading the file.
...the sorting value is set using xsltprocessor.setparameter().
... 12 setting parameters xslt while running transformations using precoded .xsl and .xml files is quite useful, configuring the .xsl file from javascript may be even more useful.
...And 7 more matches
clipboard - Archive of obsolete content
interact with the system clipboard, setting and getting its contents.
... usage you can optionally specify the type of the data to set and retrieve.
... examples set and get the contents of the clipboard.
...And 6 more matches
console - Archive of obsolete content
for example, if the logging level is set to "info", then calls to info(), log(), warn(), and error() will all result in output being written.
... this means that the same code can be more verbose in a development environment than in a production environment - you just need to arrange for the appropriate logging level to be set.
... the complete set of logging levels is given in the table below, along with the set of functions that will result in output at each level: level will log calls to: all any console method debug debug(), error(), exception(), info(), log(), time(), timeend(), trace(), warn() info error(), exception(), info(), log(), time(), timeend(), trace(), warn() warn error(), exception(), warn() error error(), exception() off nothing setting the logging level the logging level defaults to "error".
...And 6 more matches
File I/O - Archive of obsolete content
the user's desktop directory (for example ~/desktop on linux or mac os x, c:\documents and settings\username\desktop on windows).
... profld f local settings on windows; where the network cache and fastload files are stored.
... progs d user start menu programs directory (for example, c:\documents and settings\username\start menu\programs).
...And 6 more matches
How to convert an overlay extension to restartless - Archive of obsolete content
t in jsm you'll need to fetch it from an interface: const xmlhttprequest = components.constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsixmlhttprequest"); here's how to load a file using it: function loadfile(url,type,returnresult) { var request = new xmlhttprequest(); request.open("get", url, true); // async=true request.responsetype = type; request.onerror = function(event) { logerrormessage("error attempting to load: " + url); returnresult(null); }; request.onload = function(event) { if (request.response) returnresult(request.response); else request.onerror(event); }; request.send(); } loadfile("chrome://myaddon/content/filename.ext",datatype,fun...
...ction(data) { /* do stuff with data */ }); note: when using xmlhttprequest to access a file:// url the request.status is not properly set to 200 to indicate success.
...if you're getting json this way make sure to explicitly set the type as "text" if you intend to parse it yourself.
...And 6 more matches
Adding windows and dialogs - Archive of obsolete content
it allows you to send a set of optional parameters that can be used to communicate with the dialog.
... the prompt service allows you to set the title of the dialog however you want it, and also lets you specify the window you want to use as a parent for the alert.
... this normally should be set to the current window.
...And 6 more matches
JavaScript Object Management - Archive of obsolete content
〈namespace〉.hello.init(); 〈namespace〉.hello["init"](); this is very useful in cases where you have to set attributes or functions with dynamically generated names.
...if you really need to do something like this anyway, one way to do it is to have a timeout execute the code after a delay: init : function(aevent) { let that = this; this._stringbundle = document.getelementbyid("xs-hw-string-bundle"); window.settimeout( function() { window.alert(that._stringbundle.getstring("xulschoolhello.greeting.label")); }, 0); } the settimeout function executes the function in the first parameter, after a delay in miliseconds specified by the second parameter.
... in this case we set the delay to 0, which means the function should be executed as soon as possible.
...And 6 more matches
Drag and Drop Example - Archive of obsolete content
we'll use some style properties to set the width and height of the stack.
...we'll create a listobserver object that will set the data to be dragged.
...var boardobserver = { getsupportedflavours : function () { var flavours = new flavourset(); flavours.appendflavour("text/unicode"); return flavours; }, ondragover: function (event, flavour, session) {}, ondrop: function (event, dropdata, session) { if (dropdata.data != "") { var elem = document.createelement(dropdata.data); event.target.appendchild(elem); elem.setattribute("left", "" + event.pagex); elem.setattribute("top", "" + event.pagey...
...And 6 more matches
Drag and Drop - Archive of obsolete content
the script in this handler should set up a drag session.
...an array is used because you might want to drag several objects at once, such as a set of files.
...this should usually be set to null.
...And 6 more matches
generateCRMFRequest() - Archive of obsolete content
finally, there are 1 or more sets of key generation arguments.
...acceptable values are (the mentioned values for keyusage pertain to the keyusage value of the certificate extension that will ultimately be in the issued certificate): "rsa-ex" - generate an rsa key for key exchange only (this will have eyencipherment set for keyusage.) "rsa-dual-use" - generate a single rsa key for both signing and encryption.
... (this will have digitalsignature, keyencipherment, and nonrepudiation set for keyusage.) "rsa-sign" - generate an rsa key for signing only.
...And 6 more matches
Venkman Internals - Archive of obsolete content
questions why can't breakpoints be set on some source lines some of the time?
...you can still set breakpoints, but they will be future breakpoints, which will be "real" breakpoints when/if the file is loaded (note that this may never happen!).
...gijskruitbosch 05:41, 7 march 2007 (pst) venkman-debugger.js sets hooks in to the jsdidebuggerservice.
...And 6 more matches
Anonymous Content - Archive of obsolete content
for content generated underneath the bound element, the topmost nodes' parentnode pointers are set to the bound element.
... when anonymous content elements are built above the bound element, the topmost elements' parentnode pointers are set to the bound element's parentnode.
... all anonymous nodes' ownerdocument pointers are set to the bound document at the time of generation.
...And 6 more matches
Introduction to XUL - Archive of obsolete content
the intention is to build cross-platform applications like browsers and mail clients from a set of tools designed for that purpose.
...we intend to provide a subset of cross-platform functionality suitable for building network applications like browsers, leveraging the cross-platform functionality already built into gecko, mozilla's html layout engine.
... mozilla applications will be built of "small" components like dialog buttons and mail inbox folders, which we collectively term "widgets." within a widget, drawing and user interactions are completely under control of the individual widget, and set when the widget was built.
...And 6 more matches
ContextMenus - Archive of obsolete content
<window id="main-window"> <popupset> <menupopup id="ins-del-menu"> <menuitem label="insert"/> <menuitem label="delete"/> </menupopup> </popupset> </window> <grid context="ins-del-menu"> <columns> <column/> <column flex="1"/> </columns> <rows id="rows"> <row align="center"> <label value="name:"/> <textbox/> </row> </rows> </grid> the same context menu can be attached to mu...
...just set the context attribute on those elements you want the context menu to apply to.
... <menupopup id="link-menu"> <menuitem label="open link" default="true"/> <menuitem label="open in new window"/> <menuitem label="properties"/> </menupopup> the default attribute has been set to true on the first menu item ('open link').
...And 6 more matches
Positioning - Archive of obsolete content
context menus will appear offset down and to the right a couple of pixels so that the menu can be dismissed again just by clicking in the same place.
... tooltips will always appear near the current mouse position, offset vertically by a small amount.
...the menu appears at the mouse position offset by a couple of pixels so that the user can close the context menu just by clicking in the same location.
...And 6 more matches
Building Trees - Archive of obsolete content
ction> <treechildren> <treeitem uri="?"> <treerow> <treecell label="?subject"/> <treecell label="?sender"/> <treecell label="?date"/> </treerow> </treeitem> </treechildren> </action> </template> </tree> features of the tree builder besides the label of a cell, there are several other cell properties you can set when using the tree builder.
...the label attribute is used to set the label for a cell.
...it may be set to either “normal” for a normal progress meter or “undetermined” for an undetermined progress meter.
...And 6 more matches
Multiple Queries - Archive of obsolete content
to use multiple queries, place each query element along with its rules inside a queryset element.
... the queryset element is a bit of a misnomer, it actually only contains one query each.
... the following is the basic structure of a template with multiple queries: <listbox datasources="..." ref="..."> <queryset> <query> ...
...And 6 more matches
Special Condition Tests - Archive of obsolete content
note the parent attribute on the rule element, set to the value vbox.
...to do this kind of matching, you again place a parent attribute on the rule, set to the tag to match.
...the iscontainer attribute should be set to true if you only want to match containers, and false if you only want to match non-containers.
...And 6 more matches
Input Controls - Archive of obsolete content
disabled set to true to have text entry disabled.
... textbox.type you can set this attribute to the special value password to create a textbox that hides what it types.
...if you set the multiline attribute to true, the text entry field will display multiple rows.
...And 6 more matches
Install Scripts - Archive of obsolete content
you can also set files to be moved and deleted.
...the registry also stores the set of files and version information about the installed components.
...what you do need to know for an installation is that the registry stores a set of information about your application, such as the file list and versions.
...And 6 more matches
XUL Questions and Answers - Archive of obsolete content
using the "icon" attribute on a button from xulplanet.com reference: this attribute should be used to set the usage for common buttons.
... to set the background color you need to set the property for the cell/row and not for the item.
... an example of this is: var tree = document.getelementbyid('treeid'); selectedtreeitem = tree.view.getitematindex(tree.currentindex); selectedtreeitem.firstchild.setattribute('style', 'background: #ff0000'); what is an example of tab browser in xul?
...And 6 more matches
editor - Archive of obsolete content
set the value of the editortype attribute to html to create an editor document.
...if you do not set the editortype attribute on an editor, you must enable editing using the makeeditable method.
...to enable editing on an editor, do either of the following: set the src attribute on the editor after the outer window has loaded, for example, in the onload handler.
...And 6 more matches
menupopup - Archive of obsolete content
there are several ways in which a menupopup may be used: it may be placed inside a menu, menulist, toolbarbutton, or a button with the type attribute set to "menu" to create a popup that will open when the menu or button is pressed.
... attributes ignorekeys, left, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position, top properties accessibletype, anchornode, popupboxobject, position, state, triggernode methods hidepopup, moveto, openpopup, openpopupatscreen, setconsumerollupevent, showpopup, sizeto examples the following example shows how a menupopup may be attached to a menulist.
...this handler is usually used to dynamically set the contents when the user requests to display it.
...And 6 more matches
progressmeter - Archive of obsolete content
in addition, an indeterminate progressmeter may be created by setting the mode attribute to undetermined.
... attributes max, mode, value properties accessibletype, max, mode, value examples <progressmeter mode="determined" value="82"/> <progressmeter mode="undetermined"/> <!-- switching modes while the mouse is over a button --> <progressmeter mode="determined" id="myprogress"/> <button label="example" onmouseover="setloading(true)" onmouseout="setloading(false)"/> function setloading(state){ document.getelementbyid('myprogress').mode = (state) ?
...for instance, if no maximum value has been set, setting the value to "0" shows an empty bar, "100" shows a bar at full length and "25" shows the first quarter of the bar.
...And 6 more matches
NPAPI plugin reference - Archive of obsolete content
npclass npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e.
... npn_setexception a plugin can call this function to indicate that a call to one of the plugin's npobjects generated an error.
... npn_setproperty sets the value of a property on the specified npobject.
...And 6 more matches
Examples - Archive of obsolete content
--> <!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>problem 1 - &lt; in xhtml</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <script type="text/javascript"> var i = 0; while (++i > 10) { // ...
...l> back to the article problem 2 <!-- 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>problem 2 - comments in xhtml</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <style type="text/css"> <!-- body {background-color: blue; color: yellow; } --> </style> <script type="text/javascript"> <!-- var i = 0; var sum = 0; for (i = 0; i < 10; ++i) { sum += i; } alert('sum = ' + sum); // --> </script> </head> <body> <h1>problem 2 - comments in xhtml</h1> <p> this document is valid xhtml 1.0 strict served ...
...--> <!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>problem 3 - comments in xml</title> <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" /> <script type="text/javascript"> var i; var sum = 0; for (i = 10; i > 0; --i) { sum += i; } </script> </head> <body> <h1>problem 3 - comments in xhtml</h1> <p> this document is not well formed xhtml due to the double dash contained in the comment.
...And 6 more matches
Anatomy of a video game - Game development
render(); } main(); // start the cycle })(); if the maximum refresh rate cannot be reached, quality settings could be adjusted to stay under your time budget.
...if computation took too long then rendered resolution would decrease, textures and other assets would fail to load or draw, and so forth.
... giving the user control over quality settings would be a nightmare.
...And 6 more matches
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.
... var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); var knotbbox = new box3(new three.vector3(), new three.vector3()); knotbbox.setfromobject(knot); instantiating spheres instantiating sphere objects is similar.
... var knot = new three.mesh( new three.torusknotgeometry(0.5, 0.1), new meshnormalmaterial({})); var knotbsphere = new sphere( knot.position, knot.geometry.boundingsphere.radius); unfortunately, there is no equivalent of box3.setfromobject for sphere instances.
...And 6 more matches
GLSL Shaders - Game development
the purpose of the vertex shader is to set up the gl_position variable — this is a special, global, and built-in glsl variable.
...the purpose of the fragment shader is to set up the gl_fragcolor variable.
... environment setup to start with the webgl shaders you don't need much.
...And 6 more matches
Implementing controls using the Gamepad API - Game development
next, we set up two event listeners to get the data: window.addeventlistener("gamepadconnected", gamepadapi.connect); window.addeventlistener("gamepaddisconnected", gamepadapi.disconnect); due to security policy, you have to interact with the controller first while the page is visible for the event to fire.
...we then set the turbo property to true.
... (we could use the gamepad.connected boolean for this purpose, but we wanted to have a separate variable for turning on turbo mode without needing to have a gamepad connected, for reasons explained above.) disconnect: function(evt) { gamepadapi.turbo = false; delete gamepadapi.controller; console.log('gamepad disconnected.'); }, the disconnect function sets the gamepad.turbo property to false and removes the variable containing the gamepad object.
...And 6 more matches
Plug-in Development Overview - Gecko Plugin API Reference
set up your development environment properly.
... for this the version stamp of the embedded resource of the plug-in dll should contain the following set of string/value pairs: mimetype: for mime types fileextents: for file extensions fileopenname: for file open template productname: for plug-in name filedescription: for description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will...
... be loaded only if it has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment.
...And 6 more matches
Sizing items in CSS - Learn web development
the natural or intrinsic size of things html elements have a natural size, set before they are affected by any css.
... setting a specific size we can of course give elements in our design a specific size.
...as we discovered in our previous lesson on overflow, a set height can cause content to overflow if there is more content than the element has space to fit inside it.
...And 6 more matches
Styling tables - Learn web development
table-layout: fixed; width: 100%; border-collapse: collapse; border: 3px solid purple; } thead th:nth-child(1) { width: 30%; } thead th:nth-child(2) { width: 20%; } thead th:nth-child(3) { width: 15%; } thead th:nth-child(4) { width: 35%; } th, td { padding: 20px; } the most important parts to note are as follows: a table-layout value of fixed is generally a good idea to set on your table, as it makes the table behave a bit more predictably by default.
...this is why we've selected the four different headings with the thead th:nth-child(n) (:nth-child) selector ("select the nth child that is a <th> element in a sequence, inside a <thead> element") and given them set percentage 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 head...
...And 6 more matches
What are browser developer tools? - Learn web development
these tools do a range of things, from inspecting currently-loaded html, css and javascript to showing which assets the page has requested and how long they took to load.
... find out more find more out about the inspector in different browsers: firefox page inspector ie dom explorer chrome dom inspector (opera's inspector works the same as this) safari dom inspector and style explorer the javascript debugger the javascript debugger allows you to watch the value of variables and set breakpoints, places in your code that you want to pause execution and identify the problems that prevent your code from executing properly.
... source code set breakpoints where you want to pause execution.
...And 6 more matches
Images in HTML - Learn web development
if you set the image size too big, you'll end up with images that look grainy, fuzzy, or too small, and wasting bandwidth downloading an image that is not fitting the user's needs.
... set the image's correct width and height (hint: it is 200px wide and 171px high), then experiment with other values to see what the effect is.
... set a title on the image.
...And 6 more matches
From object to iframe — other embedding technologies - Learn web development
these were embedded in a master document called a frameset, which allowed you to specify the area on the screen that each frame filled, rather like sizing the columns and rows of a table.
... if you make a mistake, you can always reset it using the reset button.
... playable code <h2>live output</h2> <div class="output" style="min-height: 250px;"> </div> <h2>editable code</h2> <p class="a11y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="input" style="width: 95%;min-height: 100px;"> </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); cons...
...And 6 more matches
Working with JSON - Learn web development
next, add the following two lines — here we are setting the responsetype to json, so that xhr knows that the server will be returning json, and that this should be converted behind the scenes into a javascript object.
... then we send the request with the send() method: request.responsetype = 'json'; request.send(); the last bit of this section involves waiting for the response to return from the server, then dealing with it.
...here we first create an <h1> element with createelement(), set its textcontent to equal the squadname property of the object, then append it to the header using appendchild().
...And 6 more matches
Getting started with Ember - Learn web development
previous overview: client-side javascript frameworks next in our first ember article we will look at how ember works and what it's useful for, install the ember toolchain locally, create a sample app, and then do some initial setup to get it ready for development.
...in ember, opinions are a set of conventions that help increase the efficiency of developers at the cost of having to learn those conventions.
...most importantly, it is a superset of html — meaning that anyone who knows html can make meaningful contributions to any ember project with minimal fear of breaking code.
...And 6 more matches
Deployment and next steps - Learn web development
set up and deploy “./mdn-svelte-tutorial”?
..../ auto-detected project settings (svelte): - build command: `npm run build` or `rollup -c` - output directory: public - development command: sirv public --single --dev --port $port ?
... want to override the settings?
...And 6 more matches
Styling Vue components with CSS - Learn web development
to start with, create a file called reset.css in the src/assets directory.
... while this tutorial will not be using such tools, it's good to know that when including such code in the assets folder it will be processed automatically.
... add the following contents to the reset.css file: /*reset.css*/ /* resets */ *, *::before, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: transparent; color: inherit; font: inherit; line-height: normal; -webkit-font-smoothing: inherit; -moz-osx-font-smoothing: inherit; -webkit-appearance: none; } button::-moz-focus-inner { border: 0; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; line-height: 1.15; margin: 0; } button, input { /* 1 */ overflow: visible; } input[type="text"] { bo...
...And 6 more matches
Understanding client-side JavaScript frameworks - Learn web development
in this set of articles, we are aiming to give you a comfortable starting point to help you begin learning frameworks.
...we'll discover a little bit of detail about its background and use cases, set up a basic react toolchain on our local computer, and create and play with a simple starter app, learning a bit about how react works in the process.
...getting started with ember in our first ember article we will look at how ember works and what it's useful for, install the ember toolchain locally, create a sample app, and then do some initial setup to get it ready for development.
...And 6 more matches
Handling common HTML and CSS problems - Learn web development
previous overview: cross browser testing next with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur.
...you can still refer to them by their names, and style them with css, for example — you just need to make sure they are behaving as you want them to, for example setting display: block; on all of the new semantic elements (such as <article>, <aside>, etc.), but only in old versions of ie that don't recognise them (so, ie 8 and lower).
... background-color: #ff0000; background-color: rgba(255,0,0,1); box-shadow: inset 1px 1px 3px rgba(255,255,255,0.4), inset -1px -1px 3px rgba(0,0,0,0.4); } button:hover { background-color: rgba(255,0,0,0.5); } button:active { box-shadow: inset 1px 1px 3px rgba(0,0,0,0.4), inset -1px -1px 3px rgba(255,255,255,0.4); } here we are providing an rgba background-color that changes opacity on hover to give the user a hint that the button is interact...
...And 6 more matches
Adding a new CSS property
(which set the property is in is given in the specification, which says "inherited: yes" or "inherited: no" in the property's definition.) also note that some of the style structs intentionally contain only properties set/reset by a particular common shorthand property; this improves the effectiveness of some of the performance and memory optimizations done with the rule tree, and thus we should avoid addi...
...ng a property not reset by that shorthand to such a struct.
... if the property's values can be expressed as a single value, or as a space-separated or comma-separated list of values that can be described by the variant_* flags (also in nscssprops.h), you should use css_property_parse_value or css_property_parse_value_list, and set the appropriate variant_* flags in the entry in nscssproplist.h (and maybe also css_property_value_list_uses_commas).
...And 6 more matches
Download
this property can become true, then it can be reset to false when a canceled download is restarted.
... error read only downloaderror when the download fails, this is set to a downloaderror instance indicating the cause of the failure.
...this property is reset to null when a failed download is restarted.
...And 6 more matches
NetUtil.jsm
method overview nsiasyncstreamcopier asynccopy(nsiinputstream asource, nsioutputstream asink, [optional] acallback) void asyncfetch(asource, acallback) nsichannel newchannel(awhattoload, [optional] aorigincharset, [optional] nsiuri abaseuri) nsiuri newuri(atarget, [optional] aorigincharset, [optional] nsiuri abaseuri) string readinputstreamtostring(ainputstream, acount, aoptions) attributes attribute type description ioservice nsiioservice returns a reference to nsiioservice.
... createinstance(ci.nsistringinputstream); istream.setdata(test_data, test_data.length); netutil.asynccopy(istream, ostream, function(aresult) { if (!components.issuccesscode(aresult)) { // an error occurred!
...}); remarks note: if you specify an nsichannel as the input source, and its notification callbacks have already been set, callers are responsible for implementing nsibadcertlistener and nsisslerrorlistener.
...And 6 more matches
Bootstrapping a new locale
when a localization team is registered and your hg repository is set up for a locale, you can then clone the existing mozilla release branch (i.e.
...boutrobots.dtd places aboutsessionrestore.dtd preferences aboutsupport.dtd quitdialog.properties basemenuoverlay.dtd safemode.dtd browser.dtd safebrowsing browser.properties sanitize.dtd credits.dtd search.properties enginemanager.dtd searchbar.dtd enginemanager.properties setdesktopbackground.dtd feeds shellservice.properties history sidebar migration tabbrowser.dtd openlocation.dtd tabbrowser.properties openlocation.properties as a localizer, you are responsible for localizing each of the ".dtd" and ".properties" in *all* of the sub-directories found in your ab-cd directory.
... the l10n-drivers will help set up an experimental hg repository in bit bucket.
...And 6 more matches
Localizing with Koala
due to a bug in koala (bug 21930), it is recommended that you don't choose a path that contains spaces (like c:\documents and settings\user\...).
...setup wizard will open.
...the easy way involves opening the console and issuing the following commands: c:\users\stas> cd c:\mozilla\l10n\application\firefox c:\mozilla\l10n\application\firefox> rmdir 3.6 c:\mozilla\l10n\application\firefox> hg clone http://hg.mozilla.org/releases/mozilla-1.9.2 3.6 requesting all changes adding changesets adding manifests adding file changes added 33099 changesets with 158636 changes to 50664 files (+9 heads) updating working directory 40357 files updated, 0 files merged, 0 files removed, 0 files unresolved configure the locale locale id: x-testing (put your locale's code) version: 3.6 location: choose the folder where you want to keep the localized files or leave empty for now check "mercur...
...And 6 more matches
Refcount tracing and balancing
refcount tracing logs calls to addref and release, preferably for a particular set of classes, including call-stacks in symbolic form (on platforms that support this).
... note: due to an issue with the sandbox on windows (bug 1345568), refcount logging currently requires the moz_disable_content_sandbox environment variable to be set.
... xpcom_mem_refcnt_log setting this environment variable enables refcount tracing.
...And 6 more matches
PRTimeParameters
syntax #include <prtime.h> typedef struct prtimeparameters { print32 tp_gmt_offset; print32 tp_dst_offset; } prtimeparameters; description each geographic location has a standard time zone, and if daylight saving time (dst) is practiced, a daylight time zone.
... the prtimeparameters structure represents the local time zone information in terms of the offset (in seconds) from gmt.
... the overall offset is broken into two components: tp_gmt_offset the offset of the local standard time from gmt.
...And 6 more matches
PR_Seek
moves the current read-write file pointer by an offset expressed as a 32-bit integer.
... syntax #include <prio.h> print32 pr_seek( prfiledesc *fd, print32 offset, prseekwhence whence); parameters the function has the following parameters: fd a pointer to a prfiledesc object.
... offset a value, in bytes, used with the whence parameter to set the file pointer.
...And 6 more matches
PR_Seek64
moves the current read-write file pointer by an offset expressed as a 64-bit integer.
... syntax #include <prio.h> print64 pr_seek64( prfiledesc *fd, print64 offset, prseekwhence whence); parameters the function has the following parameters: fd a pointer to a prfiledesc object.
... offset a value, in bytes, used with the whence parameter to set the file pointer.
...And 6 more matches
nss tech note2
it works by inserting a special set of entry points between nss and the module.
... to enable the module logger, you must set the environment variable nss_debug_pkcs11_module to the name of the target module.
...for example, to log the softoken on windows, use: set nss_debug_pkcs11_module=nss internal pkcs #11 module the logger is available by default in debug builds.
...And 6 more matches
Property cache
the opcodes that take advantage of the property cache, as of june 2009, are: getprop, get{x,this,arg,local}prop, and length; name; setprop, bindname, and setname; callprop and callname; and {inc,dec}name and name{inc,dec}.
...to be more precise regarding property specs, y's properties have the same names, getters, setters, property attributes, and slot offsets, and they are in the same order, as x's properties at t0.
...(the existence of this property is guaranteed by the basic layout guarantee above.) (informally: two objects with the same shape have the same method properties.) branded object guarantee — if at time t0 the object x has shape s; and x is branded (x->branded()); and x has an own property p, which is a writable, function-valued data property with the stub getter and setter and a slot; and at time t1 an object y has shape s; and no shape-regenerating gc occurred; then y is x, and at time t1 x's own property p has the same function value it had at time t0.
...And 6 more matches
JSClass
syntax struct jsclass { const char *name; uint32_t flags; /* optional since spidermonkey 37 */ jspropertyop addproperty; jsdeletepropertyop delproperty; jspropertyop getproperty; jsstrictpropertyop setproperty; jsenumerateop enumerate; jsresolveop resolve; jsconvertop convert; /* obsolete since spidermonkey 44 */ /* optional since spidermonkey 25 */ jsfinalizeop finalize; /* optional */ jsclassinternal reserved0; /* obsolete since spidermonkey 13 */ jscheckaccessop checkaccess; /* obsolete since spidermonkey 29 */ ...
... setproperty jsstrictpropertyop a hook called when setting a property.
... this is the default setter for the class.
...And 6 more matches
mozIStorageStatement
n autf8string asqlstatement); obsolete since gecko 1.9.1 void finalize(); mozistoragestatement clone(); autf8string getparametername(in unsigned long aparamindex); unsigned long getparameterindex(in autf8string aname); autf8string getcolumnname(in unsigned long acolumnindex); unsigned long getcolumnindex(in autf8string aname); void reset(); astring escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindingparamsarray newbindingparamsarray(); void bindutf8stringparameter(in unsigned long aparamindex, in autf8string avalue); void bindstringparameter(in unsigned long aparamindex, in astring avalue);...
... params mozistoragestatementparams the current list of named parameters, which may be set.
... reset() resets the bound parameters and statement execution state.
...And 6 more matches
nsICachingChannel
the value of this attribute is usually only settable during the processing of a channel's onstartrequest.
...the value of this attribute should be set before opening the channel.
...a cache key retrieved from a particular instance of nsicachingchannel could be set on another instance of nsicachingchannel provided the underlying implementations are compatible and provided the new channel instance was created with the same uri.
...And 6 more matches
nsIContentViewer
void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports astate, in nsishentry ashentry); void pagehide(in boolean isunload); boolean permitunload([optional] in boolean acallercloseswindow); boolean requestwindowclose(); void resetclosewindow(); void setbounds([const] in nsintrectref abounds); native code only!
... void setdocumentinternal(in nsidocumentptr adocument, in boolean aforcereuseinnerwindow); native code only!
... [noscript,notxpcom,nostdcall] void setnavigationtiming(in nsdomnavigationtimingptr atiming); void setpagemode(in boolean apagemode, in nsiprintsettings aprintsettings); void show(); void stop(); void unload(); obsolete since gecko 1.8 attributes attribute type description container nsisupports domdocument nsidomdocument enablerendering boolean obsolete since gecko 2.0 historyentry nsishentry get the history entry that this viewer will save itself into when destroyed.
...And 6 more matches
nsIFile
an alternate form operates on characters strings encoded in the "native" charset.
... a string containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect.
... void normalize(); file openansifiledesc(in string mode); prfiledescstar opennsprfiledesc(in long flags, in long mode); void renameto(in nsifile newparentdir, in astring newname); void remove(in boolean recursive); void reveal(); void setrelativedescriptor(in nsifile fromfile, in acstring relativedesc); attributes attribute type description directoryentries nsisimpleenumerator returns an enumeration of the elements in a directory.
...And 6 more matches
nsIHttpServer
*/ void registercontenttype(in string extension, in string type); /** * sets the handler used to display the contents of a directory if * the directory contains no index page.
... * * @param handler * an object which will handle any requests for directories which * do not contain index pages, or null to reset to the default * index handler; if while the server is running the handler * throws an exception while responding to a request, an http 500 * response will be returned.
... */ void setindexhandler(in nsihttprequesthandler handler); /** represents the locations at which this server is reachable.
...And 6 more matches
nsIIOService
netwerk/base/public/nsiioservice.idlscriptable this interface provides a set of url parsing utility functions.
... .getservice(components.interfaces.nsiioservice); method overview boolean allowport(in long aport, in string ascheme); acstring extractscheme(in autf8string urlstring); unsigned long getprotocolflags(in string ascheme); nsiprotocolhandler getprotocolhandler(in string ascheme); nsichannel newchannel(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); obsolete since gecko 48 nsichannel newchannel2(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri, in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsichannel newchannelfromuri(in nsiuri auri); obsolete since gecko 48 ns...
...loadinfo); nsichannel newchannelfromuriwithproxyflags2(in nsiuri auri, in nsiuri aproxyuri, in uint32_t aproxyflags,in nsidomnode aloadingnode, in nsiprincipal aloadingprincipal, in nsiprincipal atriggeringprincipal, in uint32_t asecurityflags, in uint32_t acontentpolicytype); nsiuri newfileuri(in nsifile afile); nsiuri newuri(in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description offline boolean returns true if networking is in "offline" mode.
...And 6 more matches
nsIPrefService
inherits from: nsisupports last changed in gecko 1.7 method overview nsiprefbranch getbranch(in string aprefroot); nsiprefbranch getdefaultbranch(in string aprefroot); void readuserprefs(in nsifile afile); void resetprefs(); void resetuserprefs(); void savepreffile(in nsifile afile); methods getbranch() call to get a preferences "branch" which accesses user preference data.
... using a set method on this object will always create or set a user preference value.
... when using a get method a user set value will be returned if one exists, otherwise a default value will be returned.
...And 6 more matches
nsIScriptableIO
classes["@mozilla.org/io/scriptable-io;1"] .getservice(); scriptableio.getfile("profile", "cookies.txt"); method overview nsifile getfile(in astring alocation, in astring afilename); nsifile getfilewithpath(in astring afilepath); nsisupports newinputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize); nsisupports newoutputstream(in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize, [optional] in unsigned long apermissions); nsiuri newuri(in nsivariant auri); methods getfile() retriev...
... nsisupports newinputstream( in nsivariant abase, in astring amode, [optional] in astring acharset, [optional] in astring areplacechar, [optional] in unsigned long abuffersize ); parameters abase the base object from which to read.
...the default character set is utf-8; to read text in another character set, set the acharset argument to the desired character set.
...And 6 more matches
nsIScrollable
thod overview long getcurscrollpos(in long scrollorientation); obsolete since gecko 29.0 long getdefaultscrollbarpreferences(in long scrollorientation); void getscrollbarvisibility(out boolean verticalvisible, out boolean horizontalvisible); void getscrollrange(in long scrollorientation, out long minpos, out long maxpos); obsolete since gecko 29.0 void setcurscrollpos(in long scrollorientation, in long curpos); obsolete since gecko 29.0 void setcurscrollposex(in long curhorizontalpos, in long curverticalpos); obsolete since gecko 29.0 void setdefaultscrollbarpreferences(in long scrollorientation, in long scrollbarpref); void setscrollrange(in long scrollorientation, in long minpos, in long maxpos); obsolete since gecko 29...
....0 void setscrollrangeex(in long minhorizontalpos, in long maxhorizontalpos, in long minverticalpos, in long maxverticalpos); obsolete since gecko 29.0 constants scroll orientations scroll orientations a scrollbar can be in.
...when passing this in to a method you are requesting or setting data for the horizontal scrollbar.
...And 6 more matches
nsIXULTemplateBuilder
the structure of a template is as follows: <rootnode datasources="" ref=""> <template> <queryset> <query></query> <rule> <conditions>...</conditions> <bindings>...</bindings> <action>...</action> </rule> </queryset> </template> </rootnode> the datasources attribute on the root node is used to identify the source of data to be used.
...the <queryset> element contains a single query and one or more <rule> elements.
... there may be more than one <queryset> if multiple queries are desired, and this element is optional if only one query is needed -- in that case the <query> and <rule>s are allowed to be children of the <template> node.
...And 6 more matches
Mail composition back end
this can be set for the various modes of delivery.
... nsimessage *msgtoreplace, - if the delivery mode is set to nsmsgsaveasdraft, this is a pointer to the the nsimessage object for the message that needs to be replaced const char *attachment1_type, const char *attachment1_body, pruint32 attachment1_body_length, - the full text of the first attachment is provided via `attachment1_type' `attachment1_body' and `attachment1_body_length'.
...this can be set for the various modes of delivery.
...And 6 more matches
Plug-in Development Overview - Plugins
set up your development environment properly.
... for this the version stamp of the embedded resource of the plug-in dll should contain the following set of string/value pairs: mimetype: for mime types fileextents: for file extensions fileopenname: for file open template productname: for plug-in name filedescription: for description language: for language in use in the mime types and file extensions strings, multiple values are separated by the "|" character, for example: video/quicktime|audio/aiff|image/jpeg the version stamp will...
... be loaded only if it has been created with the language set to "us english" and the character set to "windows multilingual" in your development environment.
...And 6 more matches
Use watchpoints - Firefox Developer Tools
by setting a watchpoint on the property, rather than a breakpoint at a particular line, you can discover where that access occurs.
... there are three types of watchpoints: get, set, and get or set.
... a get watchpoint pauses whenever a property is read; a set watchpoint pauses whenever a property value changes; a get or set watchpoint pauses whenever a property value is accessed in either way.
...And 6 more matches
Debugger.Memory - Firefox Developer Tools
allocation site tracking the javascript engine marks each new object with the call stack at which it was allocated, if: the object is allocated in the scope of a global object that is a debuggee of some debugger instancedbg; and dbg.memory.trackingallocationsites is set to true.
... allocation logging ifdbg is a debugger instance, and dbg.memory.trackingallocationsites is set to true, then the javascript engine logs each object allocated bydbg’s debuggee code.
...you can control the limit on the log’s size by setting dbg.memory.maxallocationsloglength.
...And 6 more matches
Debugger.Object - Firefox Developer Tools
the referent’s properties do not appear directly as properties of the debugger.object instance; the debugger can access them only through methods like debugger.object.prototype.getownpropertydescriptor and debugger.object.prototype.defineproperty, ensuring that the debugger will not inadvertently invoke the referent’s getters and setters.
... once a promise is settled, it will generally notify its dependent promises and forget about them, so this is most useful on pending promises.
... promisetimetoresolution if the referent is a promise, this is the number of milliseconds elapsed between when the promise was created and when it was resolved.
...And 6 more matches
AudioParam - Web APIs
an audioparam can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern.
... audioparam.value represents the parameter's current value as of the current time; initially set to the value of defaultvalue.
... methods audioparam.setvalueattime() schedules an instant change to the value of the audioparam at a precise time, as measured against audiocontext.currenttime.
...And 6 more matches
Constraint validation API - Web APIs
concepts and usage certain html form controls, such as <input>, <select> and <textarea>, can restrict the format of allowable values, using attributes like required and pattern to set basic constraints.
... extensions to other interfaces the constraint validation api extends the interfaces for the form-associated elements listed below with a number of new properties and methods (elements that can have a form attribute that indicates their form owner): htmlbuttonelement htmlfieldsetelement htmlinputelement htmlobjectelement htmloutputelement htmlselectelement htmltextareaelement properties validity a read-only property that returns a validitystate object, whose properties represent validation errors for the value of that element.
...this will be displayed in the ui if the element is the only form control with a validity problem; if a custom error message is set using setcustomvalidity(), this will be shown.
...And 6 more matches
Document.cookie - Web APIs
WebAPIDocumentcookie
it serves as a getter and setter for the actual values of the cookies.
...note that you can only set/update a single cookie at a time using this method.
... consider also that: any of the following cookie attribute values can optionally follow the key-value pair, specifying the cookie to set/update, and preceded by a semi-colon separator: ;path=path (e.g., '/', '/mydir') if not specified, defaults to the current path of the current document location.
...And 6 more matches
ElementCSSInlineStyle.style - Web APIs
the style property is used to get as well as set the inline style of an element.
...the style property has the same (and highest) priority in the css cascade as an inline style declaration set via the style attribute.
... setting styles styles should not be set by assigning a string directly to the style property (as in elt.style = "color: blue;"), since it is considered read-only, as the style attribute returns a cssstyledeclaration object which is also read-only.
...And 6 more matches
ImageCapture.takePhoto() - Web APIs
syntax const blobpromise = imagecaptureobj.takephoto([photosettings]) parameters photosettings optional an object that sets options for the photo to be taken.
... the available options are: filllightmode: the flash setting of the capture device, one of "auto", "off", or "flash".
...the user agent selects the closest height value to this setting if it only supports discrete heights.
...And 6 more matches
Basic concepts - Web APIs
dom events always have a type property (in indexeddb, it is most commonly set to "success" or "error").
...it uses queries on an index that produces a cursor, which you use to iterate across the result set.
...each origin has its own associated set of databases.
...And 6 more matches
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
if the key is held down further and the key produces a character key, then the event continues to be emitted in a platform implementation dependent interval and the keyboardevent.repeat read only property is set to true.
... if the key produces a character key that would result in a character being inserted into possibly an <input>, <textarea> or an element with htmlelement.contenteditable set to true, the beforeinput and input event types are fired in that order.
... in sequence 1 & 3, the keyboardevent.key attribute is defined and is set appropriately to a value according to the rules defined ealier.
...And 6 more matches
Media Session API - Web APIs
for example, to set the current state of the media session to playing: navigator.mediasession.playbackstate = "playing"; interfaces mediametadata allows a web page to provide rich media metadata, for display in a platform ui.
... mediapositionstate used to contain information about the current playback position, playback speed, and overall media duration when calling the mediasession method setpositionstate() to establish the media's length, playback position, and playback speed.
...e: 'image/png' }, { src: 'https://dummyimage.com/192x192', sizes: '192x192', type: 'image/png' }, { src: 'https://dummyimage.com/256x256', sizes: '256x256', type: 'image/png' }, { src: 'https://dummyimage.com/384x384', sizes: '384x384', type: 'image/png' }, { src: 'https://dummyimage.com/512x512', sizes: '512x512', type: 'image/png' }, ] }); navigator.mediasession.setactionhandler('play', function() { /* code excerpted.
...And 6 more matches
SVGAngle - Web APIs
WebAPISVGAngle
setting this attribute will cause valueinspecifiedunits and valueasstring to be updated automatically to reflect this setting.
... exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only.
...setting this attribute will cause value and valueasstring to be updated automatically to reflect this setting.
...And 6 more matches
SVGLength - Web APIs
WebAPISVGLength
xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and cm units console.log("value: " + val.value + ", valueinspecifiedunits: " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); // set x = 20pt and read it out in pixel and pt units val.newvaluespecifiedunits(svglength.svg_lengthtype_pt, 20); console.log("value: " + val.value + ", valueinspecifiedunits " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring: " + val.valueasstring); // convert x = 20pt to inches and read out in pixel and inch units val.converttospecifiedunits(svgle...
...setting this attribute will cause valueinspecifiedunits and valueasstring to be updated automatically to reflect this setting.
... exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read only attribute or when the object itself is read only.
...And 6 more matches
WebGL constants - Web APIs
each set of two vertices is treated as a separate line segment.
...each set of three vertices creates a separate triangle.
... constant name value description func_add 0x8006 passed to blendequation or blendequationseparate to set an addition blend function.
...And 6 more matches
Writing a WebSocket server in C# - Web APIs
networkstream methods: write(byte[] buffer, int offset, int size) writes bytes from buffer, offset and size determine length of message.
... read(byte[] buffer, int offset, int size) reads bytes to buffer.
... offset and size determine the length of the message.
...And 6 more matches
Functions and classes available to Web Workers - Web APIs
in addition to the standard javascript set of functions (such as string, array, object, json, etc), there are a variety of functions available from the dom to workers.
...cope yes, on workerglobalscope yes, on workerglobalscope yes, on window cleartimeout() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window dump() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window setinterval() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window settimeout() yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on workerglobalscope yes, on window importscripts() yes, on workerglobalscope yes, on workerglobalscope yes, on worke...
...the specifics of how it works vary from browser to browser, but there is a de facto set of features that are typically provided.
...And 6 more matches
HTML in XMLHttpRequest - Web APIs
also, html support is only available if the responsetype property has been set to "document".
... this limitation avoids wasting time parsing html uselessly when legacy code uses xmlhttprequest in the default mode to retrieve responsetext for text/html resources.
... usage retrieving an html resource as a dom using xmlhttprequest works just like retrieving an xml resource as a dom using xmlhttprequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the responsetype property of the xmlhttprequest object after calling open() but before calling send().
...And 6 more matches
Sending and Receiving Binary Data - Web APIs
receiving binary data using javascript typed arrays the responsetype property of the xmlhttprequest object can be set to change the expected response type from the server.
...the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string.
... var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "arraybuffer"; oreq.onload = function (oevent) { var arraybuffer = oreq.response; // note: not oreq.responsetext if (arraybuffer) { var bytearray = new uint8array(arraybuffer); for (var i = 0; i < bytearray.bytelength; i++) { // do something with each byte in the array } } }; oreq.send(null); you can also read a binary file as a blob by setting the string "blob" to the responsetype property...
...And 6 more matches
Synchronous and asynchronous requests - Web APIs
var xhr = new xmlhttprequest(); xhr.open("get", "/bar/foo.txt", true); xhr.onload = function (e) { if (xhr.readystate === 4) { if (xhr.status === 200) { console.log(xhr.responsetext); } else { console.error(xhr.statustext); } } }; xhr.onerror = function (e) { console.error(xhr.statustext); }; xhr.send(null); line 2 specifies true for its third parameter to indicate that the request should be handled asynchronously.
...*/) { var xhr = new xmlhttprequest(); xhr.callback = callback; xhr.arguments = array.prototype.slice.call(arguments, 2); xhr.onload = xhrsuccess; xhr.onerror = xhrerror; xhr.open("get", url, true); xhr.send(null); } usage: function showmessage(message) { console.log(message + this.responsetext); } loadfile("message.txt", showmessage, "new message!\n\n"); the signature of the utility function loadfile declares (i) a target url to read (via an http get request), (ii) a function to execute on successful completion of the xhr operation, and (iii) an arbitrary list of additional arguments that are passed through the xhr object (via the arguments property) to the success callback funct...
...this is done by setting the value of the timeout property on the xmlhttprequest object, as shown in the code below: function loadfile(url, timeout, callback) { var args = array.prototype.slice.call(arguments, 3); var xhr = new xmlhttprequest(); xhr.ontimeout = function () { console.error("the request for " + url + " timed out."); }; xhr.onload = function() { if (xhr.readystate ==...
...And 6 more matches
ARIA: feed role - Accessibility
<article aria-posinset="427" aria-setsize="-1">...</article> <article aria-posinset="428" aria-setsize="-1">...</article> <article aria-posinset="429" aria-setsize="-1">...</article> ...
...if the addition of articles occupies the main browser thread, make sure to set aria-busy="true" on the feed itself, and make sure to set it back to false when processing ends, or the user may not see the updates.
... if the number of articles is known, set aria-setsize on the articles themselves.
...And 6 more matches
Keyboard-navigable JavaScript widgets - Accessibility
when set to 0, the element becomes focusable by keyboard and script.
... when set to -1, the element becomes focusable by script, but it does not become part of the keyboard focus order.
...to do this, authors can set tabindex to any positive number.
...And 6 more matches
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
WebCSS:is
afari on iossamsung internet:is()chrome full support 68notes disabled full support 68notes disabled notes combinators in the selector list argument may not match correctly (see bug 842157).disabled from version 68: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... 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).
...e 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).
...And 6 more matches
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
this article provides a set of mixins for those who want to mess around with flexbox using the native support of current browsers.
... this set uses: fallbacks using 2009 'box' syntax (ff and older webkit) and prefixed syntaxes (ie10, webkit browsers without flex wrapping) final standards syntax (ff, safari, chrome, ie11+, edge, opera) this was inspired by: http://dev.opera.com/articles/view/advanced-cross-browser-flexbox/ with help from: http://w3.org/tr/css3-flexbox/ http://the-echoplex.net/flexyboxes/ http://msdn.microsoft.com/en-us/library/ie/hh772069(v=vs.85).aspx http://css-tricks.com/using-flexbox/ a complete guide to flexbox | css-tricks visual guide to css3 flexbox: flexbox playground | note: mixins are not currently supported natively in browsers.
...lexbox; display: flex; } //using this mixin %flexbox { @include flexbox; } @mixin inline-flex { display: -webkit-inline-box; display: -moz-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; display: inline-flex; } %inline-flex { @include inline-flex; } flexbox direction the flex-direction property specifies how flex items are placed in the flex container, by setting the direction of the flex container's main axis.
...And 6 more matches
Shorthand properties - CSS: Cascading Style Sheets
shorthand properties are css properties that let you set the values of multiple other css properties simultaneously.
... tricky edge cases even if they are very convenient to use, there are a few edge cases to keep in mind when using them: a value which is not specified is set to its initial value.
... that sounds anecdotal, but it really means that it overrides previously set values.
...And 6 more matches
font-variant - CSS: Cascading Style Sheets
the font-variant css shorthand property allows you to set all the font variants for a font.
... you can also set the css level 2 (revision 1) values of font-variant, (that is, normal or small-caps), by using the font shorthand.
... 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.
...And 6 more matches
font-weight - CSS: Cascading Style Sheets
the font-weight css property sets the weight (or boldness) of the font.
... the weights available depend on the font-family that is currently set.
...mal; font-weight: bold; /* keyword values relative to the parent */ font-weight: lighter; font-weight: bolder; /* numeric keyword values */ font-weight: 100; font-weight: 200; font-weight: 300; font-weight: 400;// normal font-weight: 500; font-weight: 600; font-weight: 700;// bold font-weight: 800; font-weight: 900; /* global values */ font-weight: inherit; font-weight: initial; font-weight: unset; the font-weight property is specified using any one of the values listed below.
...And 6 more matches
mask-border - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width syntax /* source | slice */ mask-border: url('border-mask.png') 25; /* source | slice | repeat */ mask-border: url('border-mask.png') 25 space; /* source | slice | width */ mask-border: url('border-mask.png') 25 / 35px; /* source | slice | width | outset | repeat | mode */ mask-border: url('border-mask.png') 25 / 35px / 12px space alpha; values <'mask-border-source'> the source image.
... <'mask-border-outset'> the distance of the border mask from the element's outside edge.
...see mask-border-outset.
...And 6 more matches
<position> - CSS: Cascading Style Sheets
the <position> (or <bg-position>) css data type denotes a two-dimensional coordinate used to set a location relative to an element box.
... it is used in the background-position and offset-anchor properties.
... syntax the <position> data type is specified with one or two keywords, with optional offsets.
...And 6 more matches
Audio and video manipulation - Developer guides
html we can set up our video player and <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> javascri...
... var processor = { timercallback: function() { if (this.video.paused || this.video.ended) { return; } this.computeframe(); var self = this; settimeout(function () { self.timercallback(); }, 16); // roughly 60 frames per second }, doload: function() { this.video = document.getelementbyid("my-video"); this.c1 = document.getelementbyid("my-canvas"); this.ctx1 = this.c1.getcontext("2d"); var self = this; this.video.addeventlistener("play", function() { self.width = self.video.width; self.height = self.video.height; self.timercallback(); }, false); }, computeframe: function() { this.ctx1.drawimage(this.video, 0, 0, this.width, this.height); var frame = this.
...for efficiency, you should consider using requestanimationframe() instead of settimeout() when running on browsers that support it.
...And 6 more matches
Rich-Text Editing in Mozilla - Developer guides
setting up rich-text editing rich-text editing is initialized by setting the designmode property of a document to "on", such as the document inside an iframe.
... once designmode has been set to "on", the document becomes a rich-text editing area and the user can type into it as if it were a textarea.
... similarly, setting contenteditable to "true" allows you to make individual elements of a document editable.
...And 6 more matches
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property.
...since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use).
... this does not set a limit on how many characters the user can enter into the field.
...And 6 more matches
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
you can set a default value for the input by including a number inside the value attribute, like so: <input id="number" type="number" value="42"> additional attributes in addition to the attributes commonly supported by all <input> types, inputs of type number support these attributes: attribute description list the id of the <datalist> element that contains the optional pre...
...its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property.
...when you create a number input with the proper type value, number, you get automatic validation that the entered text is a number, and usually a set of up and down buttons to step the value up and down.
...And 6 more matches
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
<input> elements of type radio are generally used in radio groups—collections of radio buttons describing a set of related options.
... note: checkboxes are similar to radio buttons, but with an important distinction: radio buttons are designed for selecting one value out of a set, whereas checkboxes let you turn individual values on and off.
... for example, if your form needs to ask the user for their preferred contact method, you might create three radio buttons, each with the name property set to contact but one with the value email, one with the value phone, and one with the value mail.
...And 6 more matches
Standard metadata names - HTML: Hypertext Markup Language
WebHTMLElementmetaname
standard metadata names defined in the html specification the html specification defines the following set of standard metadata names: application-name: the name of the application running in the web page.
... the browser will use this information in tandem with the user's browser or device settings to determine what colors to use for everything from background and foregrounds to form controls and scrollbars.
...browser settings can ignore this rule and ios10+ ignores it by default.
...And 6 more matches
Function.prototype.bind() - JavaScript
the bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called.
...when using bind to create a function (supplied as a callback) inside a settimeout, any primitive value passed as thisarg is converted to object.
...o the ecmascript 5 // internal iscallable function throw new typeerror('function.prototype.bind - what is trying to be bound is not callable'); } var baseargs= arrayprototypeslice.call(arguments, 1), baseargslength = baseargs.length, ftobind = this, fnop = function() {}, fbound = function() { baseargs.length = baseargslength; // reset to default base arguments baseargs.push.apply(baseargs, arguments); return ftobind.apply( fnop.prototype.isprototypeof(this) ?
...And 6 more matches
Strict mode - JavaScript
strict mode isn't just a subset: it intentionally has different semantics from normal code.
...eval code, function code, event handler attributes, strings passed to windowtimers.settimeout(), and related functions are entire scripts, and invoking strict mode in them works as expected.
...syntax error 197 + 142; var sumwithoctal = 0o10 + 8; console.log(sumwithoctal); // 16 seventh, strict mode in ecmascript 2015 forbids setting properties on primitive values.
...And 6 more matches
Web audio codec guide - Web media technologies
additionally, webrtc implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions.
... each channel may substantially increase the encoded audio size, depending on contents and encoder settings.
... audio encoder configuration effects on quality and size feature effect on quality effect on size lossless compression no loss of fidelity unlikely to get more than 40-50% compression lossy compression always some loss of fidelity; the higher the compression, the more the loss compression of up to 80-95% possible quality setting the higher the quality, the better the fidelity of the encoded audio the higher the fidelity, the larger the resulting file becomes, though the amount of change varies from codec to codec bit rate the higher the bit rate, the higher the quality can be the higher the bit rate, the larger the encoded file is likely to be audio frequency bandwidth if there is any...
...And 6 more matches
Add to Home screen - Progressive web apps (PWAs)
start_url: provides a path to the asset that should be loaded when the added-to-home screen app is launched.
... link the html to the manifest to finish setting up your manifest, you need to reference it from the html of your application's home page: <link rel="manifest" href="manifest.webmanifest"> browsers that support a2hs will know where to look for your manifest once this is in place.
... bear in mind that when you add an app to your home screen, it just makes the app easily accessible — it doesn't download the app's assets and data to your device and make the app available offline, or anything like that.
...And 6 more matches
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> usage notes default value none value <end-value-list> animatable no the <end-value-list> is a semicolon-separated list of values.
... each value can be one of the following: <offset-value> this value defines a clock-value that represents a point in time relative to the beginning of the svg document (usually the load or domcontentloaded event).
... <syncbase-value> this value defines a syncbase and an optional offset from that syncbase.
...And 6 more matches
page-mod - Archive of obsolete content
for example, the following add-on displays an alert whenever the user visits any page hosted at "mozilla.org": var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'window.alert("page matches ruleset");' }); you can modify the document in your script: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); you can supply the content script(s) in one of two ways: as a string literal, or an array of string literals, assigned to the contentscript option, as...
... exclude has the same syntax as include, but specifies the urls to which content scripts should not be attached, even if they match include: so it's a way of excluding a subset of the urls that include specifies.
... using the attach method of the tab object, you can attach a set of content scripts to a particular tab.
...And 5 more matches
panel - Archive of obsolete content
embedding an iframe in the panel, and changing its document setting the panel's contenturl property.
...// // set the focus to the text area so the user can // just start typing.
...// // set the focus to the text area so the user can // just start typing.
...And 5 more matches
timers - Archive of obsolete content
set one-off and periodic timers.
... globals constructors functions settimeout(callback, ms) schedules callback to be called in ms milliseconds.
... example var { settimeout } = require("sdk/timers"); settimeout(function() { // do something in 0 ms }, 0) cleartimeout(id) given an id returned from settimeout(), prevents the callback with the id from being called (if it hasn't yet been called).
...And 5 more matches
places/bookmarks - Archive of obsolete content
usage this module exports: three constructors: bookmark, group, and separator, corresponding to the types of objects, referred to as bookmark items, in the bookmarks database in firefox two additional functions, save() to create, update, and remove bookmark items, and search() to retrieve the bookmark items that match a particular set of criteria.
... tags set a set of tags to be applied to the bookmark.
... deleting items: to delete a bookmark item, pass in a bookmark item with a property remove set to true.
...And 5 more matches
platform/xpcom - Archive of obsolete content
ld';} }); // create and register the factory var factory = factory({ contract: contractid, component: helloworld }); // xpcom clients can retrieve and use this new // component in the normal way var wrapper = cc[contractid].createinstance(ci.nsisupports); var helloworld = wrapper.wrappedjsobject; console.log(helloworld.hello()); using class id you can specify a class id for the factory by setting the id option in the factory's constructor.
...by including this option, set to false, the factory is not automatically registered and you must register it manually using the register() function.
...by including this option, set to false, the factory is not automatically unregistered and you must unregister it manually using the unregister() function.
...And 5 more matches
cfx - Archive of obsolete content
-g config, --use-config=config pass a set of options by referencing a named configuration.
... use this flag to reverse that behavior: if this flag is set and the add-on includes its own copies of the sdk modules, then the add-on will use the sdk modules in the add-on, not the ones built into firefox.
... --e10s if this option is set then the add-on runs in a separate process.
...And 5 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
to trigger the alert() in the listener and pass the data from the web page, write code such as this in the web page: var element = document.createelement("myextensiondataelement"); element.setattribute("attribute1", "foobar"); element.setattribute("attribute2", "hello world"); document.documentelement.appendchild(element); var evt = document.createevent("events"); evt.initevent("myextensionevent", true, false); element.dispatchevent(evt); this code creates an arbitrary element -- <myextensiondataelement/> -- and inserts it into the web page's dom.
... values are set for two arbitrary attributes on the element.
... document.addeventlistener("message", function(e) { yourfunction(e); }, false, true); sending data from chrome to unprivileged document to "answer" the web page (e.g., return code), your extension can set an attribute or attach child elements on the event target element (<myextensiondataelement/> in this example).
...And 5 more matches
Listening to events in Firefox extensions - Archive of obsolete content
the pageshow event uses a boolean property called persisted that is set to false on the initial load.
... it is set to true if it is not the initial load (in other words, it is set to true when the page is cached).
... set any javascript that you want to run every time a page loads to run when the pageshow event fires.
...And 5 more matches
XPCOM Objects - Archive of obsolete content
an interface is just a definition of a set of attributes and methods that an object implementing it should have.
...we use the preferences service to get and set preference values, such as the preference value we're getting on the fourth line of code.
...the getservice and createinstance methods allow you to get the component already set to an interface.
...And 5 more matches
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
as i was designing the product, i began discovering a broader set of web standards, and was quickly swayed by the advantages i could see if we were to adopt them.
...e 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?
...despite some initial setbacks with those approaches due to our own unique scenarios, it wasn't long before i discovered a variation of one of their methods that worked for the wired news design.
...And 5 more matches
Autodial for Windows NT - Archive of obsolete content
if this service is running, and control panel | network connections | advanced | dialup preferences is set to enable autodial, then any application trying to access the internet will trigger the autodial feature whenever an internet address cannot be reached.
...these conditions are as follows: the autodial service is running control panel | network connections | advanced | dialup preferences | enable autodial by location is set for some location a dialup connection has been configured there is no lan connected or the dialup connection has been used to access the internet address in question.
... most systems are not set up correctly for this to happen, and most users have no idea how all these details work.
...And 5 more matches
New Skin Notes - Archive of obsolete content
edit page textarea needs to 'scale' better with page width (so large whitespace area's are non-existant), suggest min-width:some-em-size; width: 88%; and max-width set to 95% or something like that.
...--dria the edit section links are gone (they are only shown in normal skin if you set the appropriate preference).
... --nickolay do you know if there's a localsettings variable to have the edit-section links off by default?
...And 5 more matches
Example Sticky Notes - Archive of obsolete content
view this example <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html401/strict.dtd"> <html> <head> <title>xbl demo : sticky notes</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> body { background-color: #ffffff; color: #000000; font: 1em verdana, sans-serif; } h1 { font-size: 1.5em; } /* binding: */ .sticker { -moz-binding: url(notes.xml#default); } </style> </head> <body> <h1><a href="http://developer.mozilla.org/en/docs/xbl:xbl_1.0_reference">xbl</a> demo : sticky notes</h1> <div class="sticker"><p>acme,&nbsp;inc.
... unlike <field> these are really two functions (getter and setter).
... within the virtual properties you cannot set or get the named property itself.
...And 5 more matches
XUL Events - Archive of obsolete content
the event handler should be placed on an observer.checkboxstatechangethe checkboxstatechange event is executed when the state of a <checkbox> element has changed.closethe close event is executed when a request has been made to close the window when the user presses the close button.commandthe command event is executed when an element is activated.commandupdatethe commandupdate event is executed when a command update occurs on a <commandset>.
...in a textbox, a user can normally hold down a key to repeat a character in this case, multiple sets of key events are sent (as if the user pressed the same key repeatedly).
... attribute: oncommand commandupdate this event occurs when a command update occurs on a <commandset> element.
...And 5 more matches
MenuButtons - Archive of obsolete content
a button or toolbarbutton with a type attribute set to 'menu' creates a button that will open a menu when pressed.
... a button or toolbarbutton with a type attribute set to 'menu-button' creates a button that can be pressed normally.
...this works similarly to the menu tag, and would be used to present a set of commands to execute.
...And 5 more matches
Panels - Archive of obsolete content
you also need to set the type attribute on the button to the value panel, or the button will look and behave like a regular button.
...the popup attribute should be set to the id of a panel within the same document.
...to do this, set the noautohide attribute on the panel to true.
...And 5 more matches
SQLite Templates - Archive of obsolete content
to do this, set the querytype attribute on the root node of the template to the value storage.
...the datasources attribute may be set to one of two possible types of values.
...in this case, you will often be setting the datasources attribute dynamically after determining the file path.
...And 5 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
your operating system normally provides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding.
... if your language uses only plain latin (ascii) characters, set your text editor to use any encoding except unicode.
... if your language uses accents or other non-latin characters, set your text editor to save files using the utf-8 encoding.
...And 5 more matches
Custom toolbar button - Archive of obsolete content
your operating system normally provides them: a way to create and work with files and directories a text editor for plain text files character encoding some text editors have a setting for character encoding.
... if your language uses only plain latin (ascii) characters, set your text editor to use any encoding except unicode.
... if your language uses accents or other non-latin characters, set your text editor to save files using the utf-8 encoding.
...And 5 more matches
Creating a Skin - Archive of obsolete content
tab:first-child { -moz-border-radius: 4px 0px 0px 0px; } tab:last-child { -moz-border-radius: 0px 4px 0px 0px; } tab[selected="true"] { color: #000066; font-weight: bold; text-decoration: underline; } two rules change the normal tab appearance, the first sets the rounding on the first tab and the second sets the rounding on the last tab.
... the last rule only applies to tabs that have their selected attribute set to true.
...we can set the image for a button using the list-style-image css property.
...And 5 more matches
Templates - Archive of obsolete content
you can see in the image that the set of buttons has been created, one for each bookmark.
... the label of the buttons is set to this special uri because we want the labels on the buttons to be set to the names of the bookmarks.
...so we end up with the labels on the buttons set to the names of the bookmarks.
...And 5 more matches
arrowscrollbox - Archive of obsolete content
<button label="maroon"/> <button label="black"/> </arrowscrollbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width clicktoscroll type: boolean clicktoscroll, if true, the arrows must be clicked to scroll the scrollbox content.
...if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...And 5 more matches
caption - Archive of obsolete content
attributes accesskey, crop, image, label, tabindex properties accesskey, crop, image, label, tabindex examples <groupbox> <caption label="my groupbox"/> </groupbox> <groupbox flex="1"> <caption> <checkbox label="a checked groupbox"/> </caption> </groupbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
... properties accesskey type: character gets and sets the value of the accesskey attribute.
...And 5 more matches
colorpicker - Archive of obsolete content
if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...if this is set to the text button, the colorpicker is displayed as a button.
...And 5 more matches
listcell - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
...if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...And 5 more matches
treeitem - Archive of obsolete content
set the uri attribute to the variable name to bind to a content node during matching.
... attributes container, empty, label, open, uri examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements.
...this will be set by the template builder as needed.
...And 5 more matches
window - Archive of obsolete content
to set an icon for the window, create a platform-specific icon file <windowid>.ico and/or <windowid>.xpm and place or install these files into the <mozilla-directory>/chrome/icons/default/ directory.
... <label control="your-lname" value="enter last name:"/> <textbox id="your-lname" value="hernandez"/> </hbox> <hbox> <button oncommand="alert('save!')"> <description>save</description> </button> </hbox> </vbox> </radiogroup> </groupbox> </vbox> </window> attributes accelerated type: booleanset this attribute to true to allow hardware layer managers to accelerate the window.
... disablechrome type: boolean set this attribute to true to disable chrome in the window.
...And 5 more matches
XForms Custom Controls - Archive of obsolete content
the xforms specification provides for a nice way to do this using xforms binding attributes (like ref, or nodeset) on your custom control element.
...through xf:setfocus action) and that the control needs to ensure that the proper widget is given focus.
... */ domstring getvalue(); /** * set value of instance node.
...And 5 more matches
RDF in Mozilla FAQ - Archive of obsolete content
the open directory dataset is available as a (huge) rdf/xml dump.
...y, 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 need to setup the datasource.
...by setting // ablocking to true, we could force it to be synchronous, but this // is generally a bad idea, because your ui will completely lock up!
...And 5 more matches
Index - Game development
in this article we'll take you through the real basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code.
... 21 building up a basic demo with three.js 3d, animation, beginner, canvas, games, tutorial, webgl, camera, lighting, rendering, three.js in this article we'll take you through the real basics of using three, including setting up a development environment, structuring the necessary html, the fundamental objects of three, and how to build up a basic demo.
...now let's move on to look at how to set up the game to be controlled using a console gamepad, using the gamepad api.
...And 5 more matches
Audio for Web games - Game development
here's an example of an audio sprite player — first let's set up the user interface in html: <audio id="myaudio" src="https://udn.realityripple.com/samples/f0/2909c16512.mp3"></audio> <button data-start="18" data-stop="19">0</button> <button data-start="16" data-stop="17">1</button> <button data-start="14" data-stop="15">2</button> <button data-start="12" data-stop="13">3</button> <button data-start="10" data-stop="11">4</button> <button data-start="8" da...
...recording this offset and querying the playing track's current time gives you enough information to synchronize separate pieces of audio.
... let's create another async function to set up the sample — we can combine the two async functions in a nice promise pattern to perform further actions when each file is loaded and buffered: async function loadfile(filepath) { const track = await getfile(filepath); return track; } let's also create a playtrack() function, which we can call once a file has been fetched.
...And 5 more matches
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
when used in conjunction with xpointer (firefox supports a subset of it, and is used in the code sample below), xinclude can also target just specific portions of a document for inclusion.
... var acceptlanguage = xinclude.getattribute('accept-language'); // "accept-language: "+x var xifallback = xinclude.getelementsbytagnamens('http://www.w3.org/2001/xinclude', 'fallback')[0]; // only one such child is allowed if (href === '' || href === null) { // points to same document if empty (null is equivalent to empty string) href = null; // set for uniformity in testing below if (parse === 'xml' && xpointer === null) { alert('there must be an xpointer attribute present if "href" is empty an parse is "xml"'); return false; } } else if (href.match(/#$/, '') || href.match(/^#/, '')) { alert('fragment identifiers are disallowed in...
...e'); return false; } var j; var xincludeparent = xinclude.parentnode; try { netscape.security.privilegemanager.enableprivilege('universalxpconnect universalbrowserread'); // necessary with file:///-located files trying to reach external sites if (href !== null) { var response, responsetype; var request = new xmlhttprequest(); request.open('get', href, false); request.setrequestheader('if-modified-since', 'thu, 1 jan 1970 00:00:00 gmt'); request.setrequestheader('cache-control', 'no-cache'); if (accept) { request.setrequestheader('accept', accept); ...
...And 5 more matches
Mobile accessibility - Learn web development
if you've set a passcode or pattern for unlocking your device, you will then be taken to the relevant entry screen to enter it.
... to turn it on, go to your settings app and select accessibility > voiceover.
... note: some older ios devices have the voiceover menu at settings app > general > accessibility > voiceover.
...And 5 more matches
Styling web forms - Learn web development
these include the following elements: <form> <fieldset> and <legend> single-line text <input>s (e.g.
...by default it is always positioned over the top border of its <fieldset> parent, near the top left corner.
... to position it somewhere else, for example inside the fieldset somewhere, or near the bottom left corner, you need to rely on positioning.
...And 5 more matches
Image gallery - Learn web development
project brief you have been provided with some html, css and image assets and a few lines of javascript code; you need to write the necessary javascript to turn this into a working program.
... it sets the width of any images inside the thumb-bar <div> (so-called "thumbnail" images) to 20%, and floats them to the left so they sit next to one another on a line.
... looping through the images we've already provided you with lines that store a reference to the thumb-bar <div> inside a constant called thumbbar, create a new <img> element, set its src attribute to a placeholder value xxx, and append this new <img> element inside thumbbar.
...And 5 more matches
Useful string methods - Learn web development
to actually update the value of the browsertype variable in a real program, you'd have to set the variable value to be the result of the operation; it doesn't just update the substring value automatically.
... each example comes with a "reset" button, which you can use to reset the code if you make a mistake and can't get it working again, and a "show solution" button you can press to see a potential answer if you get really stuck.
...n']; for (let i = 0; i < greetings.length; i++) { let input = greetings[i]; // your conditional test needs to go inside the parentheses // in the line below, replacing what's currently there if (greetings[i]) { let listitem = document.createelement('li'); listitem.textcontent = input; list.appendchild(listitem); } } </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); con...
...And 5 more matches
Object building practice - Learn web development
some javascript that serves to set up the <canvas> element and provide a general function that we're going to use.
... next, we set constants called width and height, and the width and height of the canvas element (represented by the canvas.width and canvas.height properties) to equal the width and height of the browser viewport (the area that the webpage appears on — this can be gotten from the window.innerwidth and window.innerheight properties).
... note that we are chaining multiple assignments together, to get the variables all set quicker — this is perfectly ok.
...And 5 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
to create this we'll receive the todos array as a prop, and set the disabled property of each button accordingly.
...in the same fashion as we saw earlier, we'll create a nameel variable inside todo.svelte and call nameel.focus() after setting the editing variable to true.
... open the file components/todo.svelte and add a nameel variable declaration, just below your editing and name declarations: let nameel // reference to the name input dom node now update your onedit() function like so: function onedit() { editing = true // enter editing mode nameel.focus() // set focus to name input } and finally, bind nameel to the <input> field, by updating it like so: <input bind:value={name} bind:this={nameel} type="text" id="todo-{todo.id}" autocomplete="off" class="todo-text" /> however, when you try the updated app you'll get an error along the lines of "typeerror: nameel is undefined" in the console when you press a todo's edit button.
...And 5 more matches
Accessibility/LiveRegionDevGuide
in iaccessible2, iaccessibletext::get_oldtext and iaccessibletext::get_newtext are used to acquire the text and offsets.
...(at-spi only) a global variable can be set in a document:load:complete event listener and reset in a object:state-changed:busy listener.
...if atomic is set to "true", it means that the region must be presented as a whole while atomic="false" (default) indicates that the region can stand on it's own.
...And 5 more matches
Overview of Mozilla embedding APIs
the webbrowser exposes a set of interfaces which allow the embedding application to control activity and respond to changes within this client area.
...to facilitate this, a set of global functions are available to access the nsmemory methods without requiring an instance of the nsmemory service (see nsmemory.h).
...contract-id: ns_webbrowser_contractid implemented interfaces: nsiwebbrowser nsiwebnavigation nsiwebbrowsersetup nsiwebbrowserpersist nsiwebbrowserfind nsiwebbrowserprint nsiwebbrowserfocus nsibasewindow requestor interfaces: nsidomwindow nsidomdocument nsiwebprogress nsiclipboardcommands nsiprompt related interfaces: nsiprompt nsiwebbrowserchrome nsiwebbrowsersitewindow nsiwebprogresslistener nsicontextmenulistener nsiprintoptions overview: most of gecko's functionali...
...And 5 more matches
HTTP Cache
anonymous load boolean flag app id number (0 for no app) is-in-browser boolean flag helper functions to create nsiloadcontextinfo objects: c++ consumers: functions at loadcontextinfo.h exported header js consumers: resource://gre/modules/loadcontextinfo.jsm module methods two storage objects created with the same set of nsiloadcontextinfo arguments are identical, containing the same cache entries.
... other parallel consumers, if any, are blocked until the writer calls setvalid on the cache entry.
... when the server responds positively (in case of an http server with a 206 response code) the writer (in this order) opens the output stream on the cache entry and calls setvalid to unblock other pending openers.
...And 5 more matches
Internationalized Domain Names (IDN) Support in Mozilla Browsers
until recently domain names allowed only a subset of 7-bit ascii characters.
... as the internet has spread to non-english speaking people around the world, it has become increasingly clear that forcing them to use domain names written only in a subset of the latin alphabet is not ideal.
...at the network protocol level, there is no change in the restriction that only a subset of ascii characters be used in url/uri.
...And 5 more matches
Index
7 l10n testing with xcode firefox for ios, localization once you have your l10n testing environment set up in xcode, testing your firefox on ios localization is a breeze.
... 11 localization prerequisites internationalization, localization, delete to work on localization, you need a subset of the mozilla build prerequisites.
... 13 initial setup localization as a pre-requisite to contributing to the l10n program, you need to have access to code, tools, and a properly configured local environment (i.e., your personal computer).
...And 5 more matches
nss tech note1
offset† .
...if templates are nested, the offset applies to the location of the current component within the target component, typically the decoded sequence.
...the following macros are provided for tag numbers within the universal class : sec_asn1_boolean, sec_asn1_integer, sec_asn1_bit_string, sec_asn1_octet_string, sec_asn1_null, sec_asn1_object_id, sec_asn1_object_descriptor,† sec_asn1_real, sec_asn1_enumerated, sec_asn1_embedded_pdv, sec_asn1_utf8_string, sec_asn1_sequence, sec_asn1_set, sec_asn1_numeric_string, sec_asn1_printable_string, sec_asn1_t61_string, sec_asn1_teletex_string, sec_asn1_t61_string, sec_asn1_videotex_string, sec_asn1_ia5_string, sec_asn1_utc_time, sec_asn1_generalized_time, sec_asn1_graphic_string, sec_asn1_visible_string, sec_asn1_general_string, sec_asn1_universal_string, sec_asn1_bmp_string note that for sec_asn1_set and sec_asn1_sequence types, you mu...
...And 5 more matches
JS_ClearContextThread
syntax jsword js_clearcontextthread(jscontext *cx); jsword js_setcontextthread(jscontext *cx); name type description cx jscontext * the context to transfer from one thread to another.
... description an application that creates or uses a jscontext in one thread, then uses or destroys it in another thread, must use js_clearcontextthread and js_setcontextthread to transfer the jscontext safely from one thread to the other.
... before thread b uses the jscontext, it must call js_setcontextthread.
...And 5 more matches
JS_DefineElement
syntax /* added in spidermonkey 38 (jsapi 32) */ bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlevalue value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jsc...
...ontext *cx, js::handleobject obj, uint32_t index, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); /* obsolete since jsapi 32 */ js_defineelement(jscontext *cx, jsobject *obj, uint32_t index, jsval value, jspropertyop getter, jsstrictpropertyop setter, unsigned attrs); ...
... setter jsnative or jsstrictpropertyop setproperty method for specifying a new property value.
...And 5 more matches
JS_DefinePropertyWithTinyId
syntax jsbool js_definepropertywithtinyid( jscontext *cx, jsobject *obj, const char *name, int8 tinyid, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); jsbool js_defineucpropertywithtinyid( jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, int8 tinyid, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); name type description cx jscontext * the context in which to define the property.
... tinyid int8 8-bit id to aid in sharing getter and setter callbacks among properties.
... setter jspropertyop setproperty method for specifying a new property value.
...And 5 more matches
SpiderMonkey 1.8.7
a compartment is a global object, a context, and a set of related objects with no outside references (crosscompartment wrappers excepted).
...global objects must also have the jsclass_global_flags flag set.
... merely setting jsclass_is_global is insufficient.
...And 5 more matches
An Overview of XPCOM
the best way to tackle a project of this size is to divide it into smaller, more manageable pieces, use a component programming model, and to organize related sets of components into modules.
...this is the contractual agreement of this unencapsulated class: a set of rules that define when each method can be called and what it is expected to do.
...if there isn't a match, the class returns an error and sets the out value to null.
...And 5 more matches
Using XPCOM Utilities to Make Things Easier
generic xpcom module macros the work in the previous chapter was useful in setting up the generic component code.
... the module macros include one set of macros that define the exported nsgetmodule entry point, the required nsimodule implementation code and another that creates a generic factory for your implementation class.
...historically, it gets called in the constructor for your class and sets mrefcnt to zero.
...And 5 more matches
mozIStorageConnection
[optional] in mozistoragestatementcallback acallback ); void executesimplesql(in autf8string asqlstatement); boolean indexexists(in autf8string aindexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8string afunctionname); mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 agranularity, in mozistorageprogresshandler ahandler); boolean tableexists(in autf8string atablename); attributes attribute type description connectionready boolean indicates if the connection is open and ready to u...
...the version will be reported as 0 if it is not set.
... note: the statements may be reused immediately, and the statements do not need to be reset individually.
...And 5 more matches
nsIContentPrefService2
this parameter relates to private browsing and determines the kind of storage that a method uses, either the usual permanent storage or temporary storage set() aside for private browsing sessions.
... void removebysubdomainandname(in astring domain, in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeglobal(in astring name, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void removeobserverforname(in astring name, in nsicontentprefobserver observer); void set(in astring domain, in astring name, in nsivariant value, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); void setglobal(in astring name, in nsivariant value, in nsiloadcontext context, [optional] in nsicontentprefcallback2 callback); methods addobserverforname() registers an observer that will be notified whenever a preference with the given na...
...me is set() or removed.
...And 5 more matches
nsISearchEngine
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void addparam(in astring name, in astring value, in astring responsetype); nsisearchsubmission getsubmission(in astring data, [optional] in astring responsetype, [optional] in astring purpose); boolean supportsresponsetype(in astring responsetype); attributes attribute type description alias astring an optional shortcut alias for the engine.
...void addparam( in astring name, in astring value, in astring responsetype ); parameters name the name of the parameter to add.
... responsetype since an engine can have several different request urls, differentiated by response types, this parameter selects a request to add parameters to.
...And 5 more matches
nsISecurityCheckedComponent
inherits from: nsisupports last changed in gecko 1.7 capability strings in gecko, a "capability" is a string identifying a set of actions that code is allowed to perform.
... this includes creating instances of arbitrary xpcom objects and calling methods and setting properties on them.
... for example, this capability allows code to set the value of <input type="file"> and access an arbitrary file on disk.
...And 5 more matches
nsIURI
netwerk/base/public/nsiuri.idlscriptable this is an interface for an uniform resource identifier with internationalization support, offering attributes that allow setting and querying the basic components of a uri, and methods for performing basic operations on uris.
... to create an nsiuri object, you should use nsiioservice.newuri(), like this: function makeuri(aurl, aorigincharset, abaseuri) { var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); return ioservice.newuri(aurl, aorigincharset, abaseuri); } components of a uri prepath path scheme userpass host port ref ftp :// username@password @ hostname ...
... origincharset acstring the charset of the document from which this uri originated.
...And 5 more matches
nsIWebBrowserChrome
inherits from: nsisupports last changed in gecko 0.9.6 method overview void destroybrowserwindow(); void exitmodaleventloop(in nsresult astatus); boolean iswindowmodal(); void setstatus(in unsigned long statustype, in wstring status); void showasmodal(); void sizebrowserto(in long acx, in long acy); attributes attribute type description chromeflags unsigned long the chrome flags for this browser chrome.
...the browser chrome may be told to set the webbrowser object to a new object by setting this attribute.
... in this case the implementer is responsible for taking the new webbrowser object and doing any necessary initialization or setup as if it had created the webbrowser itself.
...And 5 more matches
MailNews fakeserver
writing a new fakeserver since the number of protocols we use is very small, most people shouldn't have to write an entirely new daemon and handler setup by themselves.
... setmultiline the new value of multiline nothing the value is a boolean, with true invoking multiline mode.
...using fakeserver in xpcshell tests since there are three different components of fakeserver, a total of four objects need to be set up in a fakeserver test on top of other testing.
...And 5 more matches
about:debugging (before Firefox 68) - Firefox Developer Tools
whether or not system add-ons appear in the list on this page depends on the setting of the devtools.aboutdebugging.showsystemaddons preference.
... if you need to see system add-ons, navigate to about:config and make sure that this value is set to true.
...checking the box sets both preferences to true, and unchecking it sets them both to false.
...And 5 more matches
AudioListener.forwardX - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.forwardY - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.forwardZ - Web APIs
note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.positionX - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.positionY - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.positionZ - Web APIs
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.speedOfSound - Web APIs
the speedofsound property's default value is 343.3 m/s and is used to calculate the doppler shift appropriate for the speed the panner is travelling at (as defined by pannernode.setvelocity.) note: bear in mind that no propagation delay is automatically applied to a sound far from the listener.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.upX - Web APIs
WebAPIAudioListenerupX
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.upY - Web APIs
WebAPIAudioListenerupY
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
AudioListener.upZ - Web APIs
WebAPIAudioListenerupZ
note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise.
...in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
...And 5 more matches
DataTransfer - Web APIs
properties standard properties datatransfer.dropeffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type.
... datatransfer.types read only an array of strings giving the formats that were set in the dragstart event.
... datatransfer.setdata() set the data for a given type.
...And 5 more matches
EventTarget.addEventListener() - Web APIs
the eventtarget method addeventlistener() sets up a function that will be called whenever the specified event is delivered to the target.
... passivesupported = true; return false; } }; window.addeventlistener("test", null, options); window.removeeventlistener("test", null, options); } catch(err) { passivesupported = false; } this creates an options object with a getter function for the passive property; the getter sets a flag, passivesupported, to true if it gets called.
... that means that if the browser checks the value of the passive property on the options object, passivesupported will be set to true; otherwise, it will remain false.
...And 5 more matches
KeyframeEffect - Web APIs
the keyframeeffect interface of the web animations api lets us create sets of animatable properties and values, called keyframes.
... properties keyframeeffect.target gets and sets the element, or originating element of the pseudo-element, being animated by this object.
... keyframeeffect.pseudoelement gets and sets the selector of the pseudo-element being animated by this object.
...And 5 more matches
Media Session action types - Web APIs
to support an action on a media session, such as seeking, pausing, or changing tracks, you need to call the mediasession interface's setactionhandler() method to establish a handler for that action.
...the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward.
...the mediasessionactiondetails property seekoffset specifies the amount of time to seek forward.
...And 5 more matches
MediaSessionActionDetails - Web APIs
seekoffset optional if the action is either seekforward or seekbackward and this property is present, it is a floating point value which indicates the number of seconds to move the play position forward or backward.
...the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward.
...the mediasessionactiondetails property seekoffset specifies the amount of time to seek forward.
...And 5 more matches
MediaStreamTrack.getConstraints() - Web APIs
the getconstraints() method of the mediastreamtrack interface returns a mediatrackconstraints object containing the set of constraints most recently established for the track using a prior call to applyconstraints().
...see capabilities, constraints, and settings for details on how to work with constrainable properties.
... syntax const constraints = track.getconstraints() return value a mediatrackconstraints object which indicates the constrainable properties the web site or app most recently set using applyconstraints().
...And 5 more matches
Pointer events - Web APIs
the pointer is a hardware-agnostic device that can target a specific set of screen coordinates.
... pointer a hardware-agnostic representation of input devices that can target a specific coordinate (or set of coordinates) on a screen.
... element extensions there are three extensions to the element interface: setpointercapture() designates a specific element as the capture target of future pointer events.
...And 5 more matches
Selection - Web APIs
WebAPISelection
selection.anchoroffsetread only returns a number representing the offset of the selection's anchor within the anchornode.
... selection.focusoffsetread only returns a number representing the offset of the selection's anchor within the focusnode.
... selection.collapsetoend() collapses the selection to the end of the last range in the selection.
...And 5 more matches
Slottable - Web APIs
WebAPISlottable
53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...roid full support 53firefox android full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...And 5 more matches
SubtleCrypto.verify() - Web APIs
* if it checks out, set the "valid" class on the signature.
... * otherwise set the "invalid" class.
...* if it checks out, set the "valid" class on the signature.
...And 5 more matches
Scissor animation - Web APIs
note that this time it is the position of the square (the scissoring area) that is updated every frame (we set frame rate to roughly one every 17ms, or roughly 60fps – frames per second).
... in contrast, the color of the square (set with clearcolor) is only updated when a new square is created.
...for each square, we set its color once, and then update only its position every frame.
...And 5 more matches
Using textures in WebGL - Web APIs
turn off mips and set // wrapping to clamp to edge gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); } }; image.src = url; return texture; } function ispowerof2(value) { return (value & (value - 1)) == 0; } the loadtextu...
...after that we setup filtering and wrapping for the texture based on whether or not the image we download was a power of 2 in both dimensions or not.
... webgl1 can only use non power of 2 textures with filtering set to nearest or linear and it can not generate a mipmap for them.
...And 5 more matches
WebRTC API - Web APIs
the set of standards that comprise webrtc makes it possible to share data and perform teleconferencing peer-to-peer, without requiring that the user installs plug-ins or any other third-party software.
...the documentation you'll find here will help you understand the fundamentals of webrtc, how to set up and use both data and media connections, and more.
... connection setup and management these interfaces, dictionaries, and types are used to set up, open, and manage webrtc connections.
...And 5 more matches
WorkerGlobalScope - Web APIs
it is a specific navigator object, mostly a subset of the navigator for browsing scopes, but adapted to workers.
...it is a specific location object, mostly a subset of the location for browsing scopes, but adapted to workers.
...it is a regular performance object, except that only a subset of its property and methods are available to workers.
...And 5 more matches
XMLHttpRequest - Web APIs
xmlhttprequest.response read only returns an arraybuffer, blob, document, javascript object, or a domstring, depending on the value of xmlhttprequest.responsetype, that contains the response entity body.
... xmlhttprequest.responsetext read only returns a domstring that contains the response to the request as text, or null if the request was unsuccessful or has not yet been sent.
... xmlhttprequest.responsetype is an enumerated value that defines the response type.
...And 5 more matches
XRReferenceSpace - Web APIs
it expands upon the base class, xrspace, by adding support for several different tracking behaviors as well as to request a new reference space which describes the offset transform between the tracked object and another location in the world.
... getoffsetreferencespace() creates and returns a new reference space object as the same type as the one on which you call the method (so, either xrreferencespace or xrboundedreferencespace).
... reset the reset event is sent to an xrreferencespace object when the browser detects a discontinuity has occurred wherein the tracked object's origin relative to the user's environment or location.
...And 5 more matches
ARIA: button role - Accessibility
a menu button is a button that controls a menu and has an aria-haspopup property attribute set to either menu or true.
...if the attribute is omitted or set to its default value of aria-pressed="undefined", the element does not support being pressed.
... if the button has aria-expanded="false" set, the grouping is not currently expanded; if the button has aria-expanded="true" set, it is currently expanded; if the button has aria-expanded="undefined" set or the attribute is ommitted, it is not expandable.
...And 5 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
luckily, css media queries level 5 will be a game-changer in accessibility initiatives, because it will allow users to select settings that accomodate their needs best.
... this is because the companies behind the evolution of digital technology set the standards, and these standards still retain a powerful presence today.
... noted the following in their publication, photic- and pattern-induced seizures: expert consensus of the epilepsy foundation of america working group "irrespective of luminance, a transition to or from a saturated red is also considered a risk" saturation is sometimes described as the "purity" or "intensity" of a color, and although these are good definitions for "pigments" in an artist's paint set, they are not quite accurate as definitions for color from a computer screen.
...And 5 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
if your flex container has a height set, then the items will stretch to that height, regardless of how much content is in the item.
... the reason the items become the same height is that the initial value of align-items, the property that controls alignment on the cross axis, is set to stretch.
... aligning one item with align-self the align-items property sets the align-self property on all of the flex items as a group.
...And 5 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
when we have a set of items that we want to display horizontally, we may well end up with additional space.
...we then set the content area to flex: 1, which is the shorthand for flex: 1 1 0 — the item can grow and shrink from a flex basis of 0.
...i have used the alignment properties to align the items on the cross axis to flex-start, and then set the .content flex item to flex: 1.
...And 5 more matches
Consistent list indentation - CSS: Cascading Style Sheets
this is why, in every browser except internet explorer for windows, markers are placed outside any border set for an <li> element, assuming the value of list-style-position is outside.
...in internet explorer and opera, the lists are indented by setting a left margin of 40 pixels on the <ul> element.
... gecko, on the other hand, sets a left padding of 40 pixels for the <ul> element, so given the exact same styles as were used to produce figure 5, loading the example into a gecko-based browser gives us figure 6.
...And 5 more matches
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
-end-colorborder-block-end-styleborder-block-end-widthborder-block-startborder-block-start-colorborder-block-start-styleborder-block-start-widthborder-block-styleborder-block-widthborder-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-collapseborder-colorborder-end-end-radiusborder-end-start-radiusborder-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-sourceborder-image-widthborder-inlineborder-inline-colorborder-inline-endborder-inline-end-colorborder-inline-end-styleborder-inline-end-widthborder-inline-startborder-inline-start-colorborder-inline-start-styleborder-inline-start-widthborder-inline-styleborder-inline-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-radiusb...
...-right-styleborder-right-widthborder-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip-pathcm<color>colorcolor-adjustcolumn-countcolumn-fillcolumn-gapcolumn-rulecolumn-rule-colorcolumn-rule-stylecolumn-rule-widthcolumn-spancolumn-widthcolumnsconic-gradient()containcontentcontrast()<counter>counter-incrementcounter-resetcounter-set@counter-stylecounters()cross-fade()cubic-bezier()::cue::cue-regioncursor<custom-ident>d:defaultdeg<dimension>:dirdire...
...y-listitem><display-outside>dpcmdpidppxdrop-shadow()eelement()ellipse()em:emptyempty-cells:enabledenv()exffallback (@counter-style)filter<filter-function>:first:first-child::first-letter (:first-letter)::first-line (:first-line):first-of-typefit-content()<flex>flexflex-basisflex-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-s...
...And 5 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
source image examples before diving in to look at the results of using different kinds of source images and seeing how they look when used with background-size, it would be helpful to look at a few example source images that have different dimensions and sizing settings.
...in addition, the backgrounds have background-repeat set to no-repeat for clarity.
... automatic sizing using "auto" for both dimensions if background-size is set to auto or auto auto, rule 2 says that rendering must preserve any intrinsic ratio that's provided.
...And 5 more matches
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
they are set using custom property notation (e.g., --main-color: black;) and are accessed using the var() function (e.g., color: var(--main-color);).
...like any other property, this is written inside a ruleset, like so: element { --main-bg-color: brown; } note that the selector given to the ruleset defines the scope that the custom property can be used in.
...the background color is set to brown in several places.
...And 5 more matches
all - CSS: Cascading Style Sheets
WebCSSall
the all shorthand css property resets all of an element's properties except unicode-bidi, direction, and css custom properties.
... it can set properties to their initial or inherited values, or to the values specified in another stylesheet origin.
... syntax /* global values */ all: initial; all: inherit; all: unset; /* css cascading and inheritance level 4 */ all: revert; the all property is specified as one of the css global keyword values.
...And 5 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.
... it is often convenient to use the shorthand property animation to set all animation properties at once.
... 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.
...And 5 more matches
background-position-x - CSS: Cascading Style Sheets
the background-position-x css property sets the initial horizontal position for each background image.
... the position is relative to the position layer set by background-origin.
... background-position-x: 25%; /* <length> values */ background-position-x: 0px; background-position-x: 1cm; background-position-x: 8em; /* side-relative values */ background-position-x: right 3px; background-position-x: left 25%; /* multiple values */ background-position-x: 0px, center; /* global values */ background-position-x: inherit; background-position-x: initial; background-position-x: unset; the background-position-x property is specified as one or more values, separated by commas.
...And 5 more matches
background-position-y - CSS: Cascading Style Sheets
the background-position-y css property sets the initial vertical position for each background image.
... the position is relative to the position layer set by background-origin.
...ckground-position-y: 25%; /* <length> values */ background-position-y: 0px; background-position-y: 1cm; background-position-y: 8em; /* side-relative values */ background-position-y: bottom 3px; background-position-y: bottom 10%; /* multiple values */ background-position-y: 0px, center; /* global values */ background-position-y: inherit; background-position-y: initial; background-position-y: unset; the background-position-y property is specified as one or more values, separated by commas.
...And 5 more matches
background - CSS: Cascading Style Sheets
the background shorthand css property sets all background style properties at once, such as color, image, origin and size, or repeat method.
...if included once, it sets both background-origin and background-clip.
... if it is included twice, the first occurrence sets background-origin, and the second sets background-clip.
...And 5 more matches
border-image-slice - CSS: Cascading Style Sheets
four slice lines, set a given distance from their respective sides, control the size of the regions.
...it is discarded by default, but is used like a background image if the keyword fill is set.
... the border-image-repeat, border-image-width, and border-image-outset properties determine how these regions are used to form the final border image.
...And 5 more matches
bottom - CSS: Cascading Style Sheets
WebCSSbottom
the bottom css property participates in setting the vertical position of a positioned element.
... the effect of bottom depends on how the element is positioned (i.e., the value of the position property): when position is set to absolute or fixed, the bottom property specifies the distance between the element's bottom edge and the bottom edge of its containing block.
... when position is set to relative, the bottom property specifies the distance the element's bottom edge is moved above its normal position.
...And 5 more matches
flex - CSS: Cascading Style Sheets
WebCSSflex
the flex css shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container.
...itial; flex: none; /* one value, unitless number: flex-grow */ flex: 2; /* one value, width/height: flex-basis */ flex: 10em; flex: 30%; flex: min-content; /* two values: flex-grow | flex-basis */ flex: 1 30px; /* two values: flex-grow | flex-shrink */ flex: 2 2; /* three values: flex-grow | flex-shrink | flex-basis */ flex: 2 2 10%; /* global values */ flex: inherit; flex: initial; flex: unset; the flex property may be specified using one, two, or three values.
...this is equivalent to setting "flex: 0 1 auto".
...And 5 more matches
font-variant-numeric - CSS: Cascading Style Sheets
ng-values> */ font-variant-numeric: tabular-nums; /* <numeric-spacing-values> */ font-variant-numeric: diagonal-fractions; /* <numeric-fraction-values> */ font-variant-numeric: stacked-fractions; /* <numeric-fraction-values> */ font-variant-numeric: oldstyle-nums stacked-fractions; /* global values */ font-variant-numeric: inherit; font-variant-numeric: initial; font-variant-numeric: unset; this property can take one of two forms: either the keyword value normal or one or more of the other values listed below, space-separated, in any order.
...two values are possible: lining-nums activating the set of figures where numbers are all lying on the baseline.
... oldstyle-nums activating the set of figures where some numbers, like 3, 4, 7, 9 have descenders.
...And 5 more matches
grid-area - CSS: Cascading Style Sheets
WebCSSgrid-area
if four <grid-line> values are specified, grid-row-start is set to the first value, grid-column-start is set to the second value, grid-row-end is set to the third value, and grid-column-end is set to the fourth value.
... when grid-column-end is omitted, if grid-column-start is a <custom-ident>, grid-column-end is set to that <custom-ident>; otherwise, it is set to auto.
... when grid-row-end is omitted, if grid-row-start is a <custom-ident>, grid-row-end is set to that <custom-ident>; otherwise, it is set to auto.
...And 5 more matches
quotes - CSS: Cascading Style Sheets
WebCSSquotes
the quotes css property sets how the browser should render quotation marks that are added using the open-quotes or close-quotes values of the css content property.
... syntax /* keyword value */ quotes: none; quotes: auto; /* <string> values */ quotes: "«" "»"; /* set open-quote and close-quote to the french quotation marks */ quotes: "«" "»" "‹" "›"; /* set two levels of quotation marks */ /* global values */ quotes: inherit; quotes: initial; quotes: unset; values none the open-quote and close-quote values of the content property produce no quotation marks.
... auto appropriate quote marks will be used for whatever language value is set on the selected elements (i.e.
...And 5 more matches
shape-outside - CSS: Cascading Style Sheets
syntax /* keyword values */ shape-outside: none; shape-outside: margin-box; shape-outside: content-box; shape-outside: border-box; shape-outside: padding-box; /* function values */ shape-outside: circle(); shape-outside: ellipse(); shape-outside: inset(10px 10px 10px 10px); shape-outside: polygon(10px 10px, 20px 20px, 30px 30px); shape-outside: path('m0.5,1 c0.5,1,0,0.7,0,0.3 a0.25,0.25,1,1,1,0.5,0.3 a0.25,0.25,1,1,1,1,0.3 c1,0.7,0.5,1,0.5,1 z'); /* <url> value */ shape-outside: url(image.png); /* <gradient> value */ shape-outside: linear-gradient(45deg, rgba(255, 255, 255, 0) 150px, red 150px); /* global values */ shape-outside: initial; sh...
...ape-outside: inherit; shape-outside: unset; the shape-outside property is specified using the values from the list below, which define the float area for float elements.
... <basic-shape> the float area is computed based on the shape created by of one of inset(), circle(), ellipse(), polygon(), or as added in the level 2 specification path().
...And 5 more matches
DOM onevent handlers - Developer guides
you can specify an on<…> event handler for a particular event (such as click) for a given object in different ways: adding an html attribute named on<eventtype>: <button onclick="handleclick()">, or by setting the corresponding property from javascript: document.queryselector("button").onclick = function(event) { … }.
... non-element objects event handlers can also be set with properties on non-element objects that generate events, like window, document, xmlhttprequest, and others.
...when the element is built from the html, the value of its onevent attributes are copied to the dom object that represents the element, so that accessing the attributes' values using javascript will get the value set in the html.
...And 5 more matches
disabled - HTML: Hypertext Markup Language
the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>.
...if this attribute is not specified, the control inherits its setting from the containing element, for example fieldset; if there is no containing element with the disabled attribute set, and the control itself does not have the attribute, then the control is enabled.
... note: if a <fieldset> is disabled, the descendant form controls are all disabled, with the exception of form controls within the <legend>.
...And 5 more matches
HTML attribute: multiple - HTML: Hypertext Markup Language
the boolean multiple attribute, if set, means the form control accepts one or more values.
... depending on the type, the form control may have a different appearance if the multiple attribute is set.
...most browsers displaying a scrolling list box for a <select> control with the multiple attribute set versus a single line dropdown when the attribute is ommitted.
...And 5 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
character set dates and times in html are always strings which use the ascii character set.
... when you set the value of a datetime-local input, the string is normalized into a standard form.
... time zone offset string a time zone offset string specifies the offset in either a positive or a negative number of hours and minutes from the standard time base.
...And 5 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
however, this can be useful when creating media elements whose source will be set at a later time, under user control.
...if the server does not give credentials to the origin site (by not setting the access-control-allow-origin: http header), the image will be tainted, and its usage restricted.
...see cors settings attributes for additional information.
...And 5 more matches
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
setting autocomplete="off" on the button disables this feature; see bug 654072.
...(if this attribute is not set, the <button> is associated with its ancestor <form> element, if any.) this attribute lets you associate <button> elements to <form>s anywhere in the document, not just inside a <form>.
... multipart/form-data: use to submit <input> elements with their type attributes set to file.
...And 5 more matches
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
idl attributes value methods select(), setrangetext(), setselectionrange().
...its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property.
...since character widths vary, this may or may not be exact and should not be relied upon to be so; the resulting input may be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use).
...And 5 more matches
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
you can set a default value for the input by including a value inside the value attribute, like so: <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" value="2017-w01"> one thing to note is that the displayed format may differ from the actual value, which is always formatted yyyy-www.
... you can also get and set the value in javascript using the input element's value property, for example: var weekcontrol = document.queryselector('input[type="week"]'); weekcontrol.value = '2017-w45'; additional attributes in addition to the attributes common to <input> elements, week inputs offer the following attributes: attribute description max the latest year and week to accept as valid input min the earliest year and week to accept as valid input readonly a boolean which, if present, indicates that the user cannot edit the field's contents step the stepping...
...its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property.
...And 5 more matches
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
see cors settings attributes for a more descriptive explanation of its valid arguments.
... defer this boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing domcontentloaded.
... nomodule this boolean attribute is set to indicate that the script should not be executed in browsers that support es2015 modules — in effect, this can be used to serve fallback scripts to older browsers that do not support modular javascript code.
...And 5 more matches
<tbody>: The Table Body element - HTML: Hypertext Markup Language
WebHTMLElementtbody
the html table body element (<tbody>) encapsulates a set of table rows (<tr> elements), indicating that they comprise the body of the table (<table>).
...possible values are: left, aligning the content to the left of the cell center, centering the content in the cell right, aligning the content to the right of the cell justify, inserting spaces into the textual content so that the content is justified in the cell char, aligning the textual content on a special character with a minimal offset, defined by the char and charoff attributes.
... if this attribute is not set, the left value is assumed.
...And 5 more matches
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
WebHTMLElementtfoot
the html <tfoot> element defines a set of rows summarizing the columns of the table.
...possible values are: left, aligning the content to the left of the cell center, centering the content in the cell right, aligning the content to the right of the cell justify, inserting spaces into the textual content so that the content is justified in the cell char, aligning the textual content on a special character with a minimal offset, defined by the char and charoff attributes unimplemented (see bug 2212).
... if this attribute is not set, the left value is assumed.
...And 5 more matches
<thead>: The Table Head element - HTML: Hypertext Markup Language
WebHTMLElementthead
the html <thead> element defines a set of rows defining the head of the columns of the table.
...possible values are: left, aligning the content to the left of the cell center, centering the content in the cell right, aligning the content to the right of the cell justify, inserting spaces into the textual content so that the content is justified in the cell char, aligning the textual content on a special character with a minimal offset, defined by the char and charoff attributes unimplemented (see bug 2212).
... if this attribute is not set, the left value is assumed.
...And 5 more matches
Using the application cache - HTML: Hypertext Markup Language
you do not need to list all pages you want cached in the manifest file, the browser implicitly adds every page that the user visits and that has the manifest attribute set to the application cache.
... subsequent visits to that document cause the browser to load the document and other assets specified in the manifest file from the application cache (not from the server).
...safari has a similar "empty cache" setting in its preferences but a browser restart may also be required.
...And 5 more matches
MIME types (IANA media types) - HTTP
each type has its own set of possible subtypes, and a mime type always has both a type and a subtype, never just one or the other.
... an optional parameter can be added to provide additional details: type/subtype;parameter=value for example, for any mime type whose main type is text, the optional charset parameter can be used to specify the character set used for the characters in the data.
... if no charset is specified, the default is ascii (us-ascii) unless overridden by the user agent's settings.
...And 5 more matches
SameSite cookies - HTTP
the samesite attribute of the set-cookie http response header allows you to declare if your cookie should be restricted to a first-party or same-site context.
... set-cookie: flavor=choco; samesite=none to fix this, you will have to add the secure attribute to your samesite=none cookies.
... set-cookie: flavor=choco; samesite=none; secure a secure cookie is only sent to the server with an encrypted request over the https protocol.
...And 5 more matches
Redirections in HTTP - HTTP
in that case, try a <meta> element with its http-equiv attribute set to refresh in the <head> of the page.
...always set it to 0 for accessibility compliance.
... javascript redirections redirections in javascript are performed by setting a url string to the window.location property, loading the new page: window.location = "https://example.com/"; like html redirections, this can't work on all resources, and obviously, this will only work on clients that execute javascript.
...And 5 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
const pi = 3.14; // variable pi is set pi = 1; // will throw an error because you cannot change a constant variable.
... control structures javascript has a similar set of control structures to other languages in the c family.
...it can also be used to set and get properties with names that are reserved words: obj.for = 'simon'; // syntax error, because 'for' is a reserved word obj['for'] = 'simon'; // works fine starting in ecmascript 5, reserved words may be used as object property names "in the buff".
...And 5 more matches
Intl.Locale.prototype.numeric - JavaScript
if numeric is set to false, there will be no special handling of numeric values in strings.
... if numeric is set to true, then the locale will take numeric characters into account when collating strings.
... examples setting the numeric value via the locale string in the unicode locale string spec, the values that numeric represents correspond to the key kn.
...And 5 more matches
Map - JavaScript
maps object is similar to map—both let you set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key.
... setting object properties setting object properties works for map objects as well, and can cause considerable confusion.
... therefore, this appears to work in a way: let wrongmap = new map() wrongmap['bla'] = 'blaa' wrongmap['bla2'] = 'blaaa2' console.log(wrongmap) // map { bla: 'blaa', bla2: 'blaaa2' } but that way of setting a property does not interact with the map data structure.
...And 5 more matches
Promise.prototype.then() - JavaScript
the behavior of the handler function follows a specific set of rules.
...the value received and returned is: " + value); return value; }); // instantly logging the value of thenprom console.log(thenprom); // using settimeout we can postpone the execution of a function to the moment the stack is empty settimeout(() => { console.log(thenprom); }); // logs, in order: // promise {[[promisestatus]]: "pending", [[promisevalue]]: undefined} // "this gets called after the end of the main stack.
...the below snippet simulates asynchronous code with the settimeout function.
...And 5 more matches
TypedArray - JavaScript
set value and get value etc., operate on that array buffer address.
...these objects all have a common syntax for their constructors: new typedarray(); new typedarray(length); new typedarray(typedarray); new typedarray(object); new typedarray(buffer [, byteoffset [, length]]); where typedarray is a constructor for one of the concrete types.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
...And 5 more matches
eval() - JavaScript
thus, any use of eval() will force the browser to do long expensive variable name lookups to figure out where the variable exists in the machine code and set its value.
..."a.b.c" var result = getdescendantprop(obj, proppath); setting a property that way works similarly: function setdescendantprop(obj, desc, value) { var arr = desc.split('.'); while (arr.length > 1) { obj = obj[arr.shift()]; } return obj[arr[0]] = value; } var obj = {a: {b: {c: 0}}}; var proppath = getproppath(); // returns e.g.
... "a.b.c" var result = setdescendantprop(obj, proppath, 1); // obj.a.b.c will now be 1 use functions instead of evaluating snippets of code javascript has first-class functions, which means you can pass functions as arguments to other apis, store them in variables and objects' properties, and so on.
...And 5 more matches
<mpadded> - MathML
the mathml <mpadded> element is used to add extra padding and to set the general adjustment of position and size of enclosed contents.
... depth sets or increments the depth.
... height sets or increments the height.
...And 5 more matches
Web video codec guide - Web media technologies
lossy compression to some degree, artifacts and other forms of quality degradation wil occur, depending on the specific codec and how much compression is being applied the more the encoded video is allowed to deviate from the source, the easier it is to accomplish higher compression rates quality setting the higher the quality configuration, the more like the original media the encoded video will look in general, higher quality settings will result in larger encoded video files; the degree to which this is true varies depending on the codec bit rate quality generally improves with higher bit rates higher bit rates inherently lead to larger output files the options ...
...each frame of video is presented by applying a set of changes to the currently-visible frame.
... staircase effect the staircase effect is a spatial artifact that occurs when diagonal straight or curved edges that should be smooth take on a jagged appearance, looking somewhat like a set of stair steps.
...And 5 more matches
Populating the page: how browsers work - Web Performance
dns lookup the first step of navigating to a web page is finding where the assets for that page are located.
... tcp handshake once the ip address is known, the browser sets up a connection to the server via a tcp three-way handshake.
... <!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...
...And 5 more matches
Navigation and resource timings - Web Performance
both provide the same read-only properties, but navigation timing measures the main document's timings whereas the resource timing provides the times for all the assets or resources called in by that main document and the resources' requested resources.
...if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request.
... navigation timing when a user requests a web site or application, to populate the browser the user agent goes through a series of steps, including a dns lookup, tcp handshake, and ssl negotiation, before the user agent makes the actual request and the servers return the requested assets.
...And 5 more matches
Understanding latency - Web Performance
subsequent requests will have less latency because the connection to the server is already set.
... the latency associated with a single asset, especially a basic html page, may seem trivial.
...different browser developer tools have different preset options, the characteristics emulated include download speed, upload speed, and minimum latency, or the minimum amount of type it takes to send a packet of data.
...And 5 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
the default option is chosen when the user won't make a choice, and the other two are set when the user clicks yes or no respectively.
... create a notification the example app creates a notification out of the available data — a game is picked at random, and the chosen one feeds the notification with the content: it sets the game's name as the title, mentioning the author in the body, and showing the image as an icon: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } a ne...
...you can examine the service workers cookbook examples, try to set up a push messaging server using firebase, or build your own server (using node.js for example).
...And 5 more matches
display - SVG: Scalable Vector Graphics
WebSVGAttributedisplay
when applied to a container element, setting display to none causes the container and all of its children to be invisible; thus, it acts on groups of elements as a group.
... when the display attribute is set to none, then the given element does not become part of the rendering tree.
... 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.
...And 5 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 ...
... value list of <length> default value none animatable yes fedropshadow for <fedropshadow>, dx defines the x offset of the droped shadow.
... the unit used to resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element.
...And 5 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...
... value list of <length> default value none animatable yes fedropshadow for <fedropshadow>, dy defines the y offset of the dropped shadow.
... the unit used to resolve the value of the attribute is set by the primitiveunits attribute of the <filter> element.
...And 5 more matches
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
html,body,svg { height:100% } <svg viewbox="0 0 30 10" xmlns="http://www.w3.org/2000/svg"> <circle id="mycircle" cx="5" cy="5" r="4" stroke="blue"/> <use href="#mycircle" x="10" fill="blue"/> <use href="#mycircle" x="20" fill="white" stroke="red"/> <!-- stroke="red" will be ignored here, as stroke was already set on mycircle.
... most attributes (except for x, y, width, height and (xlink:)href) do not override those set in the ancestor.
...(this differs from how css style attributes override those set 'earlier' in the cascade).
...And 5 more matches
Referer header: privacy and security concerns - Web security
for example, consider a "reset password" page with a social media link in a footer.
... if the link was followed, depending on how information was shared the social media site may receive the reset password url and may still be able to use the shared information, potentially compromising a user's security.
...a sensible application would remove such risks by making password reset urls only usable for a single use, or when combined with a unique user token, and transmitting sensitive data in different ways.
...And 5 more matches
Private Properties - Archive of obsolete content
it is possible to read this section on its own, but to fully appreciate how namespaces work, and the problem they set out to solve, it is recommended to read the entire article.
... to make a private property readable/writable from any function, it's common to define getter/setter functions for the property, respectively: point.prototype.getx = function () { return this._x; }; point.prototype.setx = function (x) { this._x = x; }; point.prototype.gety = function () { return this._y; }; point.prototype.sety = function (y) { this._y = y; }; the above technique is simple and clearly expresses intent.
... using closures another common technique, is to define private properties as variables and their getter and setter functions as a closure over these variables: function point(_x, _y) { this.getx = function () { return _x; }; this.setx = function (x) { _x = x; }; this.gety = function () { return _y; }; this.sety = function (y) { _y = y; }; } note that this technique requires member functions that need access to private properties to be defined on the object itself, instead of its prototype.
...And 4 more matches
selection - Archive of obsolete content
get and set text and html selections in the current web page.
...ntiguous selections as html: var selection = require("sdk/selection"); if (!selection.iscontiguous) { for (var subselection in selection) { console.log(subselection.html); } } surround html selections with delimiters: var selection = require("sdk/selection"); selection.on('select', function () { selection.html = "\\\" + selection.html + "///"; }); globals properties text gets or sets the current selection as plain text.
... setting the selection removes all current selections, inserts the specified text at the location of the first selection, and selects the new text.
...And 4 more matches
jpm - Archive of obsolete content
installing jpm globally npm install jpm --global depending on your setup, you might need to run this as an administrator: sudo npm install jpm --global installing jpm locally if you do not wish to, or are unable to, install jpm globally, you may instead install it locally: cd $home && npm install jpm to run jpm from a terminal when installed locally, you must add the directory "$home/node_modules/.bin/" to your terminal's path first.
...this is due to firefox 48, and later, not having the option to run add-ons which are unsigned.]: jpm run -b nightly you can set the jpm_firefox_binary environment variable with the path to the version of firefox you want to run.
... when you invoke jpm run or jpm test without the -b option, jpm first checks jpm_firefox_binary, and use this as the path if it is set.
...And 4 more matches
Default Preferences - Archive of obsolete content
introduction a key part of any extension is the default settings that come with it.
... mozilla provides a simple way of shipping default settings by allowing default preferences.
...user supplied prefs are set using the gui and also by modifying a profile's prefs.js file (which uses the user_pref() function).
...And 4 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
fixme: figure 1: uncheck “exclude browser files.” set up quicknote for the purposes of this explanation, we’re going to use the file-storage mechanism in quicknote1 for our debugger.
... fixme: figure 2: selecting source code inserting breakpoints now you’ll want to set some breakpoints.
...in the quicknote example, we first set one breakpoint and then stepped through it.
...And 4 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
passing around functions/code as strings often you'll want to pass functions or code to other functions, most notoriously settimeout and addeventlistener.
...settimeout("dosomething();", 100); addeventlistener("load", "myaddon.init(); myaddon.onload();", true); setinterval(am_i_a_string_or_function_reference_qmark, 100); that in itself is certainly not elegant, but it may also become a security issue if you pass code that was externally retrieved (or at least contains bits of externally retrieved data): // do not use!
... settimeout("alert('" + xhr.responsetext + "');", 100); // attacker manipulated responsetext to contain "attack!'); format_computer(); alert('done" settimeout("alert('attack!'); format_computer(); alert('done');", 100); as a general rule of thumb, just don't pass code around as strings and execute it by calling eval, settimeout and friends.
...And 4 more matches
The Essentials of an Extension - Archive of obsolete content
the chrome.manifest file chrome is the set of user interface elements of the application window that are outside of a window's content area.
...so we settled on the letter "l".
... dtd strings are resolved and set when the document is being loaded.
...And 4 more matches
Signing an XPI - Archive of obsolete content
you can either set this permanently via control panel->system properties->advanced->environment variables->system variables or do it each time you run the tools from the command-line (preferably using a batch file).
... c:\> set path=c:\apps\nss-3.11.4\bin\;c:\apps\nss-3.11.4\lib\;c:\apps\nspr-4.6\lib\;%path% an easier way is to copy everything from your new directories c:\apps\nss-3.11.4\ and c:\apps\nspr-4.6\ including sub directories to the same directory - fx c:\apps\codesigning\ - and then run every command from that.
... enter new password: re-enter password: create a test certificate create a test certificate, using the -p option to set a password for the new certificate c:\projects\codesigning\> signtool -g mytestcert -d .
...And 4 more matches
Promises - Archive of obsolete content
let resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("get", dataurl); xhr.responsetype = "json"; xhr.send(); }); let data = resp.target.response; // use the response to construct form data object for the // second request.
... notifyuser(resp.target.responsetext); }); example using promise-based helper the following example relies on the helper function defined below.
... let xhr = yield request(dataurl, { responsetype: "json" }); let data = xhr.response; // use the response to construct form data object for the // second request.
...And 4 more matches
Creating a dynamic status bar extension - Archive of obsolete content
we end up reloading data from each of the windows once in 10 minutes - fixing this by creating a js component responsible for communication with the server is a good idea for one of the future articles startup: function() { this.refreshinformation(); window.setinterval(this.refreshinformation, 10*60*1000); }, this starts by calling our refreshinformation() function, which is responsible for fetching and displaying stock ticker information in the status bar panel.
...after doing that, we install an interval routine on the browser window by calling window.setinterval().
...setting the httprequest.onload property to our inforeceived() function configures the request to call inforeceived() when the response is received from the server.
...And 4 more matches
Using content preferences - Archive of obsolete content
this makes it possible to write an extension that lets the user customize the appearance of specific web sites (setting the font size larger on sites that use obnoxiously small fonts, for instance).
... the content preferences service, implemented by nsicontentprefservice, offers functions for setting and retrieving preferences for specific sites or in the global preference space; global preferences are used whenever a site-specific preference isn't available.
...example: setting and retrieving preferences this example demonstrates how to save a preference and then retrieve its value.
...And 4 more matches
Documentation for BiDi Mozilla - Archive of obsolete content
this is determined in nstextfragment::setto the page includes a element with the attribute dir=rtl, either explicitly (nsgenerichtmlelement::mapcommonattributesinto), or as a consequence of a style rule (mapdeclarationtextinto in nscssstylerule.cpp) all these cases use nsdocument::enablebidi to set the flag mbidienabled.
... framemanager::setframeproperty is used to set the following flags and pointers (for terminology see the specification of the uba): embeddinglevel: the embedding level of the frame textclass: the text class of the frame.
..."reordering" of frames is accomplished by setting the appropriate frame coordinates.
...And 4 more matches
Mozilla Application Framework in Detail - Archive of obsolete content
unlike many other application frameworks, you are not limited to the widget set we provide, nor limited to the "look and feel" of the native os.
...open source and freely available, gecko is small in size and modular and achieves rendering speed superior to all other browser engines - which makes it perfect for embedding into both desktop applications such as browsers and new devices such as browsing appliances and set top boxes.
... supporting gecko technologies provide a complete set of resources for efficient development, including full support of web standards, a cross-platform/cross-device user interface language, an extensible architecture and embedding technologies.
...And 4 more matches
Windows stub installer - Archive of obsolete content
the windows stub installer project resides at: <http://lxr.mozilla.org/seamonkey/sou...windows/setup/> how do we get setup to debug the windows stub installer?
... build your entire mozilla tree, which should build the stub installer in the setup directory as well.
... (if you need to rebuild stub installer, got to /mozilla/xpinstall/wizard/windows/setup and type "nmake /f makefile.win") go to mozilla/xpinstall/wizard/windows/builder on the shell prompt type "perl build.pl".
...And 4 more matches
Sorting Results - Archive of obsolete content
there are two additional attributes used for sorting, which you may set on a column to specify the initial sort.
...only one column should have this attribute set, as a tree may only be sorted by one column at a time.
...the sortactive attribute may be set to true or false and specifies which column the tree is sorted by.
...And 4 more matches
Tree Widget Changes - Archive of obsolete content
you can create a checkbox column by setting the type attribute of a column to checkbox.
... <treecol type="checkbox"> you can then set or clear the checkbox for a particular cell in that column by setting the value attribute to true, or leaving out the attribute.
...(do not set id of the column to be 'checked' it will cause problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */ list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ...
...And 4 more matches
Advanced Rules - Archive of obsolete content
member element the next element is the member element, which is used to iterate through a set of child resources.
...ather/cities"> <rdf:li resource="http://www.xulplanet.com/rdf/weather/city/paris"/> <rdf:li resource="http://www.xulplanet.com/rdf/weather/city/manchester"/> <rdf:li resource="http://www.xulplanet.com/rdf/weather/city/melbourne"/> <rdf:li resource="http://www.xulplanet.com/rdf/weather/city/kiev"/> </rdf:seq> <rdf:description about="http://www.xulplanet.com/rdf/weather/city/paris"> <cityset:name>paris</cityset:name> </rdf:description> .
...thus the parent will be the value of the list variable, which has been set to the root resource 'http://www.xulplanet.com/rdf/weather/cities'.
...And 4 more matches
Broadcasters and Observers - Archive of obsolete content
<broadcasterset> <broadcaster id="isoffline" label="offline"/> </broadcasterset> any elements that are watching the broadcaster will be modified automatically whenever the broadcaster has its label attribute changed.
...like other non-displayed elements, the broadcasterset element serves as a placeholder for broadcasters.
... you should declare all your broadcasters inside a broadcasterset element so that they are all kept together.
...And 4 more matches
Modifying a XUL Interface - Archive of obsolete content
you can then set attributes of the element using the setattribute() function and append it to the xul document using the appendchild() function.
... for example, the following will add a button to a xul window: example 1 : source view <script> function addbutton(){ var abox = document.getelementbyid("abox"); var button = document.createelement("button"); button.setattribute("label","a new button"); abox.appendchild(button); } </script> <box id="abox" width="200"> <button label="add" oncommand="addbutton();"/> </box> this example has two parts a box container element in xul.
... addbutton() then assigns the label 'a new button' to the button using the setattribute() function.
...And 4 more matches
More Tree Features - Archive of obsolete content
to create a set of nested rows, all we need to do is add a second treechildren element inside the parent treeitem.
...essentially, a treeitem element can contain either single rows which are declared with the treerow element or a set of rows which are declared with the treechildren element.
...for a content tree view, this will set the open attribute to reflect the current state.
...And 4 more matches
iframe - Archive of obsolete content
<menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net" /> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> <iframe id="myframe" flex="1"/> <script> function donav(obj) { var url = obj.selecteditem.value; // note the firstchild is the menupopup element document.getelementbyid('myframe').setattribute('src', url); } </script> attributes showcaret type: boolean whether or not to cause a typing caret to be visible in the content area.
... the type of browser, which can be used to set access of the document loaded inside the browser.
... if this is not set, the loaded document has the same access as the window containing the browser.
...And 4 more matches
tabbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container used to display a set of tabbed pages of elements.
... handlectrltab type: boolean if set to true or omitted, the tabbox will switch to the next tab when the control and tab keys are pressed.
...if this attribute is set to false, these keys do not navigate between tabs.
...And 4 more matches
toolbox - Archive of obsolete content
you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar.
... 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="hom...
...ave two toolbars inside of one toolbox above." width="20"/> </window> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element.
...And 4 more matches
treecell - Archive of obsolete content
you can set the text for the cell using the label attribute.
... properties type: space-separated list of property names sets the properties of the element, which can be used to style the element.
... src type: uri set this to the uri of an image to appear in the tree cell.
...And 4 more matches
wizardpage - Archive of obsolete content
next type: id set to the pageid of the next wizardpage after this one.
... when set, the page with this pageid is displayed when the next button is pressed.
... pageid type: id this attribute should be set to a string that identifies the page's identifer in the wizard.
...And 4 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
for an overview of ssl, see "introduction to ssl." for an overview of encryption and decryption, see "encryption and decryption." information on digital signatures is available from "digital signatures." public-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks.
...however, it's important to note that these two assumptions are true only if unauthorized personnel have not gained access to the user's machine or password, the password for the client software's private key database has been set, and the software is set up to request the password at reasonable frequent intervals.
... ssl protocol signed and encrypted email single sign-on object signing ssl protocol the secure sockets layer (ssl) protocol is a set of rules governing server authentication, client authentication, and encrypted communication between servers and clients.
...And 4 more matches
Building a Theme - Archive of obsolete content
setting up the development environment themes and extensions are packaged and distributed in zip files or bundles, with the xpi (pronounced “zippy”) file extension.
...this gives us a base set of styles to work with.
... browser to chrome/browser/ communicator to chrome/communicator/ you should end up with this directory structure: <ext path>/ /install.rdf /chrome.manifest /chrome/ browser/ communicator/ global/ mozapps/ after this, it would be a good idea to read the article setting up extension development environment and follow the directions there.
...And 4 more matches
Using SSH to connect to CVS - Archive of obsolete content
introduction this document is a guide to setting up access to cvs.mozilla.org using ssh.
... setting up cvs to use ssh in your system's environment, make sure thatcvs_rsh is set to whatever your ssh binary is called; a full path is not necessary if ssh is already in your path.
...if you don't already run ssh-agent on your computer, it's probably easiest to start it up whenever you set up your environment to checkout and build mozilla.
...And 4 more matches
Using workers in extensions - Archive of obsolete content
that file, ticker_worker.js, is shown here: var symbol = ""; function refreshinformation() { if (!symbol) { throw "no symbol set!"; } var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var output = httprequest.responsetext; if (output) { postmessage(output.trim()); } httprequest = null; } var httprequest = new xmlhttprequest(); httprequest.open("get", fullurl, true); httprequest.onload = inforeceived; httprequest.s...
...end(null); } setinterval(function() { refreshinformation(); }, 10*60*1000); onmessage = function(event) { if (event.data) { symbol = event.data.touppercase(); } refreshinformation(); } when the worker thread is started, the main body of this code (in lines 26-35) is executed.
... it starts by setting up an interval handler (in lines 26-28) that calls refreshinformation() every 10 minutes.
...And 4 more matches
CSS - Archive of obsolete content
ArchiveWebCSS
obsolete css features -moz-bindingthe -moz-binding css property is used by mozilla-based applications to attach an xbl binding to a dom element.-moz-border-bottom-colorsin mozilla applications like firefox, the -moz-border-bottom-colors css property sets a list of colors for the bottom border.-moz-border-left-colorsin mozilla applications like firefox, the -moz-border-left-colors css property sets a list of colors for the left border.-moz-border-right-colorsin mozilla applications like firefox, the -moz-border-right-colors css property sets a list of colors for the right border.-moz-border-top-colorsin mozilla applications like firefox, the -moz-border-top-colors css property sets a list of colors for the top border.-moz-stack-sizing-moz-stack-sizing is an extended css property.
...it only works on mac os x.-ms-acceleratorthe -ms-accelerator css property is a microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut.-ms-block-progressionthe -ms-block-progression css property is a microsoft extension that specifies the block progression and layout orientation.-ms-content-zoom-chainingthe -ms-content-zoom-chaining css property is a microsoft extension specifying the zoom behavior that occurs when a user hits the zoom limit duri...
...n that specifies where zoom snap-points are located.-ms-content-zoom-snap-typethe -ms-content-zoom-snap-type css property is a microsoft extension that specifies how zooming is affected by defined snap-points.-ms-content-zoomingthe -ms-content-zooming css property is a microsoft extension that specifies whether zooming is enabled.-ms-filterthe -ms-filter css property is a microsoft extension that sets or retrieves the filter or collection of filters applied to an object.-ms-flow-fromthe -ms-flow-from css property is a microsoft extension that gets or sets a value identifying a region container in the document that accepts the content flow from the data source.-ms-flow-intothe -ms-flow-into css property is a microsoft extension that gets or sets a value identifying an iframe container in the d...
...And 4 more matches
JSObject - Archive of obsolete content
setmember sets the value of a property of a javascript object.
... setslot sets the value of an array element of a javascript object.
... declaration public void removemember(string name) setmember method.
...And 4 more matches
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
giving the fish some style with the markup all set, it was time to style.
... floating fish with the cards set up to float, the next step was to place the images appropriately.
...since the image was floated, any background or border we set on the h3 would "slide under" the image; this is an expected effect with floated elements.
...And 4 more matches
Implementation Status - Archive of obsolete content
n title status notes bugs 3.1 namespaces supported 3.2.1 common attributes supported 3.2.2 linking attributes supported 3.2.3 single-node binding attributes supported 3.2.4 node-set binding attributes supported 3.2.5 model item property attributes partial in some cases a loop error can occur on valid bindings 302168; 3.3.1 model supported 3.3.2 instance partial instance element with two child element does not trigger exception 3373...
... xforms-model-destruct supported 4.3.1 xforms-rebuild supported 4.3.2 xforms-recalculate supported 4.3.3 xforms-revalidate supported 4.3.4 xforms-refresh supported 4.3.5 xforms-reset supported 4.3.6 xforms-next xforms-previous supported 4.3.7 xforms-focus supported 4.3.8 xforms-help xforms-hint supported 4.3.9 xforms-submit partial see section 11.2 for more details 4.
...pload supported 8.1.7 range partial 316355; 343523; 8.1.8 trigger supported 8.1.9 submit supported 8.1.10 select partial @selection does not work, select inside repeat may not work correctly, select that mixes itemsets with items may show them in the wrong order 282840; 371595; 372127; 8.1.11 select1 partial there are some resize issues, select/deselect/valuechange firing in wrong order.
...And 4 more matches
Desktop mouse and keyboard controls - Game development
inside them we can get the code of the key that was pressed from the keycode property of the event object, see which key it is, and then set the proper variable.
... left arrow: function keydownhandler(event) { if(event.keycode == 39) { rightpressed = true; } else if(event.keycode == 37) { leftpressed = true; } if(event.keycode == 40) { downpressed = true; } else if(event.keycode == 38) { uppressed = true; } } the keyuphandler looks almost exactly the same as the keydownhandler above, but instead of setting the pressed variables to true, we would set them to false.
... if the left arrow is pressed (⬅︎; key code 37), we can set the leftpressed variable to true and in the draw function perform the action assigned to it — move the ship left: function draw() { ctx.clearrect(0, 0, canvas.width, canvas.height); if(rightpressed) { playerx += 5; } else if(leftpressed) { playerx -= 5; } if(downpressed) { playery += 5; } else if(uppressed) { playery -= 5; } ctx.drawimage(img, playerx, playery); requestanimationframe(draw); } the draw function first clears the whole canvas — we draw everything from scratch on every single frame.
...And 4 more matches
Build the brick field - Game development
setting up the brick variables the overall aim of this lesson is to render a few lines of code for the bricks, using a nested loop that works through a two-dimensional array.
... first however we need to set up some variables to define information about the bricks such as their width and height, rows and columns, etc.
... var brickrowcount = 3; var brickcolumncount = 5; var brickwidth = 75; var brickheight = 20; var brickpadding = 10; var brickoffsettop = 30; var brickoffsetleft = 30; here we've defined the number of rows and columns of bricks , their width and height, the padding between the bricks so they won't touch each other and a top and left offset so they won't start being drawn right from the edge of the canvas.
...And 4 more matches
Paddle and keyboard controls - Game development
to listen for key presses, we will set up two event listeners.
... add the following lines just above the setinterval() line at the bottom of your javascript: document.addeventlistener("keydown", keydownhandler, false); document.addeventlistener("keyup", keyuphandler, false); when the keydown event is fired on any of the keys on your keyboard (when they are pressed), the keydownhandler() function will be executed.
...the relevant variable in each case is set to true.
...And 4 more matches
Build the brick field - Game development
to begin with we've included the brickinfo object, as this will come in handy very soon: function initbricks() { brickinfo = { width: 50, height: 20, count: { row: 3, col: 7 }, offset: { top: 50, left: 60 }, padding: 10 }; } this brickinfo object will hold all the information we need: the width and height of a single brick, the number of rows and columns of bricks we will see on screen, the top and left offset (the location on the canvas where we shall start to draw the bricks) and the padding between each row and column of bricks.
...fill in the contents as shown below: for(c=0; c<brickinfo.count.col; c++) { for(r=0; r<brickinfo.count.row; r++) { var brickx = 0; var bricky = 0; newbrick = game.add.sprite(brickx, bricky, 'brick'); game.physics.enable(newbrick, phaser.physics.arcade); newbrick.body.immovable = true; newbrick.anchor.set(0.5); bricks.add(newbrick); } } here we're looping through the rows and columns to create the new bricks and place them on the screen.
... the newly created brick is enabled for the arcade physics engine, it's body is set to be immovable (so it won't move when hit by the ball), and we're also setting the anchor to be in the middle and adding the brick to the group.
...And 4 more matches
Organizing your CSS - Learn web development
keep it consistent if you get to set the rules for the project or are working alone, then the most important thing to do is to keep things consistent.
...if spaces, how many spaces?) having a set of rules you always follow reduces the amount of mental overhead needed when writing css, as some of the decisions are already made.
...you will typically have rules set up for: body p h1, h2, h3, h4, h5 ul and ol the table properties links in this section of the stylesheet we are providing default styling for the type on the site, setting up a default style for data tables and lists and so on.
...And 4 more matches
How can we design for all types of users? - Learn web development
absolute units absolute units are not proportionally calculated but refer to a size set in stone, so to speak, and are expressed most of the time in pixels (px).
...modern browsers get around this rule by pretending that you're asking for "16 pixels when the user sets a zoom factor of 100%".
...relative units are friendlier to accessibility because they respect the settings on the user's system.
...And 4 more matches
HTML basics - Learn web development
for example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and data tables.
...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.
...in the mists of time, when html was young (around 1991/92), doctypes were meant to act as links to a set of rules that the html page had to follow to be considered good html, which could mean automatic error checking and other useful things.
...And 4 more matches
Adding vector graphics to the Web - Learn web development
troubleshooting and cross-browser support for browsers that don't support svg (ie 8 and below, android 2.3 and below), you could reference a png or jpg from your src attribute and use a srcset attribute (which only recent browsers recognize) to reference the svg.
... 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.
... if your svgs aren't showing up at all, it might be because your server isn't set up properly.
...And 4 more matches
Third-party APIs - Learn web development
you can expand the controls available using the map.addcontrol() method; add this to your code, inside the window.onload handler: map.addcontrol(l.mapquest.control()); the mapquest.control() method just creates a simple full-featured control set, and it is placed in the top-right hand corner by default.
... an approach for using third-party apis below we'll take you through an exercise to show you how to use the nytimes api, which also provides a more general set of steps to follow that you can use as an approach for working with new apis.
...initially the <script> element contains a number of variables needed for the setup of the example; below we'll fill in the required functionality.
...And 4 more matches
Adding features to our bouncing balls demo - Learn web development
remember to set the ball() constructor's prototype and constructor appropriately.
... you should do this something like shape.call(this, x, y, 20, 20, exists); it should also define its own properties, as follows: color — 'white' size — 10 again, remember to define your inherited properties as parameters in the constructor, and set the prototype and constructor properties correctly.
...this can be achieved by setting a value for linewidth somewhere after the beginpath() call (3 will do).
...And 4 more matches
Perceived performance - Learn web development
if you're downloading all the assets in the end, the weight of all your assets hasn't improved -- in fact, you may need to add some code -- but because the download of non-immediately necessary assets are delayed in a manner that is not perceptible the the user, the user will feel like the download was faster.
... to minimize the assets required for initial load, separate interactive functionality from content so that required content -- the text, styles, and images visible at initial load -- can be loaded first.
... delay, or lazy load, the rest of the assets.
...And 4 more matches
Multimedia: video - Learn web development
optimizing video delivery it's best to compress all video, optimize <source> order, set autoplay, remove audio from muted video, optimize video preload, and consider streaming the video.
...the default setting is metadata.
... these settings control how much of a video file downloads with page load.
...And 4 more matches
Client-Server Overview - Learn web development
for example, the http request that is sent when you perform a search on mdn for the term "client server overview" will look a lot like the text shown below (it will not be identical because parts of the message depend on your browser/setup).
...illa.org connection: keep-alive pragma: no-cache cache-control: no-cache upgrade-insecure-requests: 1 user-agent: mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, like gecko) chrome/52.0.2743.116 safari/537.36 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 referer: https://developer.mozilla.org/ accept-encoding: gzip, deflate, sdch, br accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7 accept-language: en-us,en;q=0.8,es;q=0.6 cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; csrftoken=zipujsazv6pcgcbjscj1zu6pqzbfmuat; dwf_section_edit=false; dwf_sg_task_completion=false; _gat=1; _ga=ga1.2.1688886003.1471911953; ffo=true the first and second lines contain most of the information we talked about above: the type of request (get).
... it can accept the specified set of characters (accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7) and languages (accept-language: de,en;q=0.7,en-us;q=0.3).
...And 4 more matches
Beginning our React todo list - Learn web development
view a specific subset of tasks: all tasks, only the active task, or only the completed tasks.
... # move into the src directory of your project cd src # delete a few files rm -- app.test.js app.css logo.svg serviceworker.js setuptests.js # move back up to the root of the project cd ..
...setting a value of true means that the button is pressed by default.
...And 4 more matches
Introduction to cross browser testing - Learn web development
once you've got an idea of the required featureset, and what technologies you will likely build these features with, you should start exploring the target audience — what browsers, devices, etc.
... now you know your target testing platforms, you should go back and review the required featureset and what technologies you are going to use.
...this could be a group of friends or family, a group of other employees, a class at a local university, or a professional user testing setup, where people are paid to test out your site and provide results.
...And 4 more matches
Application cache implementation overview
all top level document loading (navigation) channels are set chooseapplicationcache flag, which happens in nsdocshell::douriload().
... channels having that flag set are searching for nsiapplicationcache object prior inspecting normal http cache.
...loadedfromapplicationcache flag is now set true on the channel.
...And 4 more matches
Chrome registration
chrome is the set of user interface elements of the application window that are outside the window's content area.
...the providers work together to supply a complete set of chrome for a particular window, from the images on the toolbar buttons to the files that describe the text, content, and appearance of the window itself.
... skin a skin provider is responsible for providing a complete set of files that describe the visual appearance of the chrome.
...And 4 more matches
Debugging JavaScript
to enable it, go to about:config in the url bar and set devtools.chrome.enabled to true, or set the "enable chrome and add-on debugging" option in the developer tool settings.
... go to about:config and set the following two prefs: devtools.chrome.enabled: true devtools.debugger.remote-enabled: true after you restart the browser, you can access the browser debugger through tools > web developer > browser toolbox.
... (note that before firefox 28, this was labeled "browser debugger" and only the debugger was available, not the whole toolbox.) note that you must accept the incoming connection : (you may disable the pop-up above with the devtools.debugger.prompt-connection set to false in about:config.
...And 4 more matches
HTTP logging
logging http activity by manually setting environment variables sometimes the about:networking approach won't work, for instance if your bug occurs during startup, or you're running on mobile, etc.
... in that case you can set environment variables *before* you launch firefox.
... note that this approach winds up logging the whole browser history, so files can get rather large (they compress well :) setting environment variables differs by operating system.
...And 4 more matches
The Firefox codebase: CSS Guidelines
avoid setting styles in javascript.
... it's generally better to set a class and then specify the styles in css.
... for rtl-aware positioning (left/right), use inset-inline-start/inset-inline-end.
...And 4 more matches
Obsolete Build Caveats and Tips
if you're using visual studio, go to project properties > c/c++ > language > treat wchar_t as built-in type and set it to "yes".
... unsupported sdks the windows sdk for windows server 2008 is not supported, and has been found to cause the following problems: breaks the vcvars32.bat file from visual studio 2008 no longer sets the correct path for the .net framework causes an invalid path which breaks the mozilla build if you have the windows server 2008 sdk installed, uninstall it.
... delete the vcvars32.bat file and repair your visual studio installation with the setup program.
...And 4 more matches
Browser API
management methods the next set of methods manage the resources used by a browser <iframe>.
... htmliframeelement.setvisible() changes the visibility state of a browser <iframe>.
... htmliframeelement.setactive() sets the current <iframe> as the active frame, which has an effect on how it is prioritized by the process manager.
...And 4 more matches
HTML parser threading
once a unicode decoder has been set up, dodataavailable passes the byte data to the decoder whose output is accumulated into a linked list of nshtml5owningutf16buffer objects.
...it acquires mspeculationmutex and while holding it, it creates a new speculation and adds it to the queue of speculations, flushes the tree ops to the main thread, marks the nshtml5streamparser as being in a speculating state and sets the newly created speculation object as the tree op sink (instead of the tree op stage described earlier) of the tree builder.
...if there is a snapshot, the tokenizer used for parsing document.write()-originating data on the main thread is reset to the data state.
...And 4 more matches
Getting Started with Chat
general rules and etiquette once you have your client set up (see software below) and are connected, there are some basic rules you should follow to ensure the most enjoyable and productive experience: as with all mozilla forums and events, agreeing to our community participation guidelines is a requirement for participation.
...for example, you can connect using ssl or a non-secure connection, and you can configure the client to automatically connect to a server and join a particular set of channels when you start the client.
... channels here is a list of channels you should be aware of as a member of the mozilla community: (remember to use irc.mozilla.org and port 6697 or 6667 for your server settings) #qa a channel for qa discussion #developers a channel for mozilla development discussion #sumo a channel for support with firefox for more information about the mozilla irc network and more channels, go here.
...And 4 more matches
WebRequest.jsm
to perform one of these operations, include a property with the appropriate name in the object returned from the listener, and assign it the desired value, as detailed in the table below: operation available in return property cancel onbeforerequest cancel boolean value set to true.
... redirect onbeforesendheaders redirecturl string set to the url to redirect the request to.
... this is only included if you set "requestheaders" in the opt_extrainfospec argument.
...And 4 more matches
BloatView
xpcom_mem_bloat_log if set, this causes a bloat log to be printed on program exit, and each time nstracerefcnt::dumpstatistics is called.
... you can set these environment variables to any of the following values.
...0 nsstylecontextdata 736 259808 325312 489440 338560 1413120 141312 220800 -11040 94944 446016 nslinelayout 1100 2200 225500 402600 562100 1192400 0 0 0 0 0 nslocalfile 424 558832 19928 1696 1272 581728 72080 1272 424 -424 73352 the first set of columns, bytes allocated, shows the amount of memory allocated for the first log file (blank.txt), the difference between the first log file and the second (mozilla.txt), the difference between the second log file and the third (yahoo.txt), the difference between the third log file and the fourth (netscape.txt), and the total amount of memory allocated in the fourth log file.
...And 4 more matches
Investigating leaks using DMD heap scan mode
firefox’s dmd heap scan mode tracks the set of all live blocks of malloc-allocated memory and their allocation stacks, and allows you to log these blocks, and the values stored in them, to a file.
...however, in that case it may be easier to use refcount logging, or rr with a conditional breakpoint set on calls to release() for the leaking object, to see what object actually does the release that causes the leaked object to go away.
...first, in toolkit/components/terminator/nsterminator.cpp, delete everything in runwatchdog but the call to ns_setcurrentthreadname.
...And 4 more matches
DMD
to have dmd active while running it, you just need to set the environment variable dmd=1 when running.
...you can do this by running: adb push $objdir/dist/bin/libdmd.so /sdcard/ second, you will need to make an executable wrapper for fennec which sets an environment variable before launching it.
... (if you are familiar with the recommended "--es env0" method for setting environment variables when launching fennec, note that you cannot use this method here because those are processed too late in the startup process.
...And 4 more matches
I/O Functions
only the ascii character set is supported.
... list of functions: pr_openudpsocket pr_newudpsocket pr_opentcpsocket pr_newtcpsocket pr_importtcpsocket pr_connect pr_connectcontinue pr_accept pr_bind pr_listen pr_shutdown pr_recv pr_send pr_recvfrom pr_sendto pr_transmitfile pr_acceptread pr_getsockname pr_getpeername pr_getsocketoption pr_setsocketoption converting between host and network addresses pr_ntohs pr_ntohl pr_htons pr_htonl pr_familyinet memory-mapped i/o functions the memory-mapped i/o functions allow sections of a file to be mapped to memory regions, allowing read-write accesses to the file to be accomplished by normal memory accesses.
...pollable events are implemented using a pipe or a pair of tcp sockets connected via the loopback address, therefore setting and/or waiting for pollable events are expensive operating system calls.
...And 4 more matches
NSS 3.12.6 release notes
this setting was the default prior 3.12.5 and makes products vulnerable.
... nss_ssl_require_safe_negotiation values: 1: requiresafenegotiation = true unset: requiresafenegotiation = false controls whether safe renegotiation indication is required for initial handshake.
...the default setting for this option is false.
...And 4 more matches
NSS 3.20 release notes
new functions in ssl.h ssl_dhegroupprefset - configure the set of allowed/enabled dhe group parameters that can be used by nss for a server socket.
... new types in sslt.h ssldhegrouptype - enumerates the set of dhe parameters embedded in nss that can be used with function ssl_dhegroupprefset new macros in ssl.h ssl_enable_server_dhe - a socket option user to enable or disable dhe ciphersuites for a server socket notable changes in nss 3.20 the tls library has been extended to support dhe ciphersuites in server applications.
...they can be enabled with the new socket option ssl_enable_server_dhe and the ssl_optionset or the ssl_optionsetdefault api.
...And 4 more matches
NSS sources building testing
nss/cmd contains a set of various tool programs that are built using nss.
...in order to run the tools, you should set your system environment to use the libraries of your build from the "lib" directory, e.g., using the ld_library_path or dyld_library_path environment variable.
...after the build on your computer has succeeded, before you can run the tests on your computer, it might be necessary to set additional environment variables.
...And 4 more matches
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
nss may enumerate all the permanment certificates in a token (cka_token set to true).
...this value is set when the key is generated, so that nss will be able to find the key when the certificate for that key is loaded.
...nss uses installed random number generators if pkcs11_mech_random_flag is set in the installer script.
...And 4 more matches
NSS tools : crlutil
crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional.
... arg1, arg2: specific to extension type extension parameters addext uses the range that was set earlier by addcert and will install an extension to every cert entries within the range.
...should be set to 1 if this extension is critical or 0 otherwise.
...And 4 more matches
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
...options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more.
...where: -g test-type sets status checking test type.
...And 4 more matches
OLD SSL Reference
initialization initializing caches configuration communication functions used by callbacks cleanup chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases, to run the nss sample code.
... ssl, pkcs #11, and the default security databases setting up the certificate and key databases setting up the ca db and certificate setting up the server db and certificate setting up the client db and certificate verifying the server and client certificates building nss programs chapter 3 selected ssl types and structures this chapter describes some of the most important types and structures used with the functions described in the rest of this document, and how to manage the memory used for them.
... ssl initialization functions nss_init nss_initreadwrite nss_nodb_init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache initializing multi-processing with a shared ssl server cache ssl_configmpserversidcache ssl_inheritmpserversidcache ...
...And 4 more matches
NSS_3.12.3_release_notes.html
the information in this table is excerpted from https://developer.mozilla.org/en/nss_reference/nss_environment_variables environment variable value type description nsrandcount integer (byte count) sets the maximum number of bytes to read from the file named in the environment variable nsrandfile (see below).
... if set to to "1" or unset, softoken will trigger an assertion failure in debug builds, and will report an error in non-debug builds.
... if set to "disabled", softoken will ignore forks, and behave as it did in older versions.
...And 4 more matches
NSS Tools crlutil
crl generation script syntax: crl generation script file has the following syntax: line with comments should have <bold>#</bold> as a first symbol of a line set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional.
... arg1, arg2: specific to extension type extension parameters addext uses the range that was set earlier by addcert and will install an extension to every cert entries within the range.
...should be set to 1 if this extension is critical or 0 otherwise.
...And 4 more matches
NSS tools : crlutil
MozillaProjectsNSStoolscrlutil
crl generation script syntax crl generation script file has the following syntax: * line with comments should have # as a first symbol of a line * set "this update" or "next update" crl fields: update=yyyymmddhhmmssz nextupdate=yyyymmddhhmmssz field "next update" is optional.
... arg1, arg2: specific to extension type extension parameters addext uses the range that was set earlier by addcert and will install an extension to every cert entries within the range.
...should be set to 1 if this extension is critical or 0 otherwise.
...And 4 more matches
NSS tools : vfychain
modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations.
... options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if specified once, * cert_pkixverifycert if specified twice and more.
... where: -g test-type sets status checking test type.
...And 4 more matches
Rhino scopes and contexts
scopes a scope is a set of javascript objects.
...this is a large topic in itself, but for our purposes it gives us an easy way to share a set of read-only variables across multiple scopes.
... to do this we set an object's prototype.
...And 4 more matches
SpiderMonkey Build Documentation
see js_setgczeal() for details.
...tables, shell scripts /usr/local/bin --bindir libraries, data /usr/local/lib --libdir architecture-independent data /usr/local/share --sharedir c header files /usr/local/include --includedir for convenience, you can pass the configure script an option of the form --prefix=<prefixdir>, which substitutes <prefixdir> for /usr/local in all the settings above, in one step.
... specifying compilers and compiler flags if you want to use a compiler other than the one the configure script chooses for you by default, you can set the cxx variable in the environment when you run configure.
...And 4 more matches
How to embed the JavaScript engine
onnewglobalhook)); if (!global) return 1; js::rootedvalue rval(cx); { // scope for jsautocompartment jsautocompartment ac(cx, global); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; js::compileoptions opts(cx); opts.setfileandline(filename, lineno); bool ok = js::evaluate(cx, global, opts, script, strlen(script), &rval); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } js_destroycontext(cx); js_destroyruntime(rt); js_shutdown(); return 0; } spidermonkey 45 // following code might be needed in som...
...onnewglobalhook)); if (!global) return 1; js::rootedvalue rval(cx); { // scope for jsautocompartment jsautocompartment ac(cx, global); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; js::compileoptions opts(cx); opts.setfileandline(filename, lineno); bool ok = js::evaluate(cx, opts, script, strlen(script), &rval); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } js_destroycontext(cx); js_destroyruntime(rt); js_shutdown(); return 0; } spidermonkey 52 #include "jsapi.h" #include "js/initialization.h...
...alhook, options)); if (!global) return 1; js::rootedvalue rval(cx); { // scope for jsautocompartment jsautocompartment ac(cx, global); js_initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; js::compileoptions opts(cx); opts.setfileandline(filename, lineno); bool ok = js::evaluate(cx, opts, script, strlen(script), &rval); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } js_destroycontext(cx); js_shutdown(); return 0; } build and run the hello world example build command line depends on the os and the tools.
...And 4 more matches
Tracing JIT
a fragmento is a resource-management object that allocates and stores a set of fragments and pages, and manages their lifecycle.
...a fragment's code is stored in a set of associated pages and guardrecords allocated from the fragment's owning fragmento.
... it then imports the set of jsval values from the spidermonkey interpreter that the trace is known to read or write during its execution.
...And 4 more matches
SpiderMonkey Internals
atoms play three roles: as literals referred to by unaligned 16-bit immediate bytecode operands, as unique string descriptors for efficient property name hashing, and as members of the root gc set for exact gc.
...in general, both functions inside spidermonkey and jsapi callback functions signal errors by calling js_reporterror or one of its variants, or js_setpendingexception, and returning js_false or null.
...at most one trap per bytecode can be set.
...And 4 more matches
JS::Remove*Root
this article covers features introduced in spidermonkey 31 unregister a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
... vp js::heap<js::value> address of the js::value variable to remove from the root set.
... rp js::heap<jsstring *> address of the jsstring * variable to remove from the root set.
...And 4 more matches
JSClass.flags
if this flag is set, each instance of the class has a field for private data.
... the field can be accessed using js_getprivate and js_setprivate.
...this is only meaningful if spidermonkey is built with xpconnect and the jsclass_has_private flag is also set.
...And 4 more matches
JS_Remove*Root
unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
... vp jsval * address of the jsval variable to remove from the root set.
... spp jsstring * address of the jsstring* variable to remove from the root set.
...And 4 more matches
TPS Bookmark Lists
a bookmark asset list is an object with one or more key-value pairs.
...changes: an object containing new properties to be set for this bookmark when this asset list is used in a modify action.
...changes: an object containing new properties to be set for this livemark when this asset list is used in a modify action.
...And 4 more matches
Secure Development Guidelines
147483647 unsigned int 0 - +4294967295 64 signed long long -9223372036854775808 - +9223372036854775807 unsigned long long 0 - +18446744073709551615 int vuln_funct(int size) { char buf[1024]; if (size > sizeof(buf) - 1) return -1; } signedness issues: don’t mix signed and unsigned integers use unsigned integers for sizes, offsets, and indexes casting and truncation example: void vuln_funct() { u_int32_t size1 = 0xffffffff; u_int16_t size2 = size1; void *ptr = malloc(size2); if (!ptr) exit(exit_failure); memcpy(ptr, user_data, size1); } casting issues: sign extension example: int main() { int32_t new_size = 0; int8_t size = 0xff; new_size = size; printf("0x%...
...08x\r\n", new_size); } casting issues: sign extension prevention be careful with signed integers use unsigned integers for sizes, offsets, and indexes denial of service: divide by zero example: int main() { int a, b; if (argc != 3) return 1; a = atoi(argv[1]); b = atoi(argv[2]); return a/b; } denial of service: divide int_min by -1 example: int main(int argc, char **argv) { int a, b; if (argc != 3) return 1; a = atoi(argv[1]); b = atoi(argv[2]); return b ?
...ormat string bugs example: int main(int argc, char *argv[]) { if (argc > 1) printf(argv[1]); } format string bugs: prevention easy to fix: always use a format string specifier: int main(int argc, char *argv[]) { if (argc > 1) printf("%s", argv[1]); } double free example: void* ptr = malloc(1024); if (error) { free(ptr); } free(ptr); double free: prevention set a pointer to null when it’s freed valgrind or malloc debugging can help detect those bugs use after free accessing data after a free() or delete can lead to undefined behavior some debug tools might be able catch some cases un-initialized data example: int main() { char *uninitialized_ptr; printf("0x%08x\r\n", uninitialized_ptr); return 0; } $ ./test 0x8fe0103 ...
...And 4 more matches
Gecko object attributes
applied to: grid, heading, listitem, row, tablist exposed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute.
... the first item should have posinset="1", and the last item should have a posinset value equal to the setsize.
... applied to: listitem, option exposed in aria: aria-posinset setsize if this item is in a group, this indicates the number of items in the group.
...And 4 more matches
Using the Places annotation service
setting an annotation the annotation provides a variety of scriptable and non-scriptable setters for annotations on both pages and on items in the places database (see nsiannotationservice.idl for the exact declarations).
... from c++ you must use the setter for the explicit data type being saved: setpageannotationstring(auri, aname, avalue, aflags, aexpiration); setpageannotationint32(auri, aname, avalue, aflags, aexpiration); setpageannotationint64(auri, aname, avalue, aflags, aexpiration); setpageannotationdouble(auri, aname, avalue, aflags, aexpiration); setpageannotationbinary(auri, aname, adata, adatalen, aflags, aexpiration); and likewise for items in the places database: setitemannotationstring(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint32(aitemid, aname, avalue, aflags, aexpiration); setitemannotationint64(aitemid, aname, avalue, aflags, aexpiration); setitemannotationdouble(aitemid, aname, avalue, aflags, aexpiration); setitemannotationbinary(aitemid, aname, avalue...
..., adatalen, aflags, aexpiration); from javascript there are two simple function to perform all of these operations: setpageannotation(auri, aname, avalue, aflags, aexpiration); setitemannotation(aitemid, aname, avalue, aflags, aexpiration); these annotations all take similar parameters: uri or itemid: this is the nsiuri of the page to annotate, or for items in the places database, the id of the item.
...And 4 more matches
Components.utils.Sandbox
window objects and nsiprincipal carry additional information such as origin attributes and same-origin privilege changes caused by setting document.domain.
... passing a content window object, setting wantxrays:true (default) and using an extended principal provides a clean, isolated execution environment in which javascript code that needs web apis (such as accessing the window's dom) can be executed without interference from untrusted content code.
... if the sandbox interacts with untrusted content this should be set to false when possible to further reduce possible attack surface.
...And 4 more matches
Observer Notifications
you can cancel the shutdown from here by setting asubject.data to true (asubject is the first parameter to your observer, the data value is an nsisupportsprbool).
...recipients may set this to true to abort the close.
... topic subject data description chrome-document-global-created nsidomwindow null sent immediately after a chrome document window has been set up, but before any script code has been executed.
...And 4 more matches
nsIAppShellService
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/appshell/appshellservice;1 as a service: var appshellservice = components.classes["@mozilla.org/appshell/appshellservice;1"] .getservice(components.interfaces.nsiappshellservice); method overview void closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only!
...obsolete since gecko 1.8 methods closetoplevelwindow() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) close a window.
... void closetoplevelwindow( in nsixulwindow awindow ); parameters awindow a window.
...And 4 more matches
nsIContentView
method overview void scrollby(in float dxpx, in float dypx); void scrollto(in float xpx, in float ypx); void setscale(in float xscale, in float yscale); attributes attribute type description contentheight float read only.
... scrollx float horizontal scroll offset in chrome-document css pixels.
... when this view is active (that is it is being painted because it's in the visible region of the screen), this value is at first lined up with the content's scroll offset.
...And 4 more matches
nsIDOMHTMLAudioElement
last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidomhtmlmediaelement method overview unsigned long long mozcurrentsampleoffset(); void mozsetup(in pruint32 channels, in pruint32 rate); [implicit_jscontext] unsigned long mozwriteaudio(in jsval data); methods mozcurrentsampleoffset() non-standard this feature is non-standard and is not on a standards track.
... returns the current offset of the audio stream, specified as the number of samples that have played since the beginning of the stream.
... unsigned long long mozcurrentsampleoffset(); parameters none.
...And 4 more matches
nsIEditor
66 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 18.0 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) method overview [noscript] void init(in nsidomdocument doc, in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags); void setattributeorequivalent(in nsidomelement element, in astring sourceattrname, in astring sourceattrvalue, in boolean asuppresstransaction); void removeattributeorequivalent(in nsidomelement element, in domstring sourceattrname, in boolean asuppresstransaction); void postcreate(); void predestroy(in boolean adestroyingframes); selected content removal voi...
...d deleteselection(in short action, in short stripwrappers); document info and file methods void resetmodificationcount(); long getmodificationcount(); void incrementmodificationcount(in long amodcount); void incrementmodificationcount(in long amodcount); transaction methods void dotransaction(in nsitransaction txn); void enableundo(in boolean enable); void undo(in unsigned long count); void canundo(out boolean isenabled, out boolean canundo); void redo(in unsigned long count); void canredo(out boolean isenabled, out boolean canredo); void begintransaction(); void endtransaction(); void beginplaceholdertransaction(in nsiatom name); void endplaceholdert...
...ransaction(); 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 endofdocument(); drag/drop methods boolean candrag(in nsidomevent aevent); void dodrag(in nsidomevent aevent); void ...
...And 4 more matches
nsIFileInputStream
inherits from: nsiinputstream last changed in gecko 1.7 method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constant value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed.
... close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached.
... reopen_on_rewind 1<<3 if this is set, the file will be reopened whenever seek(0) occurs.
...And 4 more matches
nsIFileView
to create an instance, use: var fileview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); method overview void setdirectory(in nsifile directory); void setfilter(in astring filterstring); void sort(in short sorttype, in boolean reversesort); attributes attribute type description reversesort boolean if true results will be sorted in ascending order.
... methods setdirectory() set the directory to be browsed.
... void setdirectory( in nsifile directory ); parameters directory the directory to be browsed.
...And 4 more matches
nsIMimeConverter
method overview string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string encodemimepartiistr_utf8(in autf8string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string decodemimeheadertocharptr(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); astring decodemimeheader(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); mim...
...); mimeencoderdata *qpencoderinit(in mimeconverteroutputcallback output_fn, in void *closure); void encoderdestroy(in mimeencoderdata *data, in boolean abort_p); long encoderwrite(in mimeencoderdata *data, in string buffer, in long size); methods encodemimepartiistr() an variant of encodemimepartiistr_utf8() which treats the header as written in the given charset.
... string encodemimepartiistr(in string header, in boolean structured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); parameters propertyname the name of the property to retrieve.
...And 4 more matches
nsITaggingService
tagcontainericonspec autf8string retrieves the url spec for the tag container icon methods taguri() this method tags a uri with the given set of tags.
... current tags set for the url persist.
... tags in atags which are already set for the given uri are ignored.
...And 4 more matches
nsITraceableChannel
method overview nsistreamlistener setnewlistener(in nsistreamlistener alistener); methods setnewlistener() replaces the channel's current listener with a new one, returning the listener previously assigned to the channel.
... nsistreamlistener setnewlistener( in nsistreamlistener alistener ); parameters alistener an nsistreamlistener to be notified of events on the http channel.
... implementing nsistreamlistener the nsistreamlistener passed to setnewlistener() should implement the following methods, which are called to notify it of events that occur on the http stream: onstartrequest: an http request is beginning.
...And 4 more matches
nsITransport
method overview void close(in nsresult areason); nsiinputstream openinputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); nsioutputstream openoutputstream(in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount); void seteventsink(in nsitransporteventsink asink, in nsieventtarget aeventtarget); constants open flags.
... asegmentsize if open_unbuffered is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value).
... asegmentcount if open_unbuffered is not set, then this parameter specifies the maximum number of buffer segments (pass 0 to use default value).
...And 4 more matches
nsITreeView
n col); boolean isselectable(in long row, in nsitreecolumn col); boolean isseparator(in long index); boolean issorted(); void performaction(in wstring action); void performactiononcell(in wstring action, in long row, in nsitreecolumn col); void performactiononrow(in wstring action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in astring value); void setcellvalue(in long row, in nsitreecolumn col, in astring value); void settree(in nsitreeboxobject tree); void toggleopenstate(in long index); attributes attribute type description rowcount long the total number of rows in the tree (including the offscreen rows).
... setcelltext() setcelltext is called when the contents of the cell have been edited by the user.
... void setcelltext( in long row, in nsitreecolumn col, in astring value ); parameters row the row of the cell.
...And 4 more matches
nsIWindowWatcher
clients may expect this property to be always current, so to properly integrate this component the application will need to keep it current by setting the property as the active window changes.
... this component must be initialized at application startup by calling setwindowcreator().
...ewprompter(in nsidomwindow aparent); nsidomwindow getwindowbyname(in wstring atargetname, in nsidomwindow acurrentwindow); nsisimpleenumerator getwindowenumerator(); nsidomwindow openwindow(in nsidomwindow aparent, in string aurl, in string aname, in string afeatures, in nsisupports aarguments); void registernotification(in nsiobserver aobserver); void setwindowcreator(in nsiwindowcreator creator); void unregisternotification(in nsiobserver aobserver); attributes attribute type description activewindow nsidomwindow the watcher serves as a global storage facility for the current active (front most non-floating-palette-type) window, storing and returning it on demand.
...And 4 more matches
nsIXSLTProcessor
= components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); method overview void clearparameters(); nsivariant getparameter(in domstring namespaceuri, in domstring localname); void importstylesheet(in nsidomnode style); void removeparameter(in domstring namespaceuri, in domstring localname); void reset(); void setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsixsltprocessor.
...getparameter() gets a parameter if previously set by setparameter().
... removeparameter() removes a parameter, if set.
...And 4 more matches
nsIXULBrowserWindow
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.
...setjsdefaultstatus() sets the default status according to javascript's version of the default status.
... void setjsdefaultstatus( in astring status ); parameters status the status string.
...And 4 more matches
Address Book examples
use the nsiabcollection.readonly attribute to determine the read-only status of an address book adding contacts create a card and set its properties using the nsiabcard interface (see the interface documentation for property names supported by the application): let card = components.classes["@mozilla.org/addressbook/cardproperty;1"] .createinstance(components.interfaces.nsiabcard); card.setproperty("firstname", "john"); card.setproperty("lastname", "smith"); card.primaryemail = "john@invalid.com"; now...
... editing contacts once you have obtained a card from an nsiabdirectory (see above), you can edit it in a two step process, firstly, change the properties that you to edit: card.setproperty("firstname", "jane"); card.setproperty("lastname", "doe"); secondly, call modifycard to save the card in the database.
... use the setproperty/getproperty functions on nsiabcard to set your property in the same way as you would do with normal properties: card.setproperty("random1", "xyz"); card.setproperty("random2", "foo"); ...
...And 4 more matches
Filelink Providers
the account setup dialog the account setup dialog allows the user to select what account type they would like to create from a menulist.
... a provider implementation can choose what information it gets from the user from the setup dialog by pointing the settingsurl attribute of their nsimsgcloudfileprovider implementation to a chrome url for an xhtml page that contains a form with the extra information.
... note: the setup dialog window should resize itself automatically in order to fit the content of the iframe without scrollbars.
...And 4 more matches
Creating a Custom Column
getting started in this example we will be developing a small extension that will be adding a column that will display the "reply-to:" field of an email (if it exists, it if often not set).
... if you are unfamiliar with the setup and creation of an extension please read building a thunderbird extension.
...for this we overlay messenger.xul, by placing the following line in our chrome.manifest file: overlay chrome://messenger/content/messenger.xul chrome://replyto_col/content/replyto_col_overlay.xul now that our overlay is set up we need to connect a column to the current columns that exist.
...And 4 more matches
Virtualenv
creating a virtualenv installs setuptools (or optionally distribute) into the virtual environment.
...if you do not have pip or easy_install, you will need to download from pypi or clone from the github virtualenv repository, extract from the tarball (in the pypi case), and run python setup.py install.
... it will require it to be part of a clone of the github repository or have internet access to fetch setuptools.
...And 4 more matches
Using COM from js-ctypes
#include <sapi.h> struct myispvoicevtbl; struct myispvoice { struct myispvoicevtbl* lpvtbl; }; struct myispvoicevtbl { /* start inherit from iunknown */ void* queryinterface; void* addref; ulong (__stdcall *release)(struct myispvoice*); /* end inherit from iunknown */ /* start inherit from ispnotifysource */ void* setnotifysink; void* setnotifywindowmessage; void* setnotifycallbackfunction; void* setnotifycallbackinterface; void* setnotifywin32event; void* waitfornotifyevent; void* getnotifyeventhandle; /* end inherit from ispnotifysource */ /* start inherit from ispeventsource */ void* setinterest; void* getevents; void* getinfo; /* end inherit from ispeventsour...
...ce */ /* start ispvoice */ void* setoutput; void* getoutputobjecttoken; void* getoutputstream; void* pause; void* resume; void* setvoice; void* getvoice; hresult (__stdcall *speak)(struct myispvoice*, lpcwstr pwcs, dword dwflags, ulong* pulstreamnumber); void* speakstream; void* getstatus; void* skip; void* setpriority; void* getpriority; void* setalertboundary; void* getalertboundary; void* setrate; void* getrate; void* setvolume; void* getvolume; void* waituntildone; void* setsyncspeaktimeout; void* getsyncspeaktimeout; void* speakcompleteevent; void* isuisupported; void* displayui; /* end ispvoice */ }; int main(void) { if (succeeded(coinitialize(n...
... 'lpvtbl': ispvoicevtbl.ptr }]); ispvoicevtbl.define([ // start inherit from iunknown { 'queryinterface': ctypes.voidptr_t }, { 'addref': ctypes.voidptr_t }, { 'release': ctypes.functiontype(callback_abi, ulong, // return [ ispvoice.ptr ]).ptr }, // end inherit from iunknown // start inherit from ispnotifysource // can set to ctypes.voidptr_t if arent going to use it { 'setnotifysink': ctypes.voidptr_t }, { 'setnotifywindowmessage': ctypes.voidptr_t }, { 'setnotifycallbackfunction': ctypes.voidptr_t }, { 'setnotifycallbackinterface': ctypes.voidptr_t }, { 'setnotifywin32event': ctypes.voidptr_t }, { 'waitfornotifyevent': ctypes.voidptr_t }, { 'getnotifyeventhandle': ctypes.voidptr_t }, ...
...And 4 more matches
Debugger-API - Firefox Developer Tools
rogram in the process of running a timer callback function: a running javascript program and its debugger shadows this diagram shows the various types of shadow objects that make up the debugger api (which all follow some general conventions): a debugger.object represents a debuggee object, offering a reflection-oriented api that protects the debugger from accidentally invoking getters, setters, proxy traps, and so on.
...given a debugger.script, one can set breakpoints, translate between source positions and bytecode offsets (a deviation from the “source level” design principle), and find other static characteristics of the code.
...you can also set onstep and onpop handlers on frames.
...And 4 more matches
Examine and edit HTML - Firefox Developer Tools
then you will find strange gaps between elements, even if you haven’t set any margin or padding on them.
...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).
... (change pseudo-class) hover set the :hover css pseudo-class.
...And 4 more matches
AudioListener.dopplerFactor - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
... if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
...And 4 more matches
BaseAudioContext.createPanner() - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
... if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
...And 4 more matches
DedicatedWorkerGlobalScope - Web APIs
workerlocation is a specific location object, mostly a subset of the location for browsing scopes, but adapted to workers.
...workernavigator is a specific navigator object, mostly a subset of the navigator for browsing scopes, but adapted to workers.
... workerglobalscope.performance read only returns the performance object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available.
...And 4 more matches
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
the element property innerhtml gets or sets the html or xml markup contained within the element.
...setting the value of innerhtml removes all of the element's descendants and replaces them with nodes constructed by parsing the html given in the string htmlstring.
... exceptions syntaxerror an attempt was made to set the value of innerhtml using a string which is not properly-formed html.
...And 4 more matches
Element.outerHTML - Web APIs
WebAPIElementouterHTML
it can also be set to replace the element with nodes parsed from the given string.
...setting the value of outerhtml replaces the element and all of its descendants with a new dom tree constructed by parsing the specified htmlstring.
... exceptions syntaxerror an attempt was made to set outerhtml using an html string which is not valid.
...And 4 more matches
FontFace - Web APIs
WebAPIFontFace
fontface.family a cssomstring that retrieves or sets the family of the font.
... fontface.featuresettings a cssomstring that retrieves or sets infrequently used font features that are not available from a font's variant properties.
... it is equivalent to the font-feature-settings descriptor.
...And 4 more matches
Using the Gamepad API - Web APIs
if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard.
...we have done this below using window.setinterval(); once the object is available the gamepad info is outputted, the game loop is started, and the interval is cleared using window.clearinterval().
... interval = setinterval(pollgamepads, 500); } function pollgamepads() { var gamepads = navigator.getgamepads ?
...And 4 more matches
HTMLImageElement.src - Web APIs
syntax htmlimageelement.src = newsource; let src = htmlimageelement.src; value when providing only a single image, rather than a set of images from which the browser selects the best match for the viewport size and display pixel density, the src attribute is a usvstring specifying the url of the desired image.
... this can be set either within the html itself using the src content attribute, or programmatically by setting the element's src property.
... if you use the srcset content attribute to provide multiple image options for different display pixel densities, the url specified by the src attribute is used in one of two ways: as a fallback for browsers that don't support srcset.
...And 4 more matches
HTMLImageElement - Web APIs
htmlimageelement.crossorigin a domstring specifying the cors setting for this image element.
... see cors settings attributes for further details.
... htmlimageelement.srcset a usvstring reflecting the srcset html attribute.
...And 4 more matches
HTMLInputElement.stepUp() - Web APIs
the htmlinputelement.stepup() method increments the value of a numeric type of <input> element by the value of the step attribute, or the default step value if the step attribute is not explicitly set.
...t type="datetime-local" min="019-12-25t19:30" step="7"> number 1 0.1 increments <input type="number" min="0" step="0.1" max="10"> range 1 increments by 2: <input type="range" min="0" step="2" max="10"> the method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set on the form control.
...the method will not cause the value to exceed the set max value, or defy the constraints set by the step attribute.
...And 4 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
a timeout or interval created with settimeout() or setinterval() is reached, causing the corresponding callback to be added to the task queue.
...they're a highly specialized feature of modern browser-based javascript development, allowing you to schedule code to jump in front of other things in the long set of things waiting to happen on the user's computer.
...when it is found in the cache data isn't cached data is cached fetching data data fetched loaded data fetching data loaded data data fetched even worse, sometimes the element's data property will be set and other times it won't be by the time this code finishes running.
...And 4 more matches
Using the MediaStream Recording API - Web APIs
if you are not interested in css and want to get straight to the javascript, skip to the basic app setup section.
...instead, the problem was solved by making the third container's height equal to 100% of the parent height, minus the heights and padding of the other two: .sound-clips { box-shadow: inset 0 3px 4px rgba(0,0,0,0.7); background-color: rgba(0,0,0,0.1); height: calc(100% - 240px - 0.7rem); overflow: scroll; } note: calc() has good support across modern browsers too, even going back to internet explorer 9.
...ground-color: #999; background-image: linear-gradient(to top right, rgba(0,0,0,0), rgba(0,0,0,0.5)); } last, we write a rule to say that when the checkbox is checked (when we click/focus the label), the adjacent <aside> element will have its horizontal translation value changed and transition smoothly into view: input[type=checkbox]:checked ~ aside { transform: translatex(0); } basic app setup to grab the media stream we want to capture, we use getusermedia().
...And 4 more matches
PannerNode.distanceModel - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
... if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
...And 4 more matches
PannerNode.maxDistance - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
... if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
...And 4 more matches
PannerNode.panningModel - Web APIs
in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function.
... note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc.
... if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties.
...And 4 more matches
Using the Resource Timing API - Web APIs
resource loading phases an application can get timestamps for the various phases of resource loading such as redirection, dns lookup, and tcp connection setup.
...the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the specified number of resource performance entries.
...performance data buffer not cleared (still have `" + p.length + "` items"); } function set_resource_timing_buffer_size(n) { if (performance === undefined) { console.log("= performance.setresourcetimingbuffersize(): peformance not supported"); return; } // check if performance.setresourcetimingbuffersize() is supported console.log ("= performance.setresourcetimingbuffersize()"); var supported = typeof performance.setresourcetimingbuffersize == "function"; if (support...
...And 4 more matches
SVGTransform - Web APIs
interface overview also implement none methods void setmatrix(in svgmatrix matrix) void settranslate(in float tx, in float ty) void setscale(in float sx, in float sy) void setrotate(in float angle, in float cx, in float cy) void setskewx(in float angle) void setskewy(in float angle) properties readonly unsigned short type readonly float angle readonly svgmatrix matrix ...
... methods name & arguments return description setmatrix(in svgmatrix matrix) void sets the transform type to svg_transform_matrix, with parameter matrix defining the new transformation.
... settranslate(in float tx , in float ty) void sets the transform type to svg_transform_translate, with parameters tx and ty defining the translation amounts.
...And 4 more matches
SharedWorkerGlobalScope - Web APIs
workerlocation is a specific location object, mostly a subset of the location for browsing scopes, but adapted to workers.
...workernavigator is a specific navigator object, mostly a subset of the navigator for browsing scopes, but adapted to workers.
... workerglobalscope.performance read only returns the performance object associated with the worker, which is a regular performance object, but with a subset of its properties and methods available.
...And 4 more matches
SpeechSynthesisUtterance - Web APIs
speechsynthesisutterance.lang gets and sets the language of the utterance.
... speechsynthesisutterance.pitch gets and sets the pitch at which the utterance will be spoken at.
... speechsynthesisutterance.rate gets and sets the speed at which the utterance will be spoken at.
...And 4 more matches
WebGLRenderingContext.getUniformLocation() - Web APIs
uniform[1234][fi][v]() sets the uniform's value to the specified value, which may be a single floating point or integer number, or a 2-4 component vector specified either as a list of values or as a float32array or int32array.
... uniformmatrix[234][fv]() sets the uniform's value to the specified matrix, possibly with transposition.
... example in this example, taken from the animatescene() method in the article a basic 2d webgl animation example, obtains the locations of three uniforms from the shading program, then sets the value of each of the three uniforms.
...And 4 more matches
Simple color animation - Web APIs
the timer and the timer handler function establish the animation loop, a set of drawing commands that are executed at a regular period (typically, every frame; in this case, once per second).
...-onoff"> press here to <strong>[verb goes here]</strong> the animation </button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addeventlistener("load", function setupanimation (evt) { "use strict" window.removeeventlistener(evt.type, setupanimation, false); // a variable to hold a timer that drives the animation.
... var button = document.queryselector("#animation-onoff"); var verb = document.queryselector("strong"); function startanimation(evt) { button.removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); verb.innerhtml="stop"; // setup animation loop by redrawing every second.
...And 4 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the holdrequested() method, which accepts as input an sdp offer string.
... async function holdrequested(offer) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replacetrack(null); audiotransceiver.direction = "recvonly"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken here are: set the remote description to the specified offer by calling rtcpeerconnection.setremotedescription().
... set the audio transceiver's direction property to "recvonly", instructing the transceiver to only accept audio and not to send any.
...And 4 more matches
Using bounded reference spaces - Web APIs
among the various reference spaces available in the webxr set of apis, the bounded-floor reference space is somehwat unique.
... this diagram defines the boundaries of room with the origin in the center, as required, and a set of 12 points representing the vertices of the available physical space.
...on; spacetype = "bounded-floor"; xrsession.requestreferencespace(spacetype) .then(onrefspacecreated) .catch(() => { spacetype = "local-floor"; xrsession.requestreferencespace(spacetype) .then(onrefspacecreated) .catch(handleerror); }); } function onrefspacecreated(refspace) { xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); // now set up matrices, create a secondary reference space to // transform the viewer's pose, and so forth.
...And 4 more matches
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.
...s there's a method that allows us to do just that — audiocontext.createmediaelementsource: // get the audio element const audioelement = document.queryselector('audio'); // pass it into the audio context const track = audiocontext.createmediaelementsource(audioelement); note: the <audio> element above is represented in the dom by an object of type htmlmediaelement, which comes with its own set of functionality.
... // select our play button const playbutton = document.queryselector('button'); playbutton.addeventlistener('click', function() { // check if context is in suspended state (autoplay policy) if (audiocontext.state === 'suspended') { audiocontext.resume(); } // play or pause track depending on state if (this.dataset.playing === 'false') { audioelement.play(); this.dataset.playing = 'true'; } else if (this.dataset.playing === 'true') { audioelement.pause(); this.dataset.playing = 'false'; } }, false); we also need to take into account what to do when the track finishes playing.
...And 4 more matches
ARIA annotations - Accessibility
wai-aria version 1.3 sees the addition of a set of new features, collectively known as aria annotations, which allow the creation of accessible annotations inside web documents.
... to provide a semantic association between the document content being annotated and the annotation, an aria-details attribute can be set on the annotated content that contains the id of the annotated element.
...you’ll see examples of most of these later on in the article, but briefly: aria-label="" can be set on an element to provide a brief descriptive label when it isn't appropriate to have the label actually appearing in the ui, for example a search input in a horizontal nav bar.
...And 4 more matches
ARIA: textbox role - Accessibility
to create a multi-line text box which supports line breaks, as in an html <textarea>, set aria-multiline="true".
... <label for="txtbox">enter your five-digit zipcode</label> <input type="text" placeholder="5-digit zipcode" id="txtbox"/> <!-- multi-line text area --> <label for="txtboxmultiline">enter the tags for the article</label> <textarea id="txtboxmultiline" required></textarea> where a text field is read-only, indicated this by setting aria-readonly="true" on the element.
... if list or both is set, the aria-controls and aria-haspopup attributes should also be included.
...And 4 more matches
-moz-context-properties - CSS: Cascading Style Sheets
if you reference an svg image in a webpage (such as with the <img> element or as a background image), the svg image can coordinate with the embedding element (its context) to have the image adopt property values set on the embedding element.
... syntax /* keyword values */ -moz-context-properties: fill; -moz-context-properties: fill, stroke; /* global values */ -moz-context-properties: inherit; -moz-context-properties: initial; -moz-context-properties: unset; values fill expose the fill value set on the image to the embedded svg.
... stroke expose the stroke value set on the image to the embedded svg.
...And 4 more matches
@viewport - CSS: Cascading Style Sheets
WebCSS@viewport
@viewport { width: 100vw; /*sets the width of the actual viewport to the device width*/ } note: the use of <meta name="viewport"> tag overrides @viewport syntax the at-rule contains a set of nested descriptors in a css block that is delimited by curly braces.
... width a shorthand descriptor for setting both min-width and max-width.
... height a shorthand descriptor for setting both min-height and max-height.
...And 4 more matches
Detecting CSS animation support - CSS: Cascading Style Sheets
we assume that animation is not supported by setting animation to false.
... we set the animationstring to animation which is the property we want to set later on.
... we create an array of browser prefixes to loop over and we set pfx to an empty string.
...And 4 more matches
Basic Concepts of Multicol - CSS: Cascading Style Sheets
multiple-column layout, usually referred to as multicol, is a specification for laying out content into a set of column boxes much like columns in a newspaper.
... the column-width property the column-width property is used to set the optimal width for every column box.
... the columns shorthand you can use the columnsshorthand to set column-count and column-width.
...And 4 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
if we position an item using absolute positioning, we use these physical keywords as offset values to push the item around.
...one has no text-align property set, the second has text-align set to left.
... .wrapper > p { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; margin: 1em; color: #d9480f; max-width: 300px; } <div class="wrapper"> <p style="writing-mode: horizontal-tb">i have writing mode set to the default <code>horizontal-tb</code></p> <p style="writing-mode: vertical-rl">i have writing mode set to <code>vertical-rl</code></p> </div> writing modes in grid layouts if we now take a look at a grid layout example, we can see how changing the writing mode means changing our idea of where the block and inline axis are.
...And 4 more matches
Grid template areas - CSS: Cascading Style Sheets
if you wanted a fixed width image area, then you could set the image column as a pixel width, and assign the text area 1fr.
... before using any shorthand it is worth remembering that shorthands not only enable the setting of many properties in one go, they also act to reset things to their initial values that you do not, or cannot set in the shorthand.
... therefore if you use a shorthand, be aware that it may reset things you have applied elsewhere.
...And 4 more matches
display - CSS: Cascading Style Sheets
WebCSSdisplay
the display css property sets whether an element is treated as a block or inline element and the layout used for its children, such as flow layout, grid or flex.
... formally, the display property sets an element's inner and outer display types.
... the outer type sets an element's participation in flow layout; the inner type sets the layout of children.
...And 4 more matches
margin-left - CSS: Cascading Style Sheets
the margin-left css property sets the margin area on the left side of an element.
... syntax /* <length> values */ margin-left: 10px; /* an absolute length */ margin-left: 1em; /* relative to the text size */ margin-left: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-left: auto; /* global values */ margin-left: inherit; margin-left: initial; margin-left: unset; the margin-left property is specified as the keyword auto, or a <length>, or a <percentage>.
... value of display value of float value of position computed value of auto comment inline, inline-block, inline-table any static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any static or relative 0, except if both margin-left and margin-right are set to auto.
...And 4 more matches
margin-right - CSS: Cascading Style Sheets
the margin-right css property sets the margin area on the right side of an element.
... syntax /* <length> values */ margin-right: 20px; /* an absolute length */ margin-right: 1em; /* relative to the text size */ margin-right: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-right: auto; /* global values */ margin-right: inherit; margin-right: initial; margin-right: unset; the margin-right property is specified as the keyword auto, or a <length>, or a <percentage>.
... value of display value of float value of position computed value of auto comment inline, inline-block, inline-table any static or relative 0 inline layout mode block, inline, inline-block, block, table, inline-table, list-item, table-caption any static or relative 0, except if both margin-left and margin-right are set to auto.
...And 4 more matches
mask-border-slice - CSS: Cascading Style Sheets
the mask-border-slice css property divides the image set by mask-border-source into regions.
... syntax /* all sides */ mask-border-slice: 30%; /* vertical | horizontal */ mask-border-slice: 10% 30%; /* top | horizontal | bottom */ mask-border-slice: 30 30% 45; /* top | right | bottom | left */ mask-border-slice: 7 12 14 5; /* using the `fill` keyword */ mask-border-slice: 10% fill 7 12; /* global values */ mask-border-slice: inherit; mask-border-slice: initial; mask-border-slice: unset; the mask-border-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice.
... values <number> represents an edge offset in pixels for raster images and coordinates for vector images.
...And 4 more matches
outline-style - CSS: Cascading Style Sheets
the outline-style css property sets the style of an element's outline.
... syntax /* keyword values */ outline-style: auto; outline-style: none; outline-style: dotted; outline-style: dashed; outline-style: solid; outline-style: double; outline-style: groove; outline-style: ridge; outline-style: inset; outline-style: outset; /* global values */ outline-style: inherit; outline-style: initial; outline-style: unset; the outline-style property is specified as any one of the values listed below.
... inset the outline makes the box look as though it were embedded in the page.
...And 4 more matches
outline - CSS: Cascading Style Sheets
WebCSSoutline
the outline css shorthand property set all the outline properties in a single declaration.
... constituent properties this property is a shorthand for the following css properties: outline-color outline-style outline-width syntax /* style */ outline: solid; /* color | style */ outline: #f66 dashed; /* style | width */ outline: inset thick; /* color | style | width */ outline: green solid 3px; /* global values */ outline: inherit; outline: initial; outline: unset; the outline property may be specified using one, two, or three of the values listed below.
... values <'outline-color'> sets the color of the outline.
...And 4 more matches
text-shadow - CSS: Cascading Style Sheets
each shadow is described by some combination of x and y offsets from the element, blur radius, and color.
... syntax /* offset-x | offset-y | blur-radius | color */ text-shadow: 1px 1px 2px black; /* color | offset-x | offset-y | blur-radius */ text-shadow: #fc0 1px 0 10px; /* offset-x | offset-y | color */ text-shadow: 5px 5px #558abb; /* color | offset-x | offset-y */ text-shadow: white 2px 5px; /* offset-x | offset-y /* use defaults for color and blur-radius */ text-shadow: 5px 10px; /* global values */ text-shadow: inherit; text-shadow: initial; text-shadow: unset; this property is specified as a comma-separated list of shadows.
...the first two <length> values are the <offset-x> and <offset-y> values.
...And 4 more matches
text-underline-position - CSS: Cascading Style Sheets
the text-underline-position css property specifies the position of the underline which is set using the text-decoration property's underline value.
... syntax /* single keyword */ text-underline-position: auto; text-underline-position: under; text-underline-position: left; text-underline-position: right; /* multiple keywords */ text-underline-position: under left; text-underline-position: right under; /* global values */ text-underline-position: inherit; text-underline-position: initial; text-underline-position: unset; syntax values auto the user agent uses its own algorithm to place the line at or under the alphabetic baseline.
...if the font file doesn't include this information, behave as if auto was set, with the browser choosing an appropriate position.
...And 4 more matches
top - CSS: Cascading Style Sheets
WebCSStop
the effect of top depends on how the element is positioned (i.e., the value of the position property): when position is set to absolute or fixed, the top property specifies the distance between the element's top edge and the top edge of its containing block.
... when position is set to relative, the top property specifies the distance the element's top edge is moved below its normal position.
... when position is set to sticky, the top property is used to compute the sticky-constraint rectangle.
...And 4 more matches
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
see cors settings attributes for details on how the crossorigin attribute is used.
...consider the html5 boilerplate apache server configuration file for cors images, shown below: <ifmodule mod_setenvif.c> <ifmodule mod_headers.c> <filesmatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$"> setenvif origin ":" is_cors header set access-control-allow-origin "*" env=is_cors </filesmatch> </ifmodule> </ifmodule> in short, this configures the server to allow graphic files (those with the extensions ".bmp", ".cur", ".gif", ".ico", ".jpg", ".jpeg", ".png", ".svg", ".svgz", an...
... the key is to use the crossorigin attribute by setting crossorigin on the htmlimageelement into which the image will be loaded.
...And 4 more matches
<col> - HTML: Hypertext Markup Language
WebHTMLElementcol
possible values are: left, aligning the content to the left of the cell center, centering the content in the cell right, aligning the content to the right of the cell justify, inserting spaces into the textual content so that the content is justified in the cell if this attribute is not set, its value is inherited from the align of the <colgroup> element this <col> element belongs too.
... note: to achieve the same effect as the left, center, right or justify values: do not try to set the text-align property on a selector giving a <col> element.
...set a to zero and b to the position of the column in the table, e.g.
...And 4 more matches
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
<input type="button" value="click me"> if you don't specify a value, you get an empty button: <input type="button"> using buttons <input type="button"> elements have no default behavior (their cousins, <input type="submit"> and <input type="reset"> are used to submit and reset forms, respectively).
... disabling and enabling a button to disable a button, simply specify the disabled global attribute on it, like so: <input type="button" value="disable me" disabled> you can enable and disable buttons at run time by simply setting disabled to true or false.
...a settimeout() function is then used to reset the button back to its enabled state after two seconds.
...And 4 more matches
itemprop - HTML: Hypertext Markup Language
examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data.
...the first item has two properties, "name", set to "amanda", and "band", set to another item.
... that second item has two further properties, "name", set to "jazz band", and "size", set to "12".
...And 4 more matches
Global attributes - HTML: Hypertext Markup Language
gend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onsort, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting.
...all such custom data are available via the htmlelement interface of the element the attribute is set on.
... the htmlelement.dataset property gives access to them.
...And 4 more matches
Cache-Control - HTTP
cache-control: immutable cache-control: stale-while-revalidate=<seconds> cache-control: stale-if-error=<seconds> directives cacheability a response is normally cached by the browser if: it has a status code of 301, 302, 307, 308, or 410 and cache-control does not have no-store, or if proxy, does not have private and authorization is unset either has a status code of 301, 302, 307, 308, or 410 or has public, max-age or s-maxage in cache-control or has expires set public the response may be stored by any cache, even if the response is normally non-cacheable.
...although other directives may be set, this alone is the only directive you need in preventing cached responses on modern browsers.
...setting must-revalidate does not make sense because in order to go through revalidation you need the response to be stored in a cache, which no-store prevents.
...And 4 more matches
Closures - JavaScript
one way of doing this is to specify the font-size of the body element (in pixels), and then set the size of the other elements on the page (such as headers) using the relative em unit: body { font-family: helvetica, arial, sans-serif; font-size: 12px; } h1 { font-size: 1.5em; } h2 { font-size: 1.2em; } such interactive text size buttons can change the font-size property of the body element, and the adjustments are picked up by other elements on the page thanks to the relative u...
... <p id="help">helpful notes will appear here</p> <p>e-mail: <input type="text" id="email" name="email"></p> <p>name: <input type="text" id="name" name="name"></p> <p>age: <input type="text" id="age" name="age"></p> 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)'} ]; for (var i = 0; i < helptext.length; i++) { var item = helptext[i]; document.getelementbyid(item.id).onfocus = function() { showhelp(item.help); } } } setuphelp(); try runni...
... the reason for this is that the functions assigned to onfocus are closures; they consist of the function definition and the captured environment from the setuphelp function's scope.
...And 4 more matches
JavaScript modules - JavaScript
63edge full support 79firefox full support 67 full support 67 no support 66 — 67disabled disabled from version 66 until version 67 (exclusive): this feature is behind the javascript.options.dynamicimport preference (needs to be set to true).
...android full support 63firefox android full support 67 full support 67 no support 66 — 67disabled disabled from version 66 until version 67 (exclusive): this feature is behind the javascript.options.dynamicimport preference (needs to be set to true).
... introducing an example to demonstrate usage of modules, we've created a simple set of examples that you can find on github.
...And 4 more matches
Using Promises - JavaScript
here's some code that uses createaudiofileasync(): function successcallback(result) { console.log("audio file ready at url: " + result); } function failurecallback(error) { console.error("error generating audio file: " + error); } createaudiofileasync(audiosettings, successcallback, failurecallback); modern functions return a promise that you can attach your callbacks to instead: if createaudiofileasync() were rewritten to return a promise, using it could be as simple as this: createaudiofileasync(audiosettings).then(successcallback, failurecallback); that's shorthand for: const promise = createaudiofileasync(audiosettings); promise.then(successc...
...the most obvious example is the settimeout() function: settimeout(() => saysomething("10 seconds passed"), 10*1000); mixing old-style callbacks and promises is problematic.
...settimeout is to blame for this.
...And 4 more matches
Array.prototype.length - JavaScript
the length property of an object which is an instance of type array sets or returns the number of elements in that array.
... var namelista = new array(4294967296); //2 to the 32nd power = 4294967296 var namelistc = new array(-100) //negative sign console.log(namelista.length); //rangeerror: invalid array length console.log(namelistc.length); //rangeerror: invalid array length var namelistb = []; namelistb.length = math.pow(2,32)-1; //set array length less than 2 to the 32nd power console.log(namelistb.length); //4294967295 you can set the length property to truncate an array at any time.
... when you extend an array by changing its length property, the number of actual elements increases; for example, if you set length to 3 when it is currently 2, the array now contains 3 elements, which causes the third element to be a non-iterable empty slot.
...And 4 more matches
Object.create() - JavaScript
g requires that 'this' be a function adding the missing object-method directly to new object's "prototype" does not work either, since the new object does not have a real prototype (which is really the cause of all these problems) and one cannot be directly added: ocn = object.create( null ); // create "null" object (same as before) ocn.prototype.tostring = object.tostring; // error: cannot set property 'tostring' of undefined ocn.prototype = {}; // try to create a prototype ocn.prototype.tostring = object.tostring; // since new object lacks method then try assigning it from standard-object > ocn.tostring() // error: ocn.tostring is not a function adding the missing object-method by using the standard-object as new object's prototype does not work either: ...
...ocn = object.create( null ); // create "null" object (same as before) object.setprototypeof(ocn, object); // set new object's prototype to the standard-object > ocn.tostring() // error: function.prototype.tostring requires that 'this' be a function some ok solutions again, adding the missing object-method directly from the standard-object does not work.
... as before) ocn.tostring = tostring; // since new object lacks method then assign it directly from generic version > ocn.tostring() // shows "[object object]" > "ocn is: " + ocn // shows "ocn is: [object object]" ob={}; ob.pn=ocn; ob.po=oco; // create a compound object (same as before) > showproperties(ob) // display top-level properties - po: [object object] - pn: [object object] however, setting the generic prototype as the new object's prototype works even better: ocn = object.create( null ); // create "null" object (same as before) object.setprototypeof(ocn, object.prototype); // set new object's prototype to the "generic" object (not standard-object) (in addition to all the string-related functions shown above, this also adds:) > ocn.valueof() // shows {} > oc...
...And 4 more matches
Object.prototype.__proto__ - JavaScript
if you care about performance you should avoid setting the [[prototype]] of an object.
... the __proto__ property of object.prototype is an accessor property (a getter function and a setter function) that exposes the internal [[prototype]] (either an object or null) of the object through which it is accessed.
...it is deprecated in favor of object.getprototypeof/reflect.getprototypeof and object.setprototypeof/reflect.setprototypeof (though still, setting the [[prototype]] of an object is a slow operation that should be avoided if performance is a concern).
...And 4 more matches
Promise.all() - JavaScript
in comparison, the promise returned by promise.allsettled() will wait for all input promises to complete, regardless of whether or not one rejects.
... var p1 = promise.resolve(3); var p2 = 1337; var p3 = new promise((resolve, reject) => { settimeout(() => { resolve("foo"); }, 100); }); promise.all([p1, p2, p3]).then(values => { console.log(values); // [3, 1337, "foo"] }); if the iterable contains non-promise values, they will be ignored, but still counted in the returned promise array value (if the promise is fulfilled): // this will be counted as if the iterable passed is empty, so it gets fulfilled var p = promise.all([1,...
...2,3]); // this will be counted as if the iterable passed contains only the resolved promise with value "444", so it gets fulfilled var p2 = promise.all([1,2,3, promise.resolve(444)]); // this will be counted as if the iterable passed contains only the rejected promise with value "555", so it gets rejected var p3 = promise.all([1,2,3, promise.reject(555)]); // using settimeout we can execute code after the stack is empty settimeout(function() { console.log(p); console.log(p2); console.log(p3); }); // logs // promise { <state>: "fulfilled", <value>: array[3] } // promise { <state>: "fulfilled", <value>: array[4] } // promise { <state>: "rejected", <reason>: 555 } asynchronicity or synchronicity of promise.all this following example demonstrates the asynchronicity (or synchronici...
...And 4 more matches
MathML attribute reference - MathML
depth <mpadded> sets or increments the depth.
... displaystyle <mstyle>, <mtable> a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas.
... href all used to set a hyperlink to a specified uri.
...And 4 more matches
Media - Progressive web apps (PWAs)
this css (below) removes the navigation area when printing the document: @media print { #nav-area {display: none;} } some common media types are: screen color device display print printed paged media projection projected display all all media (the default) more details there are other ways to specify the media type for a set of rules.
... a @page rule can set the page margins.
... example this rule sets the page margins to one inch on all four sides: @page {margin: 1in;} this rule ensures that every h1 element starts on a new page: h1 {page-break-before: always;} more details for full details of css support for paged media, see paged media in the css specification.
...And 4 more matches
Fills and Strokes - SVG: Scalable Vector Graphics
fill and stroke attributes painting basic coloring can be done by setting two attributes on the node: fill and stroke.
... using fill sets the color inside the object and stroke sets the color of the line drawn around the object.
... there are additional stroke and fill properties available, including fill-rule, which specifies how to color in shapes that overlap themselves; stroke-miterlimit, which determines if a stroke should draw miters; and stroke-dashoffset, which specifies where to start a dasharray on a line.
...And 4 more matches
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient1"> <stop offset="5%" stop-color="white"/> <stop offset="95%" stop-color="blue"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> <stop offset="5%" stop-color="red"/> <stop offset="95%" stop-color="orange"/> </lineargradient> <pattern id="pattern" x="0" y="0" width=".25" height=".25"> <rect x="0" y="0" width="50" height="50" fill="skyblue"/> ...
...there are also x and y attributes available if you want to offset the start point of this rectangle somewhere within your drawing.
...since, in this case, we wanted the pattern to repeat 4 times horizontally and vertically, the height and width are set to 0.25.
...And 4 more matches
document - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the document finds a node-set in an external document, or multiple external documents, and returns the resulting node-set.
... syntax document(uri [,node-set] ) arguments uri an absolute or relative uri of the document to be retrieved.
... node-set (optional) an expression pointing to a node-set in the external document that should be returned.
...And 4 more matches
simple-prefs - Archive of obsolete content
if you need to get and set the general browser preferences, use preferences/service.
...this is used to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mysettingname); this means that it must be a valid javascript identifier.
... 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.
...And 3 more matches
io/text-streams - Archive of obsolete content
(filename, "r"); if (!textreader.closed) { text = textreader.read(); textreader.close(); } } return text; } function writetexttofile(text, filename) { var fileio = require("sdk/io/file"); var textwriter = fileio.open(filename, "w"); if (!textwriter.closed) { textwriter.write(text); textwriter.close(); } } globals constructors textreader(inputstream, charset) creates a buffered input stream that reads text from a backing stream using a given text encoding.
... charset : string inputstream is expected to be in the character encoding named by this value.
...see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this.
...And 3 more matches
HTML in XUL for rich tooltips - Archive of obsolete content
script overlay titled overlay.js: <?xml version="1.0" encoding="utf-8"?> <overlay id="htmltip-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script type="application/x-javascript" src="overlay.js"/> <popup id="contentareacontextmenu"> <menuitem id="htmltip1" label="foo1" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> <menuitem id="htmltip2" label="foo2" onmouseover="htmltip.onmousetooltip(event)" tooltip="myhtmltip" /> </popup> <popupset id="mainpopupset"> <tooltip id="myhtmltip"> <html:div id="myhtmltipdiv" type="content"/> </tooltip> </popupset> </overlay> insert your version of the foll...
...our customized tooltiphtml attribute for each element can be set at any time.
... var htmltip = { onload: function() { //at any point you can save an html string to a xul attribute for later injection into the tooltip document.getelementbyid("htmltip1").setattribute("tooltiphtml", "<font color='red'>red foo</font>") document.getelementbyid("htmltip2").setattribute("tooltiphtml", "<font color='green'>green foo</font>") }, onmousetooltip: function(event) { //get the html tooltip string assigned to the element that the mouse is over (which will soon launch the tooltip) var txt = event.target.getattribute("tooltiphtml"); // get the html div element that is inside the custom xul tooltip var div = document.getelementbyid("myhtmltipdiv"); //clear the html div element of any prior shown custom html while(div.firstchild) div.removechild(div.firstchild); //safely conv...
...And 3 more matches
Miscellaneous - Archive of obsolete content
if set, you will receive dommousescroll events.
...if set, you will not receive dommousescroll events.
...if set, you will not receive dommousescroll events.
...And 3 more matches
Install Manifests - Archive of obsolete content
however, while <em:maxversion> is a required property, it is ignored unless you also set <em:strictcompatibility> in the main <description> of your install.rdf (i.e.
... examples this declares a set of add-on metadata to be displayed when the application is running in the de-de locale.
...to do so, set optionstype to 3 and set optionsurl to a the path of a page to open.
...And 3 more matches
Adding menus and submenus - Archive of obsolete content
instead of setting the menupopup directly in the xul, you can use the onpopupshowing event to fill the children when the popup is about to be displayed.
...the type attribute must be set to "checkbox".
... you can set the checked attribute to "true" to check it by default.
...And 3 more matches
CSS3 - Archive of obsolete content
the choice of glyphs with specific opentype features via the css font-feature-settings property.
... support for the css outline-offset property giving more control on the position of the outline.
... support for the use of an <image> as the border with the css border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, and border-image-repeat properties.
...And 3 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
we still connect through a set of links that mostly drive us to a new page, and we still occasionally lose track of where we are.
...with inner browsing, a simple request to retrieve the next set of message headers that replace the currently viewed message headers can dramatically improve user experience.
...data loader component this component is a simple javascript function that sets the src attribute of the hidden iframe, causing it to load an url (i.e., by establishing a request on the server side): /* triggers the iframe to retrieve new data */ function retrievedata() { bridgeframe.src = dataurl; } once a web page is loaded into the iframe, the data binder will be able to get the data from the iframe's page and set the data into the main page's context.
...And 3 more matches
JavaScript crypto - Archive of obsolete content
to enable your document to receive these events, you must first tell the crypto system you are interested by setting window.crypto.enablesmartcardevents to true.
... if (typeof(crypto.version) != "undefined") { crmfobject = crypto.generatecrmfrequest( "cn=" + form.name.value, form.password.value, authenticator, keytransportcert, "setcrmfrequest();", 1024, null, "rsa-dual-use"); } return false; } function setcrmfrequest() { form.cert_request.value = crmfobject.request; form.submit(); } form.onsubmit = validate; </script> on completion of the request, the ca may submit a page that looks something like this: <!doctype html> <h2>certificate request successful</h2> <p>hit 'load' to load your certific...
... mechanism flag definitions in general, most tokens should not set any of the cipher flags.
...And 3 more matches
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
...jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
...the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard.
...And 3 more matches
Clipboard Test - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
...jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
...the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard.
...And 3 more matches
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
...jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard.
...the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard.
...And 3 more matches
Clipboard - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
...jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard.
...the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard.
...And 3 more matches
Standalone XPCOM - Archive of obsolete content
standalone xpcom is a tree configuration that builds a minimal set of libraries (shared mostly) that can be used to get all features of xpcom.
...this should have been installed in your bin/components directory to run the test, cd to your bin/ directory setenv ld_library_path .
... ./nstestsample warning: mozilla_five_home not set.
...And 3 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
it can be a way to ensure a smooth user-experience when obtaining plugins, without obliging the user to exit the browsing environment to launch a binary installer (the classic setup.exe experience on windows) or obliging the user to restart their browser.
...unlike native code installers (for example, files called setup.exe), the programming language for install operations in xpi is javascript.
...for example, realplayer on windows consists of a plugin dll, but also the realplayer application (exe) which the plugin dll is a subset of.
...And 3 more matches
Writing to Files - Archive of obsolete content
this method has a number of options to specify text or binary writing, the character set, and whether to append to an existing file or create a new one.
...the first argument is the file to write to, and the second is a set of flags which control the writing.
...when writing text files, characters are writing using a chosen character set, encoded automatically.
...And 3 more matches
Simple Query Syntax - Archive of obsolete content
a simple query is equivalent to a query with only the content tag and a member tag, as well as optionally a set of triples from the child node.
...of course, it should be obvious that this causes the value attribute to be set to the photo's title.
...w.xulplanet.com/rdf/"> <template> <rule r:country="http://www.daml.org/2001/09/countries/iso#it"> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://purl.org/dc/elements/1.1/title"/> </vbox> </rule> </template> </hbox> this example shows how a single attribute may be used to filter for only those results that have a country set to 'http://www.daml.org/2001/09/countries/iso#it'.
...And 3 more matches
Template Builder Interface - Archive of obsolete content
if the element is a <tree> element and has the flags attribute set to "dont-build-content", a tree builder will be created.
...an element that does not have a builder will have this property set to null.
...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.
...And 3 more matches
Using Multiple Queries to Generate More Results - Archive of obsolete content
« previousnext » combining results together one interesting technique is to use several queries to combine two sets of unrelated data together.
... to do this, we create one query to generate one set of results and a second query to generate another set of results.
... <template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <label uri="?item" value="?title" class="header"/> </action> </rule> </queryset> <queryset> <query> <content uri="?start"/> <triple...
...And 3 more matches
Anonymous Content - Archive of obsolete content
xbl content xbl can be used to automatically add a set of elements inside another element.
...this is useful for creating a single widget that is made up of a set of other widgets, but can be referred to as only a single widget.
...the id attribute should be set to the identifier of the binding.
...And 3 more matches
Creating a Wizard - Archive of obsolete content
each page contains a single question or a set of related questions.
...a typical layout will include a title across the top, a set of navigation buttons across the bottom and the page contents in between.
...up> <caption label="size"/> <radio value="small" label="small"/> <radio value="large" label="large"/> </radiogroup> <radiogroup> <caption label="gender"/> <radio value="male" label="male"/> <radio value="female" label="female"/> </radiogroup> </wizardpage> </wizard> this wizard has two pages, one that has a drop-down menu and the other with a set of radio buttons.
...And 3 more matches
Document Object Model - Archive of obsolete content
in xul, each function you declare will be set as a property of the window object.
...<splitter id="splitbar" resizeafter="grow" hidden="true"/> <hbox> <progressmeter id="progmeter" value="50%" style="margin: 4px;" hidden="true"/> we've added the hidden attribute and set the value to true.
... xul element dom every xul element has a set of attributes, a set of properties and a set of children.
...And 3 more matches
More Wizards - Archive of obsolete content
this should be set to an identifier for each page.
... then, to navigate to a page, use one of two methods: set the next attribute on each page to the page id of the next page to go to.
... for example, here are a set of wizard pages (the inner content has been omitted): <wizardpage pageid="type" next="font"> <wizardpage pageid="font" next="done"> <wizardpage pageid="color" next="done"> <wizardpage pageid="done"> the wizard always starts at the first page, which in this case has the page id type.
...And 3 more matches
Numeric Controls - Archive of obsolete content
number fields a textbox may be used for entering numbers by setting the value of the type attribute to the value number.
...if these are set, you can control the range of values that the textbox may be set to.
... if the user enters a value less or greater than this value, it will be reset to the minimum or maximum value as necessary.
...And 3 more matches
XUL Structure - Archive of obsolete content
the tree is then converted into a set of objects that can be displayed on the screen.
... it is worth noting that the mozilla browser itself is actually just a set of packages containing xul files, javascript and style sheets.
...each of these components, or packages, is made up of a set of files that describe the user interface for it.
...And 3 more matches
XUL Changes for Firefox 1.5 - Archive of obsolete content
a set of icons will appear across the top of the dialog allowing the user to switch panels.
... along with the new preference elements and some additional attributes for existing elements, they make it easy to set preferences without having to use code.
... <radiogroup> setting the value property on the <radiogroup> element selects the <radio> element in the group with the corresponding value.
...And 3 more matches
Accessibility/XUL Accessibility Reference - Archive of obsolete content
column see grid columns see grid command see keyboard shortcut tutorial commandset see keyboard shortcut tutorial deck only the currently selected deck layer can be focused.
... image <image src="images/img.xbm" tooltiptext='<!--image label-->'/> key see keyboard shortcut tutorial keyset see keyboard shortcut tutorial listbox <label control='listid'><!--label text--></label> <listbox id="listid"> <listitem value="val" label="<!--item text-->"/> </listbox> <label control='listid2' value='<!--list label-->' /> <listbox rows="5" id='listid2'> <listcols> <listcol/> <listcol/> <listcol/> </listcols> <listhead> <listheader label="...
...enu> </menubar> menulist <label value="<!--label text-->" control="comboid" /> <menulist id="comboid"> <menupopup> <menuitem label="<!--option1-->" /> <menuitem label="<!--option2-->" selected="true" /> <menuitem label="<!--option3-->" /> </menupopup> </menulist> menupopup see menulist and menubar popup see popupset popupset be careful regarding keyboard access of popups.
...And 3 more matches
notificationbox - Archive of obsolete content
the notifications may be placed at the bottom by setting the dir attribute to reverse.
...urrentnotification, removenotification, removetransientnotifications, attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties currentnotification type: notification element the currently displayed notification element or null.
...sbytagname(), getelementsbytagnamens(), getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appendnotification( label , value , image , priority , buttons, eventcallback ) return type: element create a new notification and display it.
...And 3 more matches
prefpane - Archive of obsolete content
a prefpane is made up of two parts, the preferences descriptions, which specify the set of preferences that will be modified, and the user interface for adjusting those preferences.
... selected type: boolean this attribute will be set to true for the currently selected prefpane.
... image type: image url gets and sets the value of the image attribute.
...And 3 more matches
Archived Mozilla and build documentation - Archive of obsolete content
building transformiix standalone calicalendarview an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects.
... creating a hybrid cd creating a microsummary a microsummary generator is a set of instructions for creating a microsummary from the content of a page.
... extension frequently asked questions this is quick set of answers to the most common issues with extension development.
...And 3 more matches
NPClass - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary npclass is a structure that holds a set of pointers to functions that make up the behavior of an instance of an npclass (i.e.
... syntax struct npclass { uint32_t structversion; npallocatefunctionptr allocate; npdeallocatefunctionptr deallocate; npinvalidatefunctionptr invalidate; nphasmethodfunctionptr hasmethod; npinvokefunctionptr invoke; npinvokedefaultfunctionptr invokedefault; nphaspropertyfunctionptr hasproperty; npgetpropertyfunctionptr getproperty; npsetpropertyfunctionptr setproperty; npremovepropertyfunctionptr removeproperty; npenumerationfunctionptr enumerate; npconstructfunctionptr construct; }; warning: don't call these routines directly.
...this is set to np_class_struct_version, which is 1 in mozilla 1.8.*, 2 since mozilla 1.9a1, and 3 since firefox 3.0b1.
...And 3 more matches
NPWindow - Archive of obsolete content
ws_info unix: contains information about the plug-in's unix window environment; points to an npsetwindowcallbackstruct.
... the browser calls npp_setvalue whenever the drawable changes.
...for windowed plug-ins, the browser calls the npp_setwindow method with an npwindow structure that represents a drawable (a pointer to an npwindow allocated by the browser).
...And 3 more matches
Introduction to SSL - Archive of obsolete content
clients and servers may support different cipher suites, or sets of ciphers, depending on factors such as the version of ssl they support, company policies regarding acceptable encryption strength, and government restrictions on export of ssl-enabled software.
... the ssl 2.0 and ssl 3.0 protocols support overlapping sets of cipher suites.
...however, the steps involved can be summarized as follows (assuming the use of the cipher suites listed in "cipher suites with rsa key exchange"): the client sends the server the client's ssl version number, cipher settings, randomly generated data, and other information the server needs to communicate with the client using ssl.
...And 3 more matches
Scratchpad - Archive of obsolete content
first you need to check "scratchpad" in the "default firefox developer tools" section of the settings page.
...to do this check "enable chrome and add-on debugging" in the developer tool settings.
... once you've done this, the environment menu has a browser option; once that's selected, your scope is the entire browser rather than just the page content, as you will see from examining some globals: window /* [object chromewindow] */ gbrowser /* [object xulelement] */ the scratchpad execution context is set to browser when a snippet file has // -sp-context: browser on the first line.
...And 3 more matches
Using the W3C DOM - Archive of obsolete content
for example, the following short sample dynamically sets the left margin of a <div> element with an id of "inset" to half an inch: // in the html: <div id="inset">sample text</div> document.getelementbyid("inset").style.marginleft = ".5in"; note: internet explorer 5 through 7 have a flawed implementation of getelementbyid(), which returns the first element with a matching name or id (id versus name when using getelementbyid, msdn: getelementbyid me...
...eltop dom level 2: parseint(elemref.style.top, 10) ie5+: elemref.style.pixelleft = x; elemref.style.pixeltop = y; dom level 2: elemref.style.left = x + "px"; elemref.style.top = y + "px"; w3c dom2 reflection of an element's css properties keep in mind that according to the w3c recommendation, the values returned by the style property of an element reflect static settings in the element's style attribute only, not the total "computed style" that includes any inherited style settings from parent elements.
...so, if you want to get the element's inline style settings for left and top as integers, parse the integer from the string by using parseint().
...And 3 more matches
Browser Feature Detection - Archive of obsolete content
e true true true borderbottomstyle true true true borderleftstyle true true true bottom true true true captionside true false true clear true true true clip true true true content true false true counterincrement true false true counterreset true false true cue true false false cueafter true false false cuebefore true false false cursor true true true direction true true true elevation true false false emptycells true false true fontsizeadjust true false true fontstretch ...
...true false true left true true true markeroffset true false true marks true false true maxheight true ie7 only true maxwidth true ie7 only true minheight true true true minwidth true ie7 only true orphans true false true outline true false true outlinecolor true false true outlinestyle true false true outlinewidth true false true overflow true true true page true false true pagebreakafter true true true pagebreakbefore true true true pagebreakinside true false true pause tru...
...tyle', 'supported': false}, {name: 'borderbottomstyle', 'supported': false}, {name: 'borderleftstyle', 'supported': false}, {name: 'bottom', 'supported': false}, {name: 'captionside', 'supported': false}, {name: 'clear', 'supported': false}, {name: 'clip', 'supported': false}, {name: 'content', 'supported': false}, {name: 'counterincrement', 'supported': false}, {name: 'counterreset', 'supported': false}, {name: 'cue', 'supported': false}, {name: 'cueafter', 'supported': false}, {name: 'cuebefore', 'supported': false}, {name: 'cursor', 'supported': false}, {name: 'direction', 'supported': false}, {name: 'elevation', 'supported': false}, {name: 'emptycells', 'supported': false}, {name: 'fontsizeadjust', 'supported': false}, {name: 'fontstretch', 'supported':...
...And 3 more matches
-ms-filter - Archive of obsolete content
the -ms-filter css property is a microsoft extension that sets or retrieves the filter or collection of filters applied to an object.
... code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_8.htm -ms-filter: 'progid:dximagetransform.microsoft.motionblur(strength=50), progid:dximagetransform.microsoft.basicimage(mirror=1)'; the following example shows how to use an inline style sheet to set the filter on an image.
... 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.
...And 3 more matches
Error.stackTraceLimit - Archive of obsolete content
the error.stacktracelimit property gets or sets the stack trace limit, which is equivalent to the number of error frames to display.
... syntax error.stacktracelimit remarks you can set the stacktracelimit property to any positive value between 0 and infinity.
... if the stacktracelimit property is set to 0 at the time an error is thrown, no stack trace is shown.
...And 3 more matches
Old Proxy API - Archive of obsolete content
proxy.name = val (in the context of "setting the value") receiver.name = val (if receiver inherits from a proxy and does not override name) set: function(receiver, name, val) -> boolean function(receiver, name, val) { var desc = this.getownpropertydescriptor(name); if (desc) { if ('writable' in desc) { if (desc.writable) { desc.value = val; this.defineproperty(name, desc); retur...
...n true; } else { return false; } } else { // accessor if (desc.set) { desc.set.call(receiver, val); return true; } else { return false; } } } desc = this.getpropertydescriptor(name); if (desc) { if ('writable' in desc) { if (desc.writable) { // fall through } else { return false; } } else { // accessor if (desc.set) { desc.set.call(receiver, val); return true; } else { return false; } } } this.defineproperty(name, { value: val, writable: true, enumerable: true, configurable: true}); return true; } receiver is either the proxy or an object that inherits from the proxy.
...be careful of how you use the receiver argument in 'get' and 'set' traps.
...And 3 more matches
Common causes of memory leaks in extensions - Extensions
be careful with setinterval/settimeout using window.setinterval() or window.settimeout() can be problematic, too, when it comes to zombie compartments.
... 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.
... however, while this is still true, the window.setinterval() in the example originates from the outer chrome window (browser.xul) and not from the content window.
...And 3 more matches
Building up a basic demo with Babylon.js - Game development
in this article we'll take you through the real basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code.
... environment setup to start developing with babylon.js, you don't need much.
... html structure here's the html structure we will use: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: babylon.js demo</title> <style> html,body,canvas { margin: 0; padding: 0; width: 100%; height: 100%; font-size: 0; } </style> </head> <body> <script src="babylon.js"></script> <canvas id="render-canvas"></canvas> <script> var canvas = document.getelementbyid("render-canvas"); /* all our javascript code goes here */ </script> </body> </html> ...
...And 3 more matches
WebVR — Virtual Reality for the Web - Game development
the webvr api the webvr api is the central api for capturing information on vr devices connected to a computer and headset position/orientation/velocity/acceleration information, and converting that into useful data you can use in your games and other applications.
... using the webvr api the webvr api is based on two concepts — sending stereoscopic images to both lenses in your headset and receiving positional data for your head from the sensor, and those two are handled by hmdvrdevice (head-mounted display virtual reality device) and positionsensorvrdevice.
...evice) { ghmd = devices[i]; break; } } if (ghmd) { for (var i = 0; i < devices.length; ++i) { if (devices[i] instanceof positionsensorvrdevice && devices[i].hardwareunitid === ghmd.hardwareunitid) { gpositionsensor = devices[i]; break; } } } }); this code will loop through the available devices and assign proper sensors to the headsets — the first devices array contains the connected devices, and a check is done to find the hmdvrdevice, and assign it to the ghmd variable — using this you can set up the scene, getting the eye parameters, setting the field of view, etc.
...And 3 more matches
asm.js - Game development
asm.js is a specification defining a subset of javascript that is highly optimizable.
... this article looks at exactly what is permitted in the asm.js subset, what improvements it confers, where and how you can make use of it, and further resources and examples.
... it is a very small, strict subset of javascript that only allows things like `while`, `if`, numbers, top-level named functions, and other simple constructs.
...And 3 more matches
Finishing up - Game development
we can also reset the ball and the paddle positions when the player begins with their next life.
...if there are no lives left, the game is lost; if there are still some lives left, then the position of the ball and the paddle are reset, along with the movement of the ball.
...requestanimationframe helps the browser render the game better than the fixed framerate we currently have implemented using setinterval().
...And 3 more matches
Extra lives - Game development
add the following lines below the existing scoretext definition inside your create() function: livestext = game.add.text(game.world.width-5, 5, 'lives: '+lives, { font: '18px arial', fill: '#0095dd' }); livestext.anchor.set(1,0); lifelosttext = game.add.text(game.world.width*0.5, game.world.height*0.5, 'life lost, click to continue', { font: '18px arial', fill: '#0095dd' }); lifelosttext.anchor.set(0.5); lifelosttext.visible = false; the livestext and lifelosttext objects look very similar to the scoretext one — they define a position on the screen, the actual text to display, and the font styling.
... the former is anchored on its top right edge to align properly with the screen, and the latter is centered, both using anchor.set().
... the lifelosttext will be shown only when the life is lost, so its visibility is initially set to false.
...And 3 more matches
Initialize the framework - Game development
using your favourite text editor, create a new html document, save it as index.html, in a sensible location, and add the following code to it: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>gamedev phaser workshop - lesson 01: initialize the framework</title> <style>* { padding: 0; margin: 0; }</style> <script src="js/phaser.min.js"></script> </head> <body> <script> var game = new phaser.game(480, 320, phaser.canvas, null, { preload: preload, create: create, update: update }); function preload() {} function create() {} function...
... walking through what we have so far at this point we have a charset defined, <title> and some basic css in the header to reset the default margin and padding.
...the parameters are: the width and height to set the <canvas> to.
...And 3 more matches
Physics - Game development
for proper collision detection between objects in our game we will need to have physics; this article introduces you to what's available in phaser, as well as demonstrating a typical simple setup.
...add the following line at the bottom of the create() function: game.physics.enable(ball, phaser.physics.arcade); next, if we want to move our ball on the screen, we can set velocity on its body.
... add the following line, again at the bottom of create(): ball.body.velocity.set(150, 150); removing our previous update instructions remember to remove our old method of adding values to x and y from the update() function: function update() { ball.x += 1; ball.y += 1; } we are now handling this properly, with a physics engine.
...And 3 more matches
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
the content attribute is the attribute as you set it from the content (the html code) and you can set it or get it via element.setattribute() or element.getattribute().
...for example, to set an <input> element's maxlength to 42 using the content attribute, you have to call setattribute("maxlength", "42") on that element.
...these are the attributes you can read or set using javascript properties like element.foo.
...And 3 more matches
Accessible multimedia - Learn web development
the problem with native html5 controls html5 video and audio instances even come with a set of inbuilt controls that allow you to control the media straight out of the box.
... basic setup first, grab a copy of our custom-controls-start.html, custom-controls.css, rabbit320.mp4, and rabbit320.webm files and save them in a new directory on your hard drive.
...here is a <a href="rabbit320.mp4">link to the video</a> instead.</p> </video> <div class="controls"> <button class="playpause">play</button> <button class="stop">stop</button> <button class="rwd">rwd</button> <button class="fwd">fwd</button> <div class="time">00:00</div> </div> </section> javascript basic setup we've inserted some simple control buttons below our video.
...And 3 more matches
Sending form data - Learn web development
an http request consists of two parts: a header that contains a set of global metadata about the browser's capabilities, and a body that can contain information necessary for the server to process the specific request.
... let's look at an example — this is the same form we looked at in the get section above, but with the method attribute set to post.
...to get it working again, we have found that you can load up the mamp app, then choose the menu options mamp > preferences > php, and set "standard version:" to "7.2.x" (x will differ depending on what version you have installed).
...And 3 more matches
Sending forms through JavaScript - Learn web development
something went wrong.' ); } ); // set up our request xhr.open( 'post', 'https://example.com/cors.php' ); // add the required http header for form data post requests xhr.setrequestheader( 'content-type', 'application/x-www-form-urlencoded' ); // finally, send our data.
...something went wrong.' ); } ); // set up our request xhr.open( 'post', 'https://example.com/cors.php' ); // send our formdata object; http headers are set automatically xhr.send( fd ); } btn.addeventlistener( 'click', function() { senddata( {test:'ok'} ); } ) here's the live result: using formdata bound to a form element you can also bind a formdata object to an <form> element.
..."send me!"> </form> but javascript takes over the form: window.addeventlistener( "load", function () { function senddata() { const xhr = new xmlhttprequest(); // bind the formdata object and the form element const fd = new formdata( form ); // define what happens on successful data submission xhr.addeventlistener( "load", function(event) { alert( event.target.responsetext ); } ); // define what happens in case of error xhr.addeventlistener( "error", function( event ) { alert( 'oops!
...And 3 more matches
Using data attributes - Learn web development
data-* attributes allow us to store extra information on standard, semantic html elements without other hacks such as non-standard attributes, extra properties on dom, or node.setuserdata().
...you could use getattribute() with their full html name to read them, but the standard defines a simpler way: a domstringmap you can read out via a dataset property.
... to get a data attribute through the dataset object, get the property by the part of the attribute name after data- (note that dashes are converted to camelcase).
...And 3 more matches
Introduction to client-side frameworks - Learn web development
angular uses typescript, a superset of javascript that we’ll look at in a little more detail in the next chapter.
...it follows a similar pattern to the one we used to build a list item element: function builddeletebuttonel(id) { const button = document.createelement('button'); const textcontent = document.createtextnode('delete'); button.setattribute('type', 'button'); button.appendchild(textcontent); return button; } this button doesn't do anything yet, but it will later once we decide to implement our delete feature.
...in a vanilla javascript app, you'd have to create your own set of conventions to achieve this in an efficient, scalable way.
...And 3 more matches
Starting our Svelte Todo list app - Learn web development
if the task is not being edited, there's a checkbox to set the completed status, and two buttons to edit or delete the task.
...setting a value of true means that the button is pressed by default.
...replace the contents of the file public/global.css with the following: /* resets */ *, *::before, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; outline-offset: 0; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: transparent; color: inherit; font: inherit; line-height:...
...And 3 more matches
Vue conditional rendering: editing existing todos - Learn web development
this code sets up the core of the edit functionality.
...this handler will set an isediting flag to true.
...this method should take the new item label as an argument, emit an itemedited event to the parent component, and set isediting to false.
...And 3 more matches
Package management basics - Learn web development
setting up the app as an npm package first of all, create a new directory to store our experimental app in, somewhere sensible that you’ll find again.
... press return one more time to accept these settings.
...you'll see that npm has added a new field, dependencies: "dependencies": { "parcel-bundler": "^1.12.4" } this is part of the npm magic — if in future you move your codebase to another location, on another machine, you can recreate the same set up by running the command npm install, and npm will look at the dependencies and install them for you.
...And 3 more matches
A bird's-eye view of the Mozilla framework
the various x toolkit implementations provide a set of widgets for ui controls such as menus, command buttons, dialog boxes and scroll bars.
... the mozilla xptoolkit module provides a similar set of facilities for building cross-platform ui controls implemented as xml user interface language (xul) packages.
... a xul package consists of a xul description of the ui widget cascading style sheets customizing appearance javascript services implementing the ui behavior a package (also known as chrome) is really just a bundling of a set of ui widgets and associated services implementing a particular application feature.
...And 3 more matches
Command line options
-setdefaultbrowser set the application as the default browser.
... -setdefaultmail set the application as the default email client.
... -purgecaches gecko (layout engine) has a javascript cache, which is not reset on startup, this clears it.
...And 3 more matches
mach
if the mozconfig environment variable is set, use the file pointed to in that variable.
...$ 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.
...that above bootstrap.py will download and setup everything so you can build a mozilla app such as firefox etcetera, so it is a nice starting point.
...And 3 more matches
Embedding the editor
the problem with this ownership model is that there can be only one editor per <editor> tag, yet the document loaded in the <iframe> may itself contain multiple <iframe>s (consider a frameset document, or a document itself containing an <html:iframe>).
... meeting these objectives will also solve the following existing composer problems: composer should handle frameset documents composer should handle documents with <iframe>s.
...a subset of nsieditorshell will probably move into this interface.
...And 3 more matches
How to implement a custom autocomplete search component
to use autocomplete with a xul textbox, all you need to do is set some attributes: <textbox type="autocomplete" autocompletesearch="history"/> the type="autocomplete" turns on the autocomplete mechanism and the autocompletesearch="history" sets the source for the autocomplete.
... * if removefromdb is set to true, the value should be removed from * persistent storage as well.
... * if removefromdb is set to true, the value should be removed from * persistent storage as well.
...And 3 more matches
Http.jsm
method get, post or put (this is automatically set if postdata exists).
... onload a function handle to call when the load is complete, it takes two parameters: the responsetext and the xhr object.
... onerror a function handle to call when an error occurs, it takes three parameters: the error, the responsetext and the xhr object.
...And 3 more matches
Encodings for localization files
this is tricky to hook up in the build process, so here it goes: file encoding notes toolkit/installer/windows/charset.mk ascii the win_installer_charset variable must be set to an encoding which matches toolkit/installer/windows/install.it charset= parameter.
...this must match the charset= parameter in this file, and the win_installer_charset parameter in charset.mk the fontname/fontsize/charset parameters in this file must be set to good values.
... for most western scripts, ‘ms sans serif’ and ‘8’ are good defaults for the font settings.
...And 3 more matches
Localizing with Mercurial
your config file should have the following settings: [ui] username = your real name <user@example.com> merge = internal:merge [defaults] commit = -v [diff] git = 1 showfunc = 1 unified = 8 to configure hg, follow these steps: create a new file in your favorite text editor.
... copy the settings above and paste them into your new file.
...you can therefore use the one set up for developing firefox, seamonkey and thunderbird without having to pull mozilla-central a second time.
...And 3 more matches
A brief guide to Mozilla preferences
a preference is any value or defined behavior that can be set (presumably, one setting is preferable to another).
...on application exit, all user-set preferences are saved to prefs.js .
... this also means that preferences initially set by user.js will also be saved to prefs.js.
...And 3 more matches
Leak And Bloat Tests
the method of testing memory bloat and leaks will be the same sequence of events, using the same set of test data.
... manually running tests setting up build set up build thunderbird or seamonkey with your standard mozconfig file, but with the following options set: ac_add_options --enable-debug ac_add_options --enable-trace-malloc running the tests in your <objdir> run the following command: make mailbloat this will run the tests and produce some result files.
...ing are be stored in: http://mxr.mozilla.org/comm-central/source/mailnews/test/performance these files consist of: overlays (used to provide the hooks for the javascript): bloat/bloataddroverlay.xul bloat/bloatcomposeoverlay.xul bloat/bloatmainoverlay.xul javascript files (used to drive the tests): bloat/bloataddroverlay.js bloat/bloatcomposeoverlay.js bloat/bloatmainoverlay.js preference settings (used to provide a defined profile, see below): common/mailnewstestprefs.js python scripts (used to set up the profile and run the test): bloat/setupbloattest.py bloat/runtest.py common/setupcommonmailnews.py pre-defined profile initial setup: one pop3 account (mails tbd) one identity one smtp server defined (not used) future requirements/possibilities: one address book where pab...
...And 3 more matches
PR_Poll
detects when i/o is ready for a set of socket file descriptors.
... the in_flags field of the prpolldesc data structure should be set to the i/o events (readable, writable, exception, or some combination) that the caller is interested in.
... on successful return, the out_flags field of the prpolldesc data structure is set to indicate what kind of i/o is ready on the respective descriptor.
...And 3 more matches
Threads
creating, joining, and identifying threads controlling thread priorities interrupting and yielding setting global thread concurrency getting a thread's scope creating, joining, and identifying threads pr_createthread creates a new thread.
... controlling thread priorities for an overview of the way nspr controls thread priorities, see setting thread priorities.
... you set a thread's nspr priority when you create it with pr_createthread.
...And 3 more matches
4.3.1 Release Notes
release date: 2009-12-02 introduction network security services for java (jss) 4.3.1 is a minor release with the following new features: support for ssl3 & tls renegotiation vulnerablity support to explicitly set the key usage for the generated private key jss 4.3.1 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1.
...if an application depends on renegotiation feature, it can be enabled by setting the environment variable nss_ssl_enable_renegotiation to 1.
... by setting this environmental variable, the fix provided by these patches will have no effect and the application may become vulnerable to the issue.
...And 3 more matches
NSS_3.12_release_notes.html
(see cert.h) cert_findnameconstraintsexten (see cert.h) cert_getclassicocspdisabledpolicy (see cert.h) cert_getclassicocspenabledhardfailurepolicy (see cert.h) cert_getclassicocspenabledsoftfailurepolicy (see cert.h) cert_getpkixverifynistrevocationpolicy (see cert.h) cert_getusepkixforvalidation (see cert.h) cert_getvaliddnspatternsfromcert (see cert.h) cert_newtempcertificate (see cert.h) cert_setocsptimeout (see certhigh/ocsp.h) cert_setusepkixforvalidation (see cert.h) cert_pkixverifycert (see cert.h) hash_gettype (see sechash.h) nss_initwithmerge (see nss.h) pk11_createmergelog (see pk11pub.h) pk11_creategenericobject (see pk11pub.h) pk11_createpbev2algorithmid (see pk11pub.h) pk11_destroymergelog (see pk11pub.h) pk11_generatekeypairwithopflags (see pk11pub.h) pk11_getpbecryptomechanism...
...[@ memcmp] bug 396256: certutil and pp do not print all the generalnames in a crldp extension bug 398019: correct confusing and erroneous comments in der_asciitotime bug 422866: vfychain -pp command crashes in nss_shutdown bug 345779: useless assignment statements in ec_gf2m_pt_mul_mont bug 349011: please stop exporting these crmf_ symbols bug 397178: crash when entering chrome://pippki/content/resetpassword.xul in url bar bug 403822: pkix_pl_ocsprequest_create can leave some members uninitialized bug 403910: cert_findusercertbyusage() returns wrong certificate if multiple certs with same subject available bug 404919: memory leak in sftkdb_readsecmoddb() (sftkmod.c) bug 406120: allow application to specify ocsp timeout bug 361025: support for camellia cipher suites to tls rfc4132 bug 376417:...
...bug 401610: shared db fails on iopr tests bug 388120: build error due to sec_begin_protos / sec_end_protos are undefined bug 415264: make security use of new nspr rotate macros bug 317052: lib/base/whatnspr.c is obsolete bug 317323: set nspr31_lib_prefix to empty explicitly for win95 and wince builds bug 320336: secitem_allocitem returns a non-null pointer if the allocation of its 'data' buffer fails bug 327529: can't pass 0 as an unnamed null pointer argument to cert_createrdn bug 334683: extraneous semicolons cause empty declaration compiler warnings bug 335275: compile with the gcc flag -werror-implicit-function-declaration b...
...And 3 more matches
FC_InitToken
(user certs are the certificates that have their associated private keys in the key database.) a user must be able to call fc_inittoken() without logging into the token (to assume the nss user role) because either the user's password hasn't been set yet or the user forgets the password and needs to blow away the password-encrypted private key database and start over.
... ckr_device_error: failed to reset the key database.
... application usage fc_inittoken() is used to reset the password for the key database when the user forgets the password.
...And 3 more matches
Necko walkthrough
but the interface for clients of necko is important to consider: send request uri helps creates channel setup channel (headers, request data, response callback...) channel->asyncopen.
...annel::asyncopen nshttpchannel::beginconnect() creates nshttpconnectioninfo object for the channel checks if we're proxying or not fires off the dns prefetch request (dispatched to dns thread pool) some other things nshttpchannel::connect might to a speculativeconnect (pre open tcp socket) nshttpchannel::continueconnect some cache stuff nshttpchannel::setuptransaction creates new nshttptransaction, and inits it with mrequesthead (the request headers) and muploadstream (which was created from the request data in channel setup) gets an nsiasyncinputstream (for the response; corresponds to the nspipeinputstream for the response stream pipe) passes it to nsinputstreampump nshttpchannel::ghttphandler->initiatetransaction (called from ...
...nspipeinputstream::asyncwait), with target thread set to the current thread, i.e.
...And 3 more matches
Rhino Debugger
the rhino javascript debugger can debug scripts running in multiple threads and provides facilities to set and clear breakpoints, control execution, view variables, and evaluate arbitrary javascript code in the current scope of an executing script.
... setting and clearing breakpoints the main desktop of the debugger contains file windows which display the contents of each script you are debugging.
... you may set a breakpoint in a script by doing one of the following: place the cursor on the line at which you want to set a breakpoint and right-click with the mouse.
...And 3 more matches
Invariants
(one reason for this is that the object may have watchpoints set; the watchpoint machinery assumes that all objects with watched properties are native.
...js_setparent can violate this, if the application is really that dumb, but generally every object is newer than its __parent__.) the tracejit must not trace into a function whose scope chain ends in a different global object.
...the same slot being allocated to more than one property would be a problem for obvious reasons.) all jsshapes in dictionary-mode objects have the in_dictionary flag set.
...And 3 more matches
JS::PersistentRooted
added in spidermonkey 38 void init(jscontext* cx, t initial) void init(jsruntime* rt) void init(jsruntime* rt, t initial) void reset() reset the value to initial value of the type.
... const t* address() const persistentrooted<t>& operator=(const t& p) sets the value of ptr.
...t*> persistentrootedobject; typedef persistentrooted<jsscript*> persistentrootedscript; typedef persistentrooted<jsstring*> persistentrootedstring; typedef persistentrooted<js::symbol*> persistentrootedsymbol; // added in spidermonkey 38 typedef persistentrooted<value> persistentrootedvalue; } example following example allocates persistentrootedvalue, and provides two functions for setting and getting it from javascript.
...And 3 more matches
JSPropertySpec
*unused; const char *funname; }; const char *name; int8 tinyid; // obsolete since jsapi 31 uint8_t flags; union { jsnativewrapper native; selfhostedwrapper selfhosted; } getter; union { jsnativewrapper native; selfhostedwrapper selfhosted; } setter; /* obsolete since jsapi 29 */ /* added in jsapi 28 */ const char *selfhostedgetter; const char *selfhostedsetter; }; name type description name const char * name to assign the property.
... tinyid int8 obsolete since jsapi 31 unique id number for the property to aid in resolving getproperty and setproperty method calls.
...the getter/setter function is only used by one property).
...And 3 more matches
JS_InitClass
these include native c functions for instance finalization, adding and deleting properties, getting and setting property values, and enumerating, converting, and resolving properties.
... note: starting with spidermonkey 1.8, the prototype and constructor are set up with stub getter and setter operations instead of class operations.
...the property has the stub getter and setter and no property attributes.
...And 3 more matches
JS_NewDateObject
year int the year to set the new object to.
... mon int the month to set the new object to.
... mday int the day of the month to set the new object to.
...And 3 more matches
JS_PSGS
#define js_psgs(name, getter, setter, flags) ...
...// added in spidermonkey 31 #define js_self_hosted_getset(name, gettername, settername, flags) ...
... setter jsnative pointer to the c/c++ implementation of the setter function.
...And 3 more matches
Avoiding leaks in JavaScript XPCOM components
garbage collection garbage collection is generally used to refer to algorithms that (1) determine which objects are still needed by starting from a set of roots and finding all objects reachable from those objects and (2) returning all remaining objects to the heap.
...mozilla's javascript engine uses one of the most common garbage collection algorithms, mark and sweep, in which the garbage collector clears the mark bit on each object, sets the mark bits on all roots and all objects reachable from them, and then finalizes all objects not marked and returns the memory they used to the heap.
...we currently implement this by making the wrapper a root in the javascript garbage collector once somebody sets a javascript property on a dom node.
...And 3 more matches
Building the WebLock UI
as you can see, weblock is initialized as a global javascript variable, available in the scope of these functions and others: var weblock = components.classes["@dougt/weblock"] .getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write javascript that uses the addsite method to add new sites to the white list.
... the locking ui once you have the basic xul wrapper set up for your interface, the next step is to define that part of the interface that locks and unlocks the browser.
... the xul that defines the radiogroup in the web lock manager dialog is this: <radiogroup> <radio label="lock"/> <radio label="unlock" selected="true"/> </radiogroup> since the weblock component always starts up in the unlocked position, you can add the selected="true" attribute and value on the unlock radio button and reset it dynamically as the user takes action.
...And 3 more matches
inIDOMUtils
ylesheet(in nsidomcssstylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselectorindex, [optional] in domstring apseudo); void setcontentstate(in nsidomelement aelement, in unsigned long long astate); constants constant value description exclude_shorthands (1<<0) include_aliases (1<<1) content state flags the content state flags are used in a bitmask.
... return value void setcontentstate() sets the given element as the current owner of the specified state, and removes that state from the previous owner.
... void setcontentstate( in nsidomelement aelement, in unsigned long long astate ); parameters aelement the element to set the content state of.
...And 3 more matches
mozITXTToHTMLConv
loglinestart on output, this parameter is set to indicate the offset into the string of the first non-cite character.
... you must set this value to zero before calling this method.
... findurlinplaintext() returns the start and end offsets of the first url found in a substring.
...And 3 more matches
nsIClassInfo
if the flags attribute has the singleton bit set, then the value of this attribute specifies a classid through which this class can be accessed as a service using nsiservicemanager.getservice().
...if the flags attribute has the singleton bit set, then the value of this attribute specifies a classid through which this class can be accessed as a service using nsiservicemanager.getservice().
...if the flags attribute has the singleton bit set, then the value of this attribute specifies a contractid through which this class may be accessed as a service using nsiservicemanager.getservicebycontractid().
...And 3 more matches
nsIDOMEvent
nbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidelines void settarget(in nsidomeventtarget atarget); native code only!
... void settrusted(in boolean atrusted); native code only!
...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.
...And 3 more matches
nsIEditorSpellCheck
estedword(); void ignorewordalloccurrences(in wstring word); void initspellchecker(in nsieditor editor, in boolean enableselectionchecking); void removewordfromdictionary(in wstring word); void replaceword(in wstring misspelledword, in wstring replaceword, in boolean alloccurrences); void savedefaultdictionary(); obsolete since gecko 9.0 void setcurrentdictionary(in astring dictionary); void setfilter(in nsitextservicesfilter filter); void uninitspellchecker(); void updatecurrentdictionary(); methods addwordtodictionary() adds the specified word to the current personal dictionary.
...setcurrentdictionary() selects the main dictionary to use.
... void setcurrentdictionary( in astring dictionary ); parameters dictionary the name of the dictionary to use.
...And 3 more matches
nsIHttpChannelInternal
6 introduced gecko 1.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) method overview void getrequestversion(out unsigned long major, out unsigned long minor); void getresponseversion(out unsigned long major, out unsigned long minor); void httpupgrade(in acstring aprotocolname, in nsihttpupgradelistener alistener); void setcookie(in string acookieheader); void setupfallbackchannel(in string afallbackkey); attributes attribute type description canceled boolean returns true if and only if the channel has been canceled.
... channelisfordownload boolean external handlers may set this to true to notify the channel that it is open on behalf of a download.
...setcookie() helper method to set a cookie with a consumer-provided cookie header, but using the channel's other information (uri's, prompters, date headers and so on.).
...And 3 more matches
nsIMsgMessageService
ri aurl); [noscript] void copymessages(in nsmsgkeyarrayptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedummyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in b...
... amovemessage set to true if you want the message to be moved.
... amovemessage set to true if you want the message to be moved.
...And 3 more matches
nsIMsgWindow
you don't normally need to set this, instead set the domwindow property instead.
... notificationcallbacks nsiinterfacerequestor these are currently used to set notification callbacks on protocol channels to handle things like bad cert exceptions.
... mailcharacterset acstring this is used to track the character set of the currently displayed message.
...And 3 more matches
nsIScriptableUnicodeConverter
acstring asrc); astring convertfrombytearray([const,array,size_is(acount)] in octet adata, in unsigned long acount); void converttobytearray(in astring astring,[optional] out unsigned long alen,[array, size_is(alen),retval] out octet adata); nsiinputstream converttoinputstream(in astring astring); attributes attribute type description charset string current character set.
... throws ns_error_uconv_noconv if the requested charset is not supported.
... methods convertfromunicode() converts the data from unicode to one charset.
...And 3 more matches
nsIStandardURL
to create an instance, use: var standardurl = components.classes["@mozilla.org/network/standard-url;1"] .createinstance(components.interfaces.nsistandardurl); method overview void init(in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this url can be modified.
... protocol handlers can set this flag before handing out an url to ensure that it is not inadvertently modified.
...void init( in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aurltype one of the constants listed above.
...And 3 more matches
nsITelemetry
isupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenab...
...led(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in uint32_t adataset, [optional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); void keyedscalarset(in acstring aname, in astring akey, in jsval avalue); void keyedscalarsetmaximum(in acstring aname, in astring akey, in jsval avalue); jsval snapshotkeyedscalars(in uint32_t adataset, [optional] in boolean aclear); void clear...
...scalars(); test only void flushbatchedchildtelemetry(); void recordevent(in acstring acategory, in acstring amethod, in acstring aobject, [optional] in jsval avalue, [optional] in jsval extra); void seteventrecordingenabled(in acstring acategory, in boolean aenabled); jsval snapshotevents(in uint32_t adataset, [optional] in boolean aclear); void registerevents(in acstring acategory, in jsval aeventdata); void registerscalars(in acstring acategoryname, in jsval ascalardata); void clearevents(); test only attributes attribute type description canrecordbase boolean a flag indicating if telemetry can record base data (fhr data).
...And 3 more matches
nsITransferable
nsisupportsarray flavorstransferablecanexport( ); nsisupportsarray flavorstransferablecanimport( ); void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); void init(in nsiloadcontext acontext); boolean islargedataset( ); void removedataflavor( in string adataflavor ); void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); attributes attribute type description converter nsiformatconverter an nsiformatconverter instance which implements the code needed to convert data into and out of the transferable given the supported...
...this can be set to null if a load context is not available.
... islargedataset() returns true if the data is large.
...And 3 more matches
nsIWebBrowser
the embedder must associate the two by setting this property to point to the chrome object before creating the browser window via the browser's nsibasewindow interface.
...the embedder must explicitly set this value back to nsnull if the chrome object is destroyed before the browser object.
...for optimal performance, set it to false when appropriate.
...And 3 more matches
Getting Started Guide
for instance, here is a typical snippet of code (at its most compact) where you assign a xpcom interface pointer into a member variable, i.e., the body of a `setter' function, side-by-side using raw xpcom interface pointers and nscomptrs.
...setting a member variable.
... */ mfooptr = afooptr; additionally, the class using raw xpcom interface pointers will need a destructor to release mfooptr; and a constructor to ensure that mfooptr is initially set to null (or some other reasonable value).
...And 3 more matches
customDBHeaders Preference
as you follow along the step-by-step guide in creating a custom column, you may want to consider a preference setting that exposes custom header data for use in a custom column within thunderbird's main view.
... 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.
... in addition to the preference outlined in setting up extension development environment, you'll want to add the following preferences: // this allows you to add extra headers while composing messages user_pref("mail.compose.other.header", "x-superfluous,x-other,x-whatever"); // this enables the preservation of custom headers as incoming mail is processed user_pref( "mailnews.customdbheaders", "x-superfluous,x-other"); important: please pay careful attention to the case of the mailnews.customdbheaders preference.
...And 3 more matches
Add to iPhoto
initializing core foundation the init() method, which sets everything up, looks like this: init: function() { this.lib = ctypes.open("/system/library/frameworks/corefoundation.framework/corefoundation"); // declaring all the apis goes here } shutting down core foundation while the core foundation system framework itself doesn't need to be shut down, we do need to close the library we opened using the js-ctypes api; that's where the shutdown() m...
... cfrange cfrange is a structure that identifies a range; that is, it identifies an offset to an item in a list and a number of items.
...the string can be stored in any of a number of encodings, so you use assorted functions that know how to cope with different encodings to set and get values of cfstrings, as well as to perform typical string operations.
...And 3 more matches
Working with ArrayBuffers
the following codeblock provides a basic example of getting and setting uint8clampedarray and arraybuffer of imagedata: // context is a canvasrenderingcontext2d of some canvas var imagedata = context.getimagedata(x, y, w, h); var array = imagedata.data; // array is a uint8clampedarray var buffer = imagedata.data.buffer; // buffer is a arraybuffer // incomingbuffer is a typedarray var imagedata2 = context.createimagedata(w, h); imagedata2.data.set(incomingbuffer...
...pixelbuffer.tostring(); // "ctypes.uint8_t.ptr(ctypes.uint64("0x352e0000"))" var imgwidth = 400; var imgheight = 400; var myimgdat = new imagedata(imgwidth, imgheight); method 1: passing arraytype cdata to uint8clampedarray.prototype.set one method is to get into a js-ctypes array, and then set it into the imagedata, as illustrated by the following code example.
... // cast pointer to array, to pass to uint8clampedarray.prototype.set.
...And 3 more matches
Streams - Plugins
the plug-in can set the output parameter type to one of these transmission modes: np_normal: (default): the plug-in can process the data progressively as it arrives from the network or file system through a series of calls to npp_writeready and npp_write.
... int32 npp_write(npp instance, npstream *stream, int32 offset, int32 len, void *buf); the instance parameter is the current plug-in instance; the stream parameter specifies the current stream.
... the offset parameter specifies the offset, in bytes, of buf from the beginning of the data in the stream.
...And 3 more matches
Edit CSS filters - Firefox Developer Tools
once you have added an effect, enter the settings you want and then press enter to update the effect.
... saving filter presets from firefox 42 onwards, you can also add filters to a list of presets.
... the list of presets will be preserved between browser sessions, making it easy to apply the settings in the future.
...And 3 more matches
Allocations - Firefox Developer Tools
to enable the allocations view, you must check "record allocations" in the performance tool settings, before recording a profile.
...click this to see the places this function was called from: here you can see that signallater() was called from two places: removeinner() and setselectioninner().
... self cost and total cost you'll see that there are separate sets of columns for "self" and for "total".
...And 3 more matches
Style Editor - Firefox Developer Tools
you can switch autocomplete off in the style editor settings.
... viewing original sources now, if you check "show original sources" in the style editor settings, the links next to css rules in the rules view will link to the original sources in the style editor.
... first, set up your preprocessor so it watches the original source and automatically regenerates the css when the source changes.
...And 3 more matches
AudioBufferSourceNode.start() - Web APIs
syntax audiobuffersourcenode.start([when][, offset][, duration]); parameters when optional the time, in seconds, at which the sound should begin to play, in the same time coordinate system used by the audiocontext.
... offset optional an offset, specified as the number of seconds in the same time coordinate system as the audiocontext, to the time within the audio buffer that playback should begin.
... for example, to start playback halfway through a 10-second audio clip, offset should be 5.
...And 3 more matches
ByteLengthQueuingStrategy - Web APIs
ingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...view android full support 59chrome android full support 59firefox android full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...constructor experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...And 3 more matches
Drawing shapes with canvas - Web APIs
« previousnext » now that we have set up our canvas environment, we can get into the details of how to draw on the canvas.
... path methods methods to set different paths for objects.
...every time this method is called, the list is reset and we can start drawing new shapes.
...And 3 more matches
ConstantSourceNode - Web APIs
in addition, it can be used like a constructible audioparam by automating the value of its offset or by connecting another node to it; see controlling multiple parameters with constantsourcenode.
...the output's value is always the same as the value of the offset parameter.
... properties inherits properties from its parent interface, audioscheduledsourcenode, and adds the following properties: offset an audioparam which specifies the value that this source continuously outputs.
...And 3 more matches
CountQueuingStrategy - Web APIs
ingstrategy experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...view android full support 59chrome android full support 59firefox android full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...constructor experimentalchrome full support 59edge full support 16firefox full support 57disabled full support 57disabled disabled from version 57: this feature is behind the dom.streams.enabled preference (needs to be set to true) and the javascript.options.streams preference (needs to be set to true).
...And 3 more matches
Document.fonts - Web APIs
WebAPIDocumentfonts
the fonts property of the document interface returns the fontfaceset interface of the document.
... syntax let fontfaceset = document.fonts; value the returned value is the fontfaceset interface of the document.
... the fontfaceset interface is useful for loading new fonts, checking the status of previously loaded fonts etc.
...And 3 more matches
HTMLButtonElement - Web APIs
reset: the button resets the form.
...it is false if any conditions bar it from constraint validation, including: its type property is reset or button; it has a <datalist> ancestor; or the disabled property is set to true.
... methods inherits methods from its parent, htmlelement name return type description checkvalidity() boolean not supported for reset or button elements.
...And 3 more matches
HTMLInputElement.stepDown() - Web APIs
input type="time" max="17:00" step="900"> <!-- decrements by intervals of 7 days (one week) --> <input type="date" max="2019-12-25" step="7"> <!-- decrements by intervals of 12 months (one year) --> <input type="month" max="2019-12" step="12"> the method, when invoked, changes the form control's value by the value given in the step attribute, multiplied by the parameter, within the constraints set within the form control.
...the method will not cause the value to go below the min value set or defy the constraints set by the step attribute.
... if the value before invoking the stepdown() method is invalid, for example, if it doesn't match the constraints set by the step attribute, invoking the stepdown() method will return a value that does match the form controls constraints.
...And 3 more matches
HTML Drag and Drop API - Web APIs
identify what is draggable making an element draggable requires adding the draggable attribute and the ondragstart global event handler, as shown in the following code sample: <script> function dragstart_handler(ev) { // add the target element's id to the data transfer object ev.datatransfer.setdata("text/plain", ev.target.id); } window.addeventlistener('domcontentloaded', () => { // get the element by id const element = document.getelementbyid("p1"); // add the ondragstart event listener element.addeventlistener("dragstart", dragstart_handler); }); </script> <p id="p1" draggable="true">this element is draggable.</p> for more information, see: draggable attrib...
...the setdata() method is used to add an item to the drag data, as shown in the following example.
... function dragstart_handler(ev) { // add different types of drag data ev.datatransfer.setdata("text/plain", ev.target.innertext); ev.datatransfer.setdata("text/html", ev.target.outerhtml); ev.datatransfer.setdata("text/uri-list", ev.target.ownerdocument.location.href); } for a list of common data types used in drag-and-drop (such as text, html, links, and files), see recommended drag types.
...And 3 more matches
Ajax navigation example - Web APIs
first_page.php: <?php $page_title = "first page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
...{ echo json_encode(array("page" => $page_title, "content" => ob_get_clean())); } else { ?> </div> <p>this paragraph is shown only when the navigation starts from <strong>first_page.php</strong>.</p> <?php include "include/after_content.php"; echo "</body>\n</html>"; } ?> second_page.php: <?php $page_title = "second page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
...this content is stored into a php variable.</p>"; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { echo json_encode(array("page" => $page_title, "content" => $page_content)); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
...And 3 more matches
MediaSource - Web APIs
mediasource.activesourcebuffers read only returns a sourcebufferlist object containing a subset of the sourcebuffer objects contained within mediasource.sourcebuffers — the list of objects providing the selected video track, enabled audio tracks, and shown/hidden text tracks.
... mediasource.readystate read only returns an enum representing the state of the current mediasource, whether it is not currently attached to a media element (closed), attached and ready to receive sourcebuffer objects (open), or attached but the stream has been ended via mediasource.endofstream() (ended.) mediasource.duration gets and sets the duration of the current media being presented.
... mediasource.clearliveseekablerange() clears a seekable range previously set with a call to setliveseekablerange().
...And 3 more matches
MediaTrackConstraints - Web APIs
the mediatrackconstraints dictionary is used to describe a set of capabilities and the value or values each can take on.
... a constraints dictionary is passed into applyconstraints() to allow a script to establish a set of exact (required) values or ranges and/or preferred values or ranges of values for the track, and the most recently-requested set of custom constraints can be retrieved by calling getconstraints().
... to learn more about how constraints work, see capabilities, constraints, and settings.
...And 3 more matches
MutationObserverInit - Web APIs
subtree optional set to true to extend monitoring to the entire subtree of nodes rooted at target.
... childlist optional set to true to monitor the target node (and, if subtree is true, its descendants) for the addition of new child nodes or removal of existing child nodes.
... attributes optional set to true to watch for changes to the value of attributes on the node or nodes being monitored.
...And 3 more matches
Node - Web APIs
WebAPINode
text_node 3 cdata_section_node 4 entity_reference_node 5 entity_node 6 processing_instruction_node 7 comment_node 8 document_node 9 document_type_node 10 document_fragment_node 11 notation_node 12 node.nodevalue returns / sets the value of the current node.
... node.textcontent returns / sets the textual content of an element and all its descendants.
... node.setuserdata() allows a user to attach, or remove, domuserdata to the node.
...And 3 more matches
Using the Notifications API - Web APIs
">enable notifications</button> clicking this calls the asknotificationpermission() function: function asknotificationpermission() { // function to actually ask the permissions function handlepermission(permission) { // whatever the user answers, we make sure chrome stores the information if(!('permission' in notification)) { notification.permission = permission; } // set the button to shown or hidden, depending on what the user answers if(notification.permission === 'denied' || notification.permission === 'default') { notificationbtn.style.display = 'block'; } else { notificationbtn.style.display = 'none'; } } // let's check if the browser supports notifications if (!('notification' in window)) { console.log("this browser does n...
...inside here we explicitly set the notification.permission value (some old versions of chrome failed to do this automatically), and show or hide the button depending on what the user chose in the permission dialog.
...old versions of chrome didn't remove notifications automatically so you can do so after a settimeout() only for those legacy versions in order to not remove notifications from notification trays on other browsers.
...And 3 more matches
PannerNode.coneInnerAngle - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
...it's more useful to offset the angle by -90°, which means the pannernode will point directly at the listener at 0° rotation.
...rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e.
...And 3 more matches
PannerNode.coneOuterAngle - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
...it's more useful to offset the angle by -90°, which means the pannernode will point directly at the listener at 0° rotation.
...rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e.
...And 3 more matches
PannerNode.coneOuterGain - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
...it's more useful to offset the angle by -90°, which means the pannernode will point directly at the listener at 0° rotation.
...rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e.
...And 3 more matches
PannerNode.orientationX - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
...it's more useful to offset the angle by -90°, which means the pannernode will point directly at the listener at 0° rotation.
...rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e.
...And 3 more matches
PannerNode.orientationY - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
...it's more useful to offset the angle by -90°, which means the pannernode will point directly at the listener at 0° rotation.
...rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e.
...And 3 more matches
PannerNode.orientationZ - Web APIs
the x and z components are always at a 90° to each other, so we can use the sine and cosine functions, which are offset by the same amount in radians.
...it's more useful to offset the angle by -90°, which means the pannernode will point directly at the listener at 0° rotation.
...rotation in the 'horizontal plane') to an orientation vector const yrotationtovector = degrees => { // convert degrees to radians and offset the angle so 0 points towards the listener const radians = (degrees - 90) * (math.pi / 180); // using cosine and sine here ensures the output values are always normalised // i.e.
...And 3 more matches
Multi-touch interaction - Web APIs
the pointer is a hardware-agnostic device that can target a specific set of screen coordinates.
... function set_handlers(name) { // install event handlers for the given element var el=document.getelementbyid(name); el.onpointerdown = pointerdown_handler; el.onpointermove = pointermove_handler; // use same handler for pointer{up,cancel,out,leave} events since // the semantics for these events - in this app - are the same.
... el.onpointerup = pointerup_handler; el.onpointercancel = pointerup_handler; el.onpointerout = pointerup_handler; el.onpointerleave = pointerup_handler; } function init() { set_handlers("target1"); set_handlers("target2"); set_handlers("target3"); } pointer down the pointerdown event is fired when a pointer (mouse, pen/stylus or touch point on a touchscreen) makes contact with the contact surface.
...And 3 more matches
RTCConfiguration - Web APIs
it may be passed into the constructor when instantiating a connection, or used with the rtcpeerconnection.getconfiguration() and rtcpeerconnection.setconfiguration() methods, which allow inspecting and changing the configuration while a connection is established.
... the options include ice server and transport settings and identity information.
...if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance.
...And 3 more matches
RTCPeerConnection.signalingState - Web APIs
for example, if you receive an answer while the signalingstate isn't "have-local-offer", you know that something is wrong, since you should only receive answers after creating an offer but before an answer has been received and passed into rtcpeerconnection.setlocaldescription().
... "have-local-offer" the local peer has called rtcpeerconnection.setlocaldescription(), passing in sdp representing an offer (usually created by calling rtcpeerconnection.createoffer()), and the offer has been applied successfully.
... "have-remote-offer" the remote peer has created an offer and used the signaling server to deliver it to the local peer, which has set the offer as the remote description by calling rtcpeerconnection.setremotedescription().
...And 3 more matches
RTCRtpSendParameters.encodings - Web APIs
the rtcrtpsendparameters dictionary's encodings property is an rtcrtpencodingparameters object providing configuration settings for the encoder being used for the rtcrtpsender's track.
... syntax sendparameters.encodings = encodingparameterlist; encodingparameterlist = sendparameters.encodings; value an array of objects conforming to the rtcrtpencodingparameters dictionary, each of which contains properties which provide settings and parameters that describe and configure a single codec that could be used to encode the track.
...this value can only be set when creating the transceiver; after that, this value is read only.
...And 3 more matches
Selection API - Web APIs
yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yesanchoroffset experimentalchrome full support 1edge full support 12firefox full support yesie ?
... yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yescollapsetoend experimentalchrome full support yesedge full support 12firefox full support yesie ?
... yeschrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yescollapsetostart experimentalchrome full support yesedge full support 12firefox full support yesie ?
...And 3 more matches
SourceBuffer.mode - Web APIs
WebAPISourceBuffermode
the mode value is initially set when the sourcebuffer is created using mediasource.addsourcebuffer().
... if timestamps already exist for the media segments, then the value will be set to segments; if they don't, then the value will be set to sequence.
... if you try to set the mode property value to segments when the initial value is sequence, an exception will be thrown.
...And 3 more matches
SpeechRecognition - Web APIs
speechrecognition.grammars returns and sets a collection of speechgrammar objects that represent the grammars that will be understood by the current speechrecognition.
... speechrecognition.lang returns and sets the language of the current speechrecognition.
... if not specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either.
...And 3 more matches
Text.splitText() - Web APIs
WebAPITextsplitText
the text.splittext() method breaks the text node into two nodes at the specified offset, keeping both nodes in the tree as siblings.
... after the split, the current node contains all the content up to the specified offset point, and a newly created node of the same type contains the remaining text.
...if the offset is equal to the length of the original node, the newly created node has no data.
...And 3 more matches
Visual Viewport API - Web APIs
for example, what if you need a set of image controls to remain on screen regardless of the pinch zoom level of the device?
...the object includes a set of properties describing the viewport.
...when called it queries the offsetleft and height properties for values it uses in a css translate() method.
...And 3 more matches
Adding 2D content to a WebGL context - Web APIs
together, a set of vertex and fragment shaders is called a shader program.
...that position is then multiplied by two 4x4 matrices we provide called uprojectionmatrix and umodelviewmatrix; gl_position is set to the result.
... mat4.perspective(projectionmatrix, fieldofview, aspect, znear, zfar); // set the drawing position to the "identity" point, which is // the center of the scene.
...And 3 more matches
WebGL best practices - Web APIs
set up your hot framebuffers ahead of time.
... in firefox, setting the pref webgl.perf.max-warnings to -1 in about:config will enable performance warnings that include warnings about fb completeness invalidations.
...l 2 is analogous to the approach in opengl: https://jdashg.github.io/misc/async-gpu-downloads.html function clientwaitasync(gl, sync, flags, interval_ms) { return new promise((resolve, reject) => { function test() { const res = gl.clientwaitsync(sync, flags, 0); if (res == gl.wait_failed) { reject(); return; } if (res == gl.timeout_expired) { settimeout(test, interval_ms); return; } resolve(); } test()); }); } async function getbuffersubdataasync( gl, target, buffer, srcbyteoffset, dstbuffer, /* optional */ dstoffset, /* optional */ length) { const sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.flush(); await clientwaitasync(gl, sync, 0, 10); gl.deletesync(sync); gl.bindbuffer(...
...And 3 more matches
Writing WebSocket servers - Web APIs
in many common setups, a reverse proxy has already dealt with them.
...after the handshake succeeds, you have to use a different set of codes (defined in section 7.4 of the spec).
... note: the server can send other headers like set-cookie, or ask for authentication or redirects via other status codes, before sending the reply handshake.
...And 3 more matches
Window.devicePixelRatio - Web APIs
html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); // set display size (css pixels).
... var size = 200; canvas.style.width = size + "px"; canvas.style.height = size + "px"; // set actual size in memory (scaled to account for extra pixel density).
...ctx.scale(scale, scale); ctx.fillstyle = "#bada55"; ctx.fillrect(10, 10, 300, 300); ctx.fillstyle = "#ffffff"; ctx.font = '18px arial'; ctx.textalign = 'center'; ctx.textbaseline = 'middle'; var x = size / 2; var y = size / 2; var textstring = "i love mdn"; ctx.filltext(textstring, x, y); monitoring screen resolution or zoom level changes in this example, we'll set up a media query and watch it to see when the device resolution changes, so that we can check the value of devicepixelratio to handle any updates we need to.
...And 3 more matches
Privileged features - Web APIs
minimizable this setting can only apply to dialog windows; minimizable requires dialog=yes.
...if set to no or 0, this feature removes the titlebar from the new secondary window.
... mozilla and firefox users can force new windows to always render the titlebar by setting dom.disable_window_open_feature.titlebar to true in about:config or in their user.js file.
...And 3 more matches
Window: popstate event - Web APIs
if the goal is to catch the moment when the new document state is already fully in place, a zero-delay settimeout() method call should be used to effectively put its inner callback function that does the processing at the end of the browser event loop: window.onpopstate = () => settimeout(dosomething, 0); when popstate is sent when the transition occurs, either due to the user triggering the browser's "back" button or otherwise, the popstate event is near the end of the process to transition to the...
... if current-entry's title wasn't set using one of the history api methods (pushstate() or replacestate(), set the entry's title to the string returned by its document.title attribute.
... each form control within new-entry's document that has autocomplete configured with its autofill field name set to off is reset.
...And 3 more matches
Window.scrollY - Web APIs
WebAPIWindowscrollY
example // make sure and go down to the second page if (window.scrolly) { window.scroll(0, 0); // reset the scroll position to the top left of the document.
... the pageyoffset property is an alias for the scrolly property: window.pageyoffset === window.scrolly; // always true for cross-browser compatibility, use window.pageyoffset instead of window.scrolly.
...a fully compatible example: var supportpageoffset = window.pagexoffset !== undefined; var iscss1compat = ((document.compatmode || "") === "css1compat"); var x = supportpageoffset ?
...And 3 more matches
XMLHttpRequest.response - Web APIs
the xmlhttprequest response property returns the response's body content as an arraybuffer, blob, document, javascript object, or domstring, depending on the value of the request's responsetype property.
... syntax var body = xmlhttprequest.response; value an appropriate object based on the value of responsetype.
... you may attempt to request the data be provided in a specific format by setting the value of responsetype after calling open() to initialize the request but before calling send() to send the request to the server.
...And 3 more matches
XSLTProcessor - Web APIs
the resultant object depends on the output method of the stylesheet: output method result type html htmldocument xml xmldocument text xmldocument with a single root element <transformiix:result> with the text as a child [throws] void xsltprocessor.setparameter(string namespaceuri, string localname, any value) sets a parameter in the xslt stylesheet that was imported.
... (sets the value of an <xsl:param>.) a null value for namespaceuri is treated the same as an empty string.
... [throws] void xsltprocessor.removeparameter(string namespaceuri, string localname) removes the parameter if it was previously set.
...And 3 more matches
Web APIs
WebAPI
ource eventtarget extendableevent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync fileerror fileexception filelist filereader filereadersync filerequest filesystem filesystemdirectoryentry filesystemdirectoryreader filesystementry filesystementrysync filesystemfileentry filesystemflags filesystemsync focusevent fontface fontfaceset fontfacesetloadevent formdata formdataentryvalue formdataevent fullscreenoptions g gainnode gamepad gamepadbutton gamepadevent gamepadhapticactuator geolocation geolocationcoordinates geolocationposition geolocationpositionerror geometryutils gestureevent globaleventhandlers gyroscope h htmlanchorelement htmlareaelement htmlaudioelement htmlbrelement htmlbaseelement htmlbasefontelem...
...ent htmlbodyelement htmlbuttonelement htmlcanvaselement htmlcollection htmlcontentelement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldivelement htmldocument htmlelement htmlembedelement htmlfieldsetelement htmlfontelement htmlformcontrolscollection htmlformelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement htmlinputelement htmlisindexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionel...
...deviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror mediaimage mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess mediakeysystemconfiguration mediakeys medialist mediametadata mediapositionstate mediaquerylist mediaquerylistevent mediaquerylistlistener mediarecorder mediarecordererrorevent mediasession mediasessionactiondetails mediasettingsrange mediasource mediastream mediastreamaudiodestinationnode mediastreamaudiosourcenode mediastreamaudiosourceoptions mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints merchantvalidationevent messagechannel messageevent ...
...And 3 more matches
ARIA: application role - Accessibility
in addition, a set of so-called quick navigation keys has been established over the years that allows blind users to skim through a page via a certain element type.
...to be able to interact with a web page, a standard set of widgets is recognized that, when pressing a certain key (usually the enter key) this mode is switched off.
... the application role is designed to provide a means for widgets that are not part of the standard set to be accessible for direct interaction in ats that use both browse and focus modes for interacting with web content.
...And 3 more matches
ARIA: article role - Accessibility
it is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.
...the aim of a set of article sections is to indicate their relationship to one another.
... if an article is part of a feed, it can have the aria-posinset and aria-setsize attributes set to indicate which position within the feed this particular article represents.
...And 3 more matches
ARIA: table role - Accessibility
within that container, each row has role="row" set and contains child cells.
...the aria-colindex or aria-rowindex is set to the position of a cell within the row or column, respectively.
...set the value to the total number of columns in the full table.
...And 3 more matches
Web applications and ARIA FAQ - Accessibility
var progressbar = document.getelementbyid("percent-loaded"); // set its aria roles and states, so that assistive technologies know what kind of widget it is.
... progressbar.setattribute("role", "progressbar"); progressbar.setattribute("aria-valuemin", 0); progressbar.setattribute("aria-valuemax", 100); // create a function that can be called at any time to update the value of the progress bar.
... function updateprogress(percentcomplete) { progressbar.setattribute("aria-valuenow", percentcomplete); } will adding aria change my page styles or behavior?
...And 3 more matches
Understandable - Accessibility
the simplest way to achieve this is to set the lang attribute on the page's <html> element, giving it a value equal to the language code that best represents the language the page is written in.
... see setting the primary language of the document.
...a <span> if no semantic element is available) to set an appropriate language for it.
...And 3 more matches
Using multi-column layouts - CSS: Cascading Style Sheets
the column-count property sets the number of columns to a particular number.
... </p> </div> css #col { column-count: 2; } result will display the content in two columns (if you're using a multi-column compliant browser): the column-width property sets the minimum desired column width.
... if column-count is not also set, then the browser will automatically make as many columns as fit in the available width.
...And 3 more matches
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
this means that if you have a set of flex items that are too wide for their container, they will overflow it.
...if flex-direction is set to row-reverse then the items will start from the end edge of the container and lay themselves out in reverse ordered lines.
... here i have set flex-grow and flex-shrink to 0 to make inflexible flex items and am then controlling flexibility using percentages, just like we used to do in float layouts.
...And 3 more matches
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
you can see auto-placement in action in the simplest of ways by creating a grid on a set of items.
...in this next example i have added to the layout by setting odd items to span two tracks both for rows and columns.
... i do this with the grid-column-end and grid-row-end properties and setting the value of this to span 2.
...And 3 more matches
Introducing the CSS Cascade - CSS: Cascading Style Sheets
WebCSSCascade
finally, note that @import and @charset obey specific algorithms and aren't affected by the cascade algorithm.
...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.
...And 3 more matches
clip-path - CSS: Cascading Style Sheets
WebCSSclip-path
the clip-path css property creates a clipping region that sets what part of an element should be shown.
... syntax /* keyword values */ clip-path: none; /* <clip-source> values */ clip-path: url(resources.svg#c1); /* <geometry-box> values */ clip-path: margin-box; clip-path: border-box; clip-path: padding-box; clip-path: content-box; clip-path: fill-box; clip-path: stroke-box; clip-path: view-box; /* <basic-shape> values */ clip-path: inset(100px 50px); clip-path: circle(50px at 0 100px); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); clip-path: path('m0.5,1 c0.5,1,0,0.7,0,0.3 a0.25,0.25,1,1,1,0.5,0.3 a0.25,0.25,1,1,1,1,0.3 c1,0.7,0.5,1,0.5,1 z'); /* box and shape values combined */ clip-path: padding-box circle(50px at 0 100px); /* global values */ clip-path: inherit; clip-path: initial; clip-path: unset; the clip-path...
...if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the size of the reference box is set to the width and height values of the viewbox attribute.
...And 3 more matches
column-rule - CSS: Cascading Style Sheets
the column-rule shorthand css property sets the width, style, and color of the line drawn between columns in a multi-column layout.
... it is a shorthand property that sets the individual column-rule-* properties in a single, convenient declaration: column-rule-width, column-rule-style, and column-rule-color.
... note: as with all shorthand properties, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties).
...And 3 more matches
env() - CSS: Cascading Style Sheets
WebCSSenv
to tell the browser to use the whole available space on the screen, and so enabling us to use the env() variables, we need to add a new viewport meta value: <meta name="viewport" content="viewport-fit=cover" /> body { padding: env(safe-area-inset-top, 20px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 20px) env(safe-area-inset-left, 20px); } in addition, unlike custom properties, which cannot be used outside of declarations, the env() function can be used in place of any part of a property value, or any part of a descriptor (e.g.
... originally provided by the ios browser to allow developers to place their content in a safe area of the viewport, the safe-area-inset-* values defined in the specification can be used to help ensure content is visible even to viewers using non‑rectangular displays.
... syntax /* using the four safe area inset values with no fallback values */ env(safe-area-inset-top); env(safe-area-inset-right); env(safe-area-inset-bottom); env(safe-area-inset-left); /* using them with fallback values */ env(safe-area-inset-top, 20px); env(safe-area-inset-right, 1em); env(safe-area-inset-bottom, 0.5vh); env(safe-area-inset-left, 1.4rem); values safe-area-inset-top, safe-area-inset-right, safe-area-inset-bottom, safe-area-inset-left the safe-area-inset-* variables are four environment variables that define a rectangle by its top, right, bottom, and left insets from the edge of the viewport, which is safe to put content into without risking it being cut off by the shape of a non‑rectangular display.
...And 3 more matches
drop-shadow() - CSS: Cascading Style Sheets
a drop shadow is effectively a blurred, offset version of the input image's alpha mask, drawn in a specific color and composited below the image.
... syntax drop-shadow(offset-x offset-y blur-radius color) the drop-shadow() function accepts a parameter of type <shadow> (defined in the box-shadow property), with the exception that the inset keyword and spread parameters are not allowed.
... parameters offset-x offset-y (required) two <length> values that determine the shadow offset.
...And 3 more matches
line-height - CSS: Cascading Style Sheets
the line-height css property sets the height of a line box.
... it's commonly used to set the distance between lines of text.
... syntax /* keyword value */ line-height: normal; /* unitless values: use this number multiplied by the element's font size */ line-height: 3.5; /* <length> values */ line-height: 3em; /* <percentage> values */ line-height: 34%; /* global values */ line-height: inherit; line-height: initial; line-height: unset; the line-height property is specified as any one of the following: a <number> a <length> a <percentage> the keyword normal.
...And 3 more matches
mask-image - CSS: Cascading Style Sheets
the mask-image css property sets the image that is used as mask layer for an element.
... mask-image: none; /* <mask-source> value */ mask-image: url(masks.svg#mask1); /* <image> values */ mask-image: linear-gradient(rgba(0, 0, 0, 1.0), transparent); mask-image: image(url(mask.png), skyblue); /* multiple values */ mask-image: image(url(mask.png), skyblue), linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* global values */ mask-image: inherit; mask-image: initial; mask-image: unset; syntax values none this keyword is interpreted as a transparent black image layer.
... formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax <mask-reference>#where <mask-reference> = none | <image> | <mask-source>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient><mask-source> = <url>where <image()> = image( <image-tags>?
...And 3 more matches
mask-position - CSS: Cascading Style Sheets
the mask-position css property sets the initial position, relative to the mask position layer set by mask-origin, for each defined mask image.
... /* keyword values */ mask-position: top; mask-position: bottom; mask-position: left; mask-position: right; mask-position: center; /* <position> values */ mask-position: 25% 75%; mask-position: 0px 0px; mask-position: 10% 8em; /* multiple values */ mask-position: top right; mask-position: 1rem 1rem, center; /* global values */ mask-position: inherit; mask-position: initial; mask-position: unset; syntax one or more <position> values, separated by commas.
...relative or absolute offsets can be given.
...And 3 more matches
max-block-size - CSS: Cascading Style Sheets
this is useful because the max-width is always used for horizontal sizes and max-height is always used for vertical sizes, and if you need to set lengths based on the size of your text content, you need to be able to do so with the writing direction in mind.
... 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).
... syntax /* <length> values */ max-block-size: 300px; max-block-size: 25em; /* <percentage> values */ max-block-size: 75%; /* keyword values */ max-block-size: auto; max-block-size: max-content; max-block-size: min-content; max-block-size: fit-content(20em); /* global values */ max-block-size: inherit; max-block-size: initial; max-block-size: unset; values the max-block-size property's value can be any value that's legal for the max-width and max-height properties: <length> defines the max-width as an absolute value.
...And 3 more matches
overscroll-behavior-block - CSS: Cascading Style Sheets
the overscroll-behavior-block css property sets the browser's behavior when the block direction boundary of a scrolling area is reached.
... /* keyword values */ overscroll-behavior-block: auto; /* default */ overscroll-behavior-block: contain; overscroll-behavior-block: none; /* global values */ overscroll-behavior-block: inherit; overscroll-behavior-block: initial; overscroll-behavior-block: unset; syntax the overscroll-behavior-block property is specified as a keyword chosen from the list of values below.
... contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
...And 3 more matches
overscroll-behavior-inline - CSS: Cascading Style Sheets
the overscroll-behavior-inline css property sets the browser's behavior when the inline direction boundary of a scrolling area is reached.
... /* keyword values */ overscroll-behavior-inline: auto; /* default */ overscroll-behavior-inline: contain; overscroll-behavior-inline: none; /* global values */ overscroll-behavior-inline: inherit; overscroll-behavior-inline: initial; overscroll-behavior-inline: unset; syntax the overscroll-behavior-inline property is specified as a keyword chosen from the list of values below.
... contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
...And 3 more matches
overscroll-behavior-x - CSS: Cascading Style Sheets
the overscroll-behavior-x css property sets the browser's behavior when the horizontal boundary of a scrolling area is reached.
... /* keyword values */ overscroll-behavior-x: auto; /* default */ overscroll-behavior-x: contain; overscroll-behavior-x: none; /* global values */ overscroll-behavior-x: inherit; overscroll-behavior-x: initial; overscroll-behavior-x: unset; syntax the overscroll-behavior-x property is specified as a keyword chosen from the list of values below.
... contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
...And 3 more matches
scroll-margin-inline - CSS: Cascading Style Sheets
the scroll-margin-inline shorthand property sets the scroll margins of an element in the inline dimension.
... constituent properties this property is a shorthand for the following css properties: scroll-margin-inline-end scroll-margin-inline-start syntax /* <length> values */ scroll-margin-inline: 10px; scroll-margin-inline: 1em .5em ; /* global values */ scroll-margin-inline: inherit; scroll-margin-inline: initial; scroll-margin-inline: unset; values <length> an outset from the corresponding edge of the scroll container.
... description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport.
...And 3 more matches
scroll-margin - CSS: Cascading Style Sheets
the scroll-margin shorthand property sets all of the scroll margins of an element at once, assigning values much like the margin property does for margins of an element.
... constituent properties this property is a shorthand for the following css properties: scroll-margin-bottom scroll-margin-left scroll-margin-right scroll-margin-top syntax /* <length> values */ scroll-margin: 10px; scroll-margin: 1em .5em 1em 1em; /* global values */ scroll-margin: inherit; scroll-margin: initial; scroll-margin: unset; values <length> an outset from the corresponding edge of the scroll container.
... thus, the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport.
...And 3 more matches
transition-duration - CSS: Cascading Style Sheets
the transition-duration css property sets the length of time a transition animation should take to complete.
... syntax /* <time> values */ transition-duration: 6s; transition-duration: 120ms; transition-duration: 1s, 15s; transition-duration: 10s, 30s, 230ms; /* global values */ transition-duration: inherit; transition-duration: initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take.
...eight background-color font-size left top transform -webkit-transformv color; transition-duration:0.5s; transition-timing-function: ease-in-out; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-duration: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top -web...
...And 3 more matches
EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes exslt is a set of extensions to xslt.
...sted below: common (exsl)the exslt common package provides basic functions that expand upon the capabilities of xslt.math (math)the exslt math package provides functions for working with numeric values and comparing nodes.regular expressions (regexp)the exslt regular expressions package provides functions that allow testing, matching, and replacing text using javascript style regular expressions.sets (set)the exslt sets package offers functions that let you perform set manipulation.strings (str)the exslt strings package provides functions that allow the manipulation of strings.
... functions exsl:node-set() exsl:object-type() math the exslt math package provides functions for working with numeric values and comparing nodes.
...And 3 more matches
Event reference
form events event name fired when reset the reset button is pressed submit the submit button is pressed printing events event name fired when beforeprint the print dialog is opened afterprint the print dialog is closed text composition events event name fired when compositionstart the composition of a passage of text is prepared (...
... timeout progression is terminated due to preset time expiring.
... reset event dom l2, html5 a form is reset.
...And 3 more matches
Content categories - Developer guides
main content categories metadata content elements belonging to the metadata content category modify the presentation or the behavior of the rest of the document, set up links to other documents, or convey other out of band information.
...they are: <a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hgroup>, <hr>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <keygen>, <label>, <main>, <map>, <mark>, <math>, <menu>, <meter>, <nav>, <noscript>, <object>, <ol>, <output>, <p>, <picture>, <pre>, <progress>, <q>, <ruby>, <s>, <samp>, <script>, <section>, <select>, <small>, <span>, <strong>, <sub>, <sup>, <svg>, <table>, ...
... <button> <fieldset> <input> <keygen> <label> <meter> <object> <output> <progress> <select> <textarea> this category contains several sub-categories: listed elements that are listed in the form.elements and fieldset.elements idl collections.
...And 3 more matches
HTML attribute: crossorigin - HTML: Hypertext Markup Language
depending on the element, the attribute can be a cors settings attribute.
... the crossorigin content attribute on media elements is a cors settings attribute.
... these attributes are enumerated, and have the following possible values: keyword description anonymous cors requests for this element will have the credentials flag set to 'same-origin'.
...And 3 more matches
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
the type of relationships is given by the value of the rel attribute, which, if present, must have a value that is an unordered set of unique space-separated keywords, which are listed in the following table.
... not allowed link not allowed the rel attribute is relevant to the <link>, <a>, <area>, and <form> elements, but some values only relevant to a subset of those elements.
... modulepreload useful for improved performance, and relevant to the <link> anywhere in the document, setting rel="modulepreload" tells the browser to preemptively fetch the script (and dependencies) and store it in the document's module map for later evaluation.
...And 3 more matches
<colgroup> - HTML: Hypertext Markup Language
WebHTMLElementcolgroup
possible values are: left, aligning the content to the left of the cell center, centering the content in the cell right, aligning the content to the right of the cell justify, inserting spaces into the textual content so that the content is justified in the cell char, aligning the textual content on a special character with a minimal offset, defined by the char and charoff attributes.
... if this attribute is not set, the left value is assumed.
... note: do not try to set the text-align property on a selector giving a <colgroup> element.
...And 3 more matches
Link types - HTML: Hypertext Markup Language
if the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed.
... 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.
... <a>, <area>, <form> <link> noopener instructs the browser to open the link without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null).
...And 3 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
a simple example might look like this (see our js and css example source, and also live): <head> <meta charset="utf-8"> <title>js and css preload example</title> <link rel="preload" href="style.css" as="style"> <link rel="preload" href="main.js" as="script"> <link rel="stylesheet" href="style.css"> </head> <body> <h1>bouncing balls</h1> <canvas></canvas> <script src="main.js" defer></script> </body> here we preload our css and javascript files so they will be available as soon as they a...
... set the correct accept request headers for it.
... you can see an example of this in our video example (see the full source code, and also the live version): <head> <meta charset="utf-8"> <title>video preload example</title> <link rel="preload" href="sintel-short.mp4" as="video" type="video/mp4"> <link rel="preload" href="sintel-short.webm" as="video" type="video/webm"> </head> <body> <video controls> <source src="sintel-short.mp4" type="video/mp4"> <source src="sintel-short.webm" type="video/webm"> <p>your browser doesn't support html5 video.
...And 3 more matches
Reason: CORS header 'Access-Control-Allow-Origin' missing - HTTP
if the server is under your control, add the origin of the requesting site to the set of domains permitted access by adding it to the access-control-allow-origin header's value.
...private apis should never use *, and should instead have a specific domain or domains set.
... in addition, the wildcard only works for requests made with the crossorigin attribute set to anonymous, and it prevents sending credentials like cookies in requests.
...And 3 more matches
Proxy Auto-Configuration (PAC) file - HTTP
in chrome (versions 52 to 73), you can disable this by setting pachttpsurlstrippingenabled to false in policy or by launching with the --unsafe-pac-url command-line flag (in chrome 74, only the flag works, and from 75 onward, there is no way to disable path-stripping; as of chrome 81, path-stripping does not apply to http urls, but there is interest in changing this behavior to match https); in firefox, the preference is network.proxy.autoconfig_url.incl...
...ed proxy should be used socks host:port the specified socks server should be used recent versions of firefox support as well: http host:port the specified proxy should be used https host:port the specified https proxy should be used socks4 host:port socks5 host:port the specified socks server (with the specified sock version) should be used if there are multiple semicolon-separated settings, the left-most setting will be used, until firefox fails to establish the connection to the proxy.
... the auto-config file should be saved to a file with a .pac filename extension: proxy.pac and the mime type should be set to: application/x-ns-proxy-autoconfig next, you should configure your server to map the .pac filename extension to the mime type.
...And 3 more matches
HTTP Public Key Pinning (HPKP) - HTTP
extracting the base64 encoded public key information note: while the example below shows how to set a pin on a server certificate, it is recommended to place the pin on the intermediate certificate of the ca that issued the server certificate, to ease certificates renewals and rotations.
... setting up your webserver to include the hpkp header the concrete steps necessary to deliver the hpkp header depend on the web server you use.
...it is advised to verify that this setup will work for your server.
...And 3 more matches
Concurrency model and the event loop - JavaScript
the function settimeout is called with 2 arguments: a message to add to the queue, and a time value (optional; defaults to 0).
...however, if there are messages, the settimeout message will have to wait for other messages to be processed.
... here is an example that demonstrates this concept (settimeout does not run immediately after its timer expires): const s = new date().getseconds(); settimeout(function() { // prints out "2", meaning that the callback is not called immediately after 500 milliseconds.
...And 3 more matches
Groups and ranges - JavaScript
[xyz] [a-c] a character set.
...you can specify a range of characters by using a hyphen, but if the hyphen appears as the first or last character enclosed in the square brackets it is taken as a literal hyphen to be included in the character set as a normal character.
... it is also possible to include a character class in a character set.
...And 3 more matches
InternalError: too much recursion - JavaScript
function loop(x) { if (x >= 10) // "x >= 10" is the exit condition return; // do stuff loop(x + 1); // the recursive call } loop(0); setting this condition to an extremely high value, won't work: function loop(x) { if (x >= 1000000000000) return; // do stuff loop(x + 1); } loop(0); // internalerror: too much recursion this recursive function is missing a base case.
... function loop(x) { // the base case is missing loop(x + 1); // recursive call } loop(0); // internalerror: too much recursion class error: too much recursion class person{ constructor(){} set name(name){ this.name = name; // recursive call } } const tony = new person(); tony.name = "tonisha"; // internalerror: too much recursion when a value is assigned to the property name (this.name = name;) javascript needs to set that property.
... when this happens, the setter function is triggered.
...And 3 more matches
Default parameters - JavaScript
however, it's often useful to set a different default value.
... in the past, the general strategy for setting defaults was to test parameter values in the function body and assign a value if they are undefined.
... to guard against this, something like the second line would be used, where b is set to 1 if multiply is called with only one argument: function multiply(a, b) { b = (typeof b !== 'undefined') ?
...And 3 more matches
Promise.race() - JavaScript
description the race function returns a promise that is settled the same way (and takes the same value) as the first promise that settles amongst the promises of the iterable passed as an argument.
... if the iterable contains one or more non-promise value and/or an already settled promise, then promise.race will resolve to the first of these values found in the iterable.
...ty of promise.race this following example demonstrates the asynchronicity of promise.race: // we are passing as argument an array of promises that are already resolved, // to trigger promise.race as soon as possible var resolvedpromisesarray = [promise.resolve(33), promise.resolve(44)]; var p = promise.race(resolvedpromisesarray); // immediately logging the value of p console.log(p); // using settimeout we can execute code after the stack is empty settimeout(function(){ console.log('the stack is now empty'); console.log(p); }); // logs, in order: // promise { <state>: "pending" } // the stack is now empty // promise { <state>: "fulfilled", <value>: 33 } an empty iterable causes the returned promise to be forever pending: var foreverpendingpromise = promise.race([]); console.log...
...And 3 more matches
async function - JavaScript
async function foo() { const result1 = await new promise((resolve) => settimeout(() => resolve('1'))) const result2 = await new promise((resolve) => settimeout(() => resolve('2'))) } foo() note how the promise chain is not built-up in one go.
... async function foo() { const p1 = new promise((resolve) => settimeout(() => resolve('1'), 1000)) const p2 = new promise((_,reject) => settimeout(() => reject('2'), 500)) const results = [await p1, await p2] // do not do this!
... use promise.all or promise.allsettled instead.
...And 3 more matches
<mstyle> - MathML
WebMathMLElementmstyle
displaystyle a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas.
... the main effect is that larger versions of operators are displayed, when displaystyle is set to true.
... lspace or voffset do not apply to <mpadded>.
...And 3 more matches
Critical rendering path - Web Performance
some requests are blocking, which means the parsing of the rest of the html is halted until the imported asset is handled.
...if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree.
... css has its own set of rules for identifying valid tokens.
...And 3 more matches
Web Performance
to understand how to improve performance and perceived performance, it helps to understand how the browser works.recommended web performance timings: how long is too long?there are no clear set rules as to what constitutes a slow pace when loading pages, but there are specific guidelines for indicating content will load (1 second), idling (50ms), animating (16.7s) and responding to user input (50 to 200ms).the business case for web performanceyou know web performance is important, but how do you convince clients and management to invest in performance and make it a priority.
...in this article, we'll covers methods for getting your font files as small as possible with efficient file formats and sub setting.
...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.
...And 3 more matches
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
one can override default browser behaviors with the evt.preventdefault( ) method, add eventlisteners to objects with the syntax element.addeventlistener(event, function, usecapture), and set element properties with syntax svgelement.style.setproperty("fill-opacity", "0.0", "").
... note the existence of all three arguments setting properties.
... function myrect(x,y,w,h,message){ this.message=message this.rect=document.createelementns("http://www.w3.org/2000/svg","rect") this.rect.setattributens(null,"x",x) this.rect.setattributens(null,"y",y) this.rect.setattributens(null,"width",w) this.rect.setattributens(null,"height",h) document.documentelement.appendchild(this.rect) this.rect.addeventlistener("click",this,false) this.handleevent= function(evt){ switch (evt.type){ case "click": alert(this.message) break; } } } inter-document scripting...
...And 3 more matches
Filter effects - SVG: Scalable Vector Graphics
to apply your created filter on a graphic element, you set the filter attribute.
... <svg width="250" viewbox="0 0 200 85" xmlns="http://www.w3.org/2000/svg" version="1.1"> <defs> <!-- filter declaration --> <filter id="myfilter" filterunits="userspaceonuse" x="0" y="0" width="200" height="120"> <!-- offsetblur --> <fegaussianblur in="sourcealpha" stddeviation="4" result="blur"/> <feoffset in="blur" dx="4" dy="4" result="offsetblur"/> <!-- litpaint --> <fespecularlighting in="blur" surfacescale="5" specularconstant=".75" specularexponent="20" lighting-color="#bbbbbb" result="specout"> <fepointlight x="-5000" y="-10000" z="20000"/> </fespecularlighting> <fecomposite in="specout" in2="sourcealpha" operator="in" result="specout"/> ...
... <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0" result="litpaint"/> <!-- merge offsetblur + litpaint --> <femerge> <femergenode in="offsetblur"/> <femergenode in="litpaint"/> </femerge> </filter> </defs> <!-- graphic elements --> <g filter="url(#myfilter)"> <path fill="none" stroke="#d90000" stroke-width="10" d="m50,66 c-50,0 -50,-60 0,-60 h100 c50,0 50,60 0,60z" /> <path fill="#d90000" d="m60,56 c-30,0 -30,-40 0,-40 h80 c30,0 30,40 0,40z" /> <g fill="#ffffff" stroke="black" font-size="45" font-family="verdana" > <text x="52" y="52">svg</text> </g> </g> </svg> step 1 <fegaussianblur in="sourcealpha" std...
...And 3 more matches
SVG In HTML Introduction - SVG: Scalable Vector Graphics
source here is the source to the example: <html> <head> <title>xtech svg demo</title> <style> stop.begin { stop-color:yellow; } stop.end { stop-color:green; } body.invalid stop.end { stop-color:red; } #err { display:none; } body.invalid #err { display:inline; } </style> <script> function signalerror() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerro...
...r();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offset="100%"/> </lineargradient> <rect x="0" y="0" width="100" height="100" style="fill:url(#gradient)" /> <circle cx="50" cy="50" r="30" style="fill:url(#gradient)" /> </svg> </body> </html> discussion the page is mainly regular html, css and javascript.
...the gradient color stops have their colors set by css.
...And 3 more matches
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
setting font properties an essential part of a text is the font in which it is displayed.
... svg offers a set of attributes, many similar to their css counterparts, to enable font selection.
... each of the following properties can be set as an attribute or via a css declaration: font-family, font-style, font-weight, font-variant, font-stretch, font-size, font-size-adjust, kerning, letter-spacing, word-spacing and text-decoration.
...And 3 more matches
Subdomain takeovers - Web security
if an attacker can do this, they can potentially read cookies set from the main domain, perform cross-site scripting, or circumvent content security policies, thereby enabling them to capture protected information (including logins) or send malicious content to unsuspecting users.
... during provisioning an attacker sets up a virtual host for a subdomain name you bought on the hosting provider, before you get to do it.
... you set up dns records to direct browsers that want to access blog.example.com so that they go to the virtual host.
...And 3 more matches
id - XPath
WebXPathFunctionsid
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the id function finds nodes matching the given ids and returns a node-set containing the identified nodes.
... syntax id(expression ) arguments expression if expression is a node-set, then the string value of each node in the node-set is treated as an individual id.
... the returned node set is the nodes corresponding to those ids.
...And 3 more matches
Content Scripts - Archive of obsolete content
the contentscript option treats the string itself as a script: // main.js var pagemod = require("sdk/page-mod"); var contentscriptvalue = 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";'; pagemod.pagemod({ include: "*.mozilla.org", contentscript: contentscriptvalue }); the contentscriptfile option treats the string as a resource:// url pointing to a script file stored in your add-on's data directory.
... this add-on supplies a url pointing to the file "content-script.js", located in the data subdirectory under the add-on's root directory: // main.js var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: data.url("content-script.js") }); // content-script.js document.body.innerhtml = "<h1>page matches ruleset</h1>"; from firefox 34 onwards, you can use "./content-script.js" as an alias for self.data.url("content-script.js").
...this enables you to load a javascript library like jquery by url, then pass in a simple script inline that can use jquery: // main.js var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); var contentscriptstring = '$("body").html("<h1>page matches ruleset</h1>");'; pagemod.pagemod({ include: "*.mozilla.org", contentscript: contentscriptstring, contentscriptfile: data.url("jquery.js") }); unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo.
...And 2 more matches
base64 - Archive of obsolete content
var base64 = require("sdk/base64"); var encodeddata = base64.encode("hello, world"); var decodeddata = base64.decode(encodeddata); globals functions encode(data, charset) creates a base-64 encoded ascii string from a string of binary data.
... parameters data : string the data to encode charset : string the charset of the string to encode (optional).
...in order to encode and decode unicode strings, the charset parameter needs to be set: var base64 = require("sdk/base64"); var encodeddata = base64.encode(unicodestring, "utf-8"); returns string : the encoded string decode(data, charset) decodes a string of data which has been encoded using base-64 encoding.
...And 2 more matches
request - Archive of obsolete content
the constructor takes a single parameter options which is used to set several properties on the resulting request.
...this explicitly sets the content-type header.
...to force the response to be interpreted as latin-1, use overridemimetype: var request = require("sdk/request").request; var quijote = request({ url: "http://www.latin1files.org/quijote.txt", overridemimetype: "text/plain; charset=latin1", oncomplete: function (response) { console.log(response.text); } }); quijote.get(); anonymous boolean if true, the request will be sent without cookies or authentication headers.
...And 2 more matches
tabs - Archive of obsolete content
tivate", logdeactivate); tab.on("close", logclose); } function logshow(tab) { console.log(tab.url + " is loaded"); } function logactivate(tab) { console.log(tab.url + " is activated"); } function logdeactivate(tab) { console.log(tab.url + " is deactivated"); } function logclose(tab) { console.log(tab.url + " is closed"); } tabs.on('open', onopen); manipulate a tab you can get and set various properties of tabs (but note that properties relating to the tab's content, such as the url, will not contain valid values until after the tab's ready event fires).
... by setting the url property you can load a new page in the tab: var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { tab.url = "http://www.example.com"; }); run scripts in a tab you can attach a content script to the page hosted in a tab, and use that to access and manipulate the page's content (see the modifying the page hosted by a tab tutorial): var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { var worker = tab.attach({ contentscript: 'self.port.emit("html", document.body.innerhtml);' }); worker.port.on("html", function(message) { console.log(message) }) }); note that tab.attach is tab-centric: if the user navigates to a new page in the same tab, then the worker and content scripts will be reattached to the new page.
... title the title of the tab (usually the title of the page currently loaded in the tab) this property can be set to change the tab title.
...And 2 more matches
lang/functional - Archive of obsolete content
this is similar to calling settimeout with no wait (i.e.
... settimeout(function () { ...
... delay(fn, ms, arguments) much like settimeout, delay invokes a function after waiting a set number of milliseconds.
...And 2 more matches
Modifying Web Pages Based on URL - Archive of obsolete content
script option and url pattern is given as include option is as follows: // import the page-mod api var pagemod = require("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); do as follows: create a new directory and navigate to it.
... $("body").html("<h1>page matches ruleset</h1>"); then download jquery to add-on's data directory, and load the script and jquery together (making sure to load jquery first).
...port the page-mod api var pagemod = require("sdk/page-mod"); // import the self api var self = require("sdk/self"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: self.data.url("jquery-1.7.min.js"), contentscript: '$("body").html("<h1>page matches ruleset</h1>");' }); note, though, that you can't load a script from a web site.
...And 2 more matches
Localization - Archive of obsolete content
o.show(); } }); var hello = require("sdk/panel").panel({ height: 75, width: 150, contenturl: require("sdk/self").data.url("my-panel.html") }); given locale files for "en-us" and "fr" which provide translations of hello_id, the panel will now display "hello!" or "bonjour !", according to the current locale: the translation is inserted into the node which has the data-l10n-id attribute set.
...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 you...
... now when the browser's locale is set to "en-us", users see this in the add-ons manager: when the browser's locale is set to "fr", they see this: the menulist and the radio preference types have options.
...And 2 more matches
Extension Versioning, Update and Compatibility - Archive of obsolete content
simply create the boolean preference extensions.checkcompatibility and set it to false.
...the problem is because of mime type that should be set in the server for xhtml extension.
... <em:updatehash>sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6</em:updatehash> note: the value of updatehash, must start with the string of hashing algorithm, it is a common error to delete this prefix, when setting new value to updatehash:sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6 when a hash is specified the downloaded file is compared with the hash and an error shown if it does not match.
...And 2 more matches
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
so, if we were to use fuel, we can do the following in the init function: init : function() { let firstrunpref = "extensions.xulschoolhello.firstrundone"; if (!application.prefs.getvalue(firstrunpref, false)) { application.prefs.setvalue(firstrunpref, true); // all the rest of the first run code goes here.
...keep in mind that the user could have set multiple firefox windows to open at startup, so there's a race condition on which window will run the first run code.
...if an add-on is uninstalled and later installed again, it might be desirable for preferences and other settings to be kept.
...And 2 more matches
Connecting to Remote Content - Archive of obsolete content
let url = "http://www.example.com/"; let request = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"] .createinstance(components.interfaces.nsixmlhttprequest); request.onload = function(aevent) { window.alert("response text: " + aevent.target.responsetext); }; request.onerror = function(aevent) { window.alert("error status: " + aevent.target.status); }; request.open("get", url, true); request.send(null); in this example we demonstrate how to make a xmlhttprequest call in asynchronous mode.
...in the onload callback function, the responsetext parameter contains the server response as text.
...sending a post request requires you to set the content type of the request and to pass the post data to the send() method as below.
...And 2 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
parse element namespace prefix (if none exists, default to defaultnamespace), and create element var elemns = namespace(elemnameorarray); var elem = doc.createelementns(elemns.namespace || jsontodom.defaultnamespace, elemns.shortname); // set element's attributes and/or callback functions (eg.
...they're not in any namespace) elem.setattributens(attrns.namespace || "", attrns.shortname, val); } } // create and append this element's children var childelems = array.slice(arguments, 2); childelems.foreach(function(childelem) { if (childelem != null) { elem.appendchild( childelem instanceof doc.defaultview.node ?
... ["div", {}, ["a", { href: href, key: "link", onclick: function (event) { alert(event.target.href); } }, text], ["span", { class: "stuff" }, "stuff"]]], document, nodes)); alert(nodes.link); function addentrytopopup(menupopup, doc, chromewindow) { var newitem = doc.createelement("menuitem"); newitem.setattribute("value", "testvalue"); newitem.setattribute("label", "another popup menu item"); menupopup.appendchild(newitem); }; var jsontemplatebtn = ["xul:toolbarbutton", { id: "mytestbutton", class: "toolbarbutton-1", type: "menu", label: "test button label", tooltiptext: "test button tooltip", removable: ...
...And 2 more matches
The Box Model - Archive of obsolete content
if you want an element to be flexible, you should set its flexibility to 1.
...using the former allows the ui to scale proportionately depending on font size settings, which are often changed by users with accessibility limitations.
...in order to have wrapping descriptions, you need to set the text as a child node instead of using the value attribute: <description>&xulschoolhello.description.label;</description> even then, the text will extend as much as it can in a single line, so you need to add some css limits in order to make it wrap inside a xul dialog or window.
...And 2 more matches
Tabbed browser - Archive of obsolete content
here you should find a set of useful code snippets to help you work with firefox's tabbed browser.
...var url = "https://developer.mozilla.org"; var tab = gbrowser.addtab(null, {relatedtocurrent: true}); gsessionstore.settabstate(tab, json.stringify({ entries: [ { title: url } ], usertypedvalue: url, usertypedclear: 2, lastaccessed: tab.lastaccessed, index: 1, hidden: false, attributes: {}, image: null })); reusing tabs rather than open a new browser or new tab each and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired url--if...
... var browserenumerator = wm.getenumerator("navigator:browser"); var tabbrowser = browserenumerator.getnext().gbrowser; // create tab var newtab = tabbrowser.addtab(url); newtab.setattribute(attrname, "xyz"); // focus tab tabbrowser.selectedtab = newtab; // focus *this* browser window in case another one is currently focused tabbrowser.ownerdocument.defaultview.focus(); } } the function can be called like so: openandreuseonetabperattribute("myextension-myattribute", "http://developer.mozilla.org/").
...And 2 more matches
XUL user interfaces - Archive of obsolete content
sabled="true"/> <label class="day" value="friday" disabled="true"/> <label class="day" value="saturday" disabled="true"/> </hbox> </row> </rows> </grid> <hbox class="buttons"> <button id="clear" label="clear" accesskey="c" oncommand="cleardate();"/> <button id="today" label="today" accesskey="t" oncommand="settoday();"/> </hbox> </groupbox> <statusbar> <statusbarpanel id="status"/> </statusbar> </vbox> </window> make a new css file, style7.css.
...m; } .demo-group .buttons { -moz-box-pack: end; } /* the day-of-week labels */ .day { margin-left: 1em; } .day[disabled] { color: #777; } .day:first-child { margin-left: 4px; } /* the left column labels */ .text-prompt { padding-top: .25em; } /* the date input box */ #date-text { max-width: 8em; } /* the status bar */ statusbar { width: 100%; border: 1px inset -moz-dialog; margin: 4px; padding: 0px 4px; } #status { padding: 4px; } #status[warning] { color: red; } make a new text file, script7.js.
... copy and paste the content from here, making sure that you scroll to get all of it: // xul demonstration var datebox, daybox, currentday, status; // elements // called by window onload function init() { datebox = document.getelementbyid("date-text") daybox = document.getelementbyid("day-box") status = document.getelementbyid("status") settoday(); } // called by clear button function cleardate() { datebox.value = "" refresh() } // called by today button function settoday() { var d = new date() datebox.value = (d.getmonth() + 1) + "/" + d.getdate() + "/" + d.getfullyear() refresh() } // called by date textbox function refresh() { var d = datebox.value var thedate = null showstatus(null) if (d != "") { try { var a = d.split("/") va...
...And 2 more matches
Creating a Web based tone generator - Archive of obsolete content
this function is called at a certain interval through the setinterval() function.
...the function mozcurrentsampleoffset() is used to know the position of the samples being played so that we can fill a 500 ms buffer of audio samples.
... var audio = new audio(); audio.mozsetup(1, samplerate); var currentwriteposition = 0; var prebuffersize = samplerate / 2; // buffer 500ms var tail = null; // the function called with regular interval to populate // the audio output buffer.
...And 2 more matches
Notes on HTML Reflow - Archive of obsolete content
a frame is rectangular, with width, height, and an offset from the parent frame that contains it.
...for example, a <div> with a constrained width (e.g., set via the css width property) would note this in the reflow state object before flowing its children.
...a frame that decides it needs a dirty reflow sets the ns_frame_is_dirty state bit on itself, and then calls the reflowdirtychild method on its parent frame.
...And 2 more matches
Dehydra Function Reference - Archive of obsolete content
msg is a string to output to customize the location info printed set this._loc before calling print() include(file [, namespace]) include a javascript file into a namespace.
...include example include("map.js") // includes map.js into toplevel var map = {} include("map.js", map) // includes map.js into the map object require({version:, strict:, werror:, gczeal:}) require is used to set runtime execution flags.
... version integer: this sets js version similar to version() in js 1.7.
...And 2 more matches
Creating a Help Content Pack - Archive of obsolete content
a content pack is a packaged set of files that describe help content.
...fine another rdf:li element like so: <rdf:li> <rdf:description nc:panelid="search" nc:datasources="" nc:emptysearchtext="[no matching items found.]" nc:emptysearchlink="chrome://foo/locale/bar.html"/> </rdf:li> nc:panelid should be set to search.
... nc:datasources should be set as with table of contents, index, and glossary definitions.
...And 2 more matches
Microsummary XML grammar reference - Archive of obsolete content
<pages> (required) identifies the set of pages that the generator is able to summarize.
... the <pages> element the <pages> element identifies the set of pages that the generator is able to summarize.
...the <include> element the <include> element identifies a set of pages that the generator is able to summarize.
...And 2 more matches
Hacking wiki - Archive of obsolete content
for anonymous access use: svn co http://svn.mozilla.org/projects/deve...lla.org/trunk/ to see the skins properly, you'll need to also check out <tt>mozilla-org/css</tt> to get the css files needed: export cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/www cvs login cvs co mozilla-org/css (when prompted to enter a password, type <tt>anonymous</tt>) setting up copy the contents of the <tt>trunk</tt> folder and the <tt>css</tt> folder (note: the folder itself) into the <tt>www</tt> directory on your server.
...once you're done with the configuration script, copy the <tt>config/localsettings.php</tt> file it created to the parent directory and navigate to the location you installed mediawiki to.
...you can enable them by adding include("extensions/exampleext.php"); to the end of your <tt>localsettings.php</tt>.
...And 2 more matches
Remotely debugging Firefox for Metro - Archive of obsolete content
set up firefox for metro go to about:config in firefox for metro, and set the following required preference: devtools.debugger.remote-enabled = true you may also want to set these optional preferences: devtools.debugger.force-local = false (if you want to connect from a different machine over the network) devtools.debugger.remote-host (to change the tcp hostname where firefox will listen fo...
... this can be a security risk, especially if you also set the force-local preference to false.) set up firefox for desktop on the desktop, remote debugging is enabled by a setting in the toolbox.
... open the toolbox, click the "settings" button in the toolbar, and check "enable remote debugging" in the settings tab.
...And 2 more matches
Merging TraceMonkey Repo - Archive of obsolete content
otherwise, you can run hg parents filename to find the changesets which may have contributed to the conflict.
... inspecting the files at those two changesets can be helpful: hg cat -c changeset filename once all the conflict markers are removed, you've performed the manual resolution, which you tell to mercurial by running hg resolve -m filename.
...for each bug in the results, find the corresponding changesets that we just merged (i.e.
...And 2 more matches
Supporting private browsing mode - Archive of obsolete content
var pbs = components.classes["@mozilla.org/privatebrowsing;1"] .getservice(components.interfaces.nsiprivatebrowsingservice); var oldprivatemode = pbs.privatebrowsingmode; pbs.privatebrowsingenabled = true; /* this is all private */ pbs.privatebrowsingenabled = oldprivatemode; in this example, we save the current state of the private browsing mode setting in the oldprivatemode variable, then turn on private browsing by setting its value to true.
... from that point until we restore the original value of the private browsing mode setting, things are done privately.
...itprivatebrowsing" in this._watcher) { this.watcher.onexitprivatebrowsing(); } } } else if (atopic == "quit-application") { this._os.removeobserver(this, "quit-application"); this._os.removeobserver(this, "private-browsing"); } }, get inprivatebrowsing() { return this._inprivatebrowsing; }, get watcher() { return this._watcher; }, set watcher(val) { this._watcher = val; } }; of special note is the fact that this helper object is designed to not break on versions of firefox without private browsing support (those prior to firefox 3.5).
...And 2 more matches
URIs and URLs - Archive of obsolete content
mantic interpretation of common syntactic conventions across different types of resource identifiers; it allows introduction of new types of resource identifiers without interfering with the way that existing identifiers are used; and, it allows the identifiers to be reused in many different contexts, thus permitting new applications or protocols to leverage a pre-existing, large, and widely-used set of resource identifiers.
...the resource is the conceptual mapping to an entity or set of entities, not necessarily the entity which corresponds to that mapping at any particular instance in time.
...the term "uniform resource locator" (url) refers to the subset of uri that identify resources via a representation of their primary access mechanism (e.g., their network "location"), rather than identifying the resource by name or by some other attribute(s) of that resource.
...And 2 more matches
Using gdb on wimpy computers - Archive of obsolete content
the best way to do this is to set a breakpoint in main, let the program run until main and then turn off automatic library loading.
...(gdb) r starting program: /home/blizzard/src/mozilla/mozilla/dist/bin/./mozilla-bin breakpoint 1, main (argc=1, argv=0xbffff894) at nsapprunner.cpp:811 811 installunixsignalhandlers(argv[0]); (gdb) set auto-solib-add 0 (gdb) c continuing.
...you can add this function to the .gdbinit file in your home directory: def prun tbreak main run set auto-solib-add 0 end how do i load shared libraries?
...And 2 more matches
Writing textual data - Archive of obsolete content
some character encodings (utf-8, utf-16, utf-32) can represent "all" characters (the full repertoire of unicode) while others can only represent a subset of the full repertoire.
... writing to a stream in gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverteroutputstream: var charset = "utf-8"; // can be any character encoding name that mozilla supports var os = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); // this assumes that fos is the nsioutputstream you want to write to os.init(fos, charset, 0, 0x0000); os.writestring("umlaute: \u00fc \u00e4\n"); os.writestring("hebrew: \u05d0 \u05d1\n"); // etc.
... to instead write a replacement character in such cases, specify the character instead of 0x00: os.init(fos, charset, 0, "?".charcodeat(0)); you can, of course, replace the "?" in that example with any other character.
...And 2 more matches
Binding Attachment and Detachment - Archive of obsolete content
-moz-binding value: none | [,]* <uri> | inherit initial value: none applies to: all elements (not generated content or pseudo-elements) inherited: no percentages: n/a the value of the -moz-binding property is a set of urls that identify specific bindings.
... an individual url in the set consists of the binding document's url and the binding's document-unique identifier.
... no bindings will be attached to elements that match the style rule, but are inside an element that has style display:none set.
...And 2 more matches
buttons - Archive of obsolete content
you can set its label with the buttonlabelextra1 attribute and its command with the ondialogextra1 attribute.
...you can set its label with the buttonlabelextra2 attribute and its command with the ondialogextra2 attribute.
... note: if you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma).
...And 2 more matches
textbox.type - Archive of obsolete content
« xul reference home type type: one of the values below you can set the type attribute to one of the values below for a more specialized type of textbox.
... don't set the type if you wish to use a regular textbox.
...if the searchbutton attribute is set to true, the command event is only fired if the user presses the search button or presses the enter key.
...And 2 more matches
Getting File Information - Archive of obsolete content
this example will check if a file on the desktop exists and set the variable 'filesize' to the size of the file.
... var filesize = 0; var file = io.getfile("desktop", "saved file"); if (file.exists()) filesize = file.filesize; it is also possible to modify the size of a file by setting the filesize (nsifile.attributes) attribute to a value.
... this may be useful to truncate a file, however, setting the file size will also increase the size of a file if the value is larger than the current size of the file.
...And 2 more matches
Tooltips - Archive of obsolete content
for example, in the following, a toolbar has a tooltip set for it.
...the value of the tooltip attribute should be set to the id of a tooltip element, in this case, 'iconic'.
... thus, there are two ways to set a tooltip for an element, using the tooltiptext attribute for labels and the tooltip attribute for more complex content.
...And 2 more matches
Sorting and filtering a custom tree view - Archive of obsolete content
= "") { //show all of them table = data; } else { //filter out the ones we want to display table = []; data.foreach(function(element) { //we'll match on every property for (var i in element) { if (prepareforcomparison(element[i]).indexof(filtertext) != -1) { table.push(element); break; } } }); } sort(); //restore scroll position if (topvisiblerow) { settopvisiblerow(topvisiblerow); } } //generic custom tree view stuff function treeview(table) { this.rowcount = table.length; this.getcelltext = function(row, col) { return table[row][col.id]; }; this.getcellvalue = function(row, col) { return table[row][col.id]; }; this.settree = function(treebox) { this.treebox = treebox; }; this.iseditable = function(row, col) { return col.edita...
...f (prepareforcomparison(a[columnname]) < prepareforcomparison(b[columnname])) return -1 * order; //tie breaker: name ascending is the second level sort if (columnname != "name") { if (prepareforcomparison(a["name"]) > prepareforcomparison(b["name"])) return 1; if (prepareforcomparison(a["name"]) < prepareforcomparison(b["name"])) return -1; } return 0; } table.sort(columnsort); //setting these will make the sort option persist tree.setattribute("sortdirection", order == 1 ?
... "ascending" : "descending"); tree.setattribute("sortresource", columnname); tree.view = new treeview(table); //set the appropriate attributes to show to indicator var cols = tree.getelementsbytagname("treecol"); for (var i = 0; i < cols.length; i++) { cols[i].removeattribute("sortdirection"); } document.getelementbyid(columnname).setattribute("sortdirection", order == 1 ?
...And 2 more matches
Filtering - Archive of obsolete content
function applyfilter(country) { var cond = document.getelementbyid("cond"); var triple = document.getelementbyid("filtertriple"); if (country) { if (!triple) { triple = document.createelement("triple"); triple.id = "filtertriple"; triple.setattribute("subject", "?photo"); triple.setattribute("predicate", "http://www.xulplanet.com/rdf/country"); } triple.setattribute("object", country); cond.appendchild(triple); } else if (triple) { cond.removechild(triple); } document.getelementbyid("photoslist").builder.rebuild(); } the 'country' argument to the applyfilter function holds the value to filter by.
... if this is set, we add a filter, otherwise we remove it.
...a new <triple> element is created and the object attribute is set to the value to filter by.
...And 2 more matches
Rule Compilation - Archive of obsolete content
a query contains instructions for how to retrieve a set of data from the datasource.
...for rdf and xml, the query contains a set of instructions for navigating through the rdf graph or xml document tree.
...the job of the query is to generate a set of output results.
...And 2 more matches
XML Templates - Archive of obsolete content
the datasources attribute should be set to the url of an xml document, either a local file or a remote web site.
... the ref attribute isn't currently used for xml sources, as the root of the document is always the starting point for xml queries; you should just set the ref attribute to a dummy value, for example '*' which is typically used.
...just place an expr attribute on the query element containing an xpath expression returns the set of results to output.
...And 2 more matches
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
set the command to be executed when the button is clicked in the oncommand attribute.
... let button = doc.createelement("toolbarbutton"); button.setattribute("id", button_id); button.setattribute("label", "replace bookmark"); button.setattribute("class", "toolbarbutton-1 chromeclass-toolbar-additional"); button.setattribute("tooltiptext", "replace an existing bookmark"); button.style.liststyleimage = "url(" + icon + ")"; button.addeventlistener("command", main.action, false); toolbox.palette.appendchild(button); this code is thanks to dgutov...
...the dimensions of the icons in various applications for both modes are summarized in the following table (feel free to add information about other applications): application (theme name) big icon size small icon size firefox 1.0 (winstripe) 24x24 16x16 thunderbird 1.0 (qute) 24x24 16x16 the stylesheet to set the image for your toolbar button, use the following css rules: /* skin/toolbar-button.css */ #myextension-button { list-style-image: url("chrome://myextension/skin/btn_large.png"); } toolbar[iconsize="small"] #myextension-button { list-style-image: url("chrome://myextension/skin/btn_small.png"); } applying the stylesheet remember to attach the stylesheet you created to both the over...
...And 2 more matches
Complete - Archive of obsolete content
to adopt this approach, set the maxversion to the latest actual version where you have tested your extension.
...to adopt this approach, set the maxversion to a large number like 99.
...this is useful when files from various components and extensions and all unpacked in the same place—it keeps each set of files separate.
...And 2 more matches
Adding Labels and Images - Archive of obsolete content
control attribute you can use the control attribute to set which control the label is associated with.
...set the value of the control attribute to the id of the element to be focused.
...</description> you can set the text via script using the textcontent property, as in the following example: <description id="text" width="200"/> document.getelementbyid('text').textcontent = "some lengthy word wrapped text goes here."; internally, both the label element and the description elements are the same.
...And 2 more matches
Grids - Archive of obsolete content
ArchiveMozillaXULTutorialGrids
« previousnext » xul has a set of elements for creating tabular grids.
... xul tabular layout xul has a set of elements for doing layout of elements in a grid-like manner using the grid element.
... declaring a grid to declare a set of rows, use the rows tag, which should be a child element of grid.
...And 2 more matches
Modifying the Default Skin - Archive of obsolete content
« previousnext » as of firefox 69, you must set the toolkit.legacyuserprofilecustomizations.stylesheets preference to true in about:config in order to load userchrome.css or usercontent.css files.
... skin basics a skin is a set of style sheets, images and behaviors that are applied to a xul file.
... customize with userchrome.css if you place a file called 'userchrome.css' in a directory called 'chrome' inside your user profile directory, you can override settings without changing the archives themselves.
...And 2 more matches
More Event Handlers - Archive of obsolete content
there are also a set of drag related events, which occur when the user holds down a mouse button and drags the mouse around.
...for the mousemove event, for example, both properties will be set to 0.
...there are two sets of coordinates.
...And 2 more matches
Open and Save Dialogs - Archive of obsolete content
you can set a number a features of the dialog by using the interface.
... default directory and filters there are two features you can set of the dialog before it is displayed.
... you can set the default directory by setting the displaydirectory property of the file picker object to a directory.
...And 2 more matches
Progress Meters - Archive of obsolete content
if this is set to determined, the progress meter is a determinate progress meter where it fills up as the task completes.
... if this is set to undetermined, the progress meter is indeterminate where you do not know the length of time.
...the value should be set to an integer percentage from 0 to 100.
...And 2 more matches
RDF Datasources - Archive of obsolete content
you can use this datasource if you want to dynamically set the datasource using a script, but don't want one initially or don't know its exact url.
...the ref attribute has been set to the root element in the rdf file, which is the top-level seq.
...if we wanted to, we could set the ref attribute to any of the other about attribute values to limit the set of data that is returned.
...And 2 more matches
Tree Selection - Archive of obsolete content
« previousnext » the section will describe how to get and set the selected items in a tree.
...if you add the seltype attribute to the tree, set to the value single, the user may only select one row at a time.
...<tree id="treeset" onselect="alert('you selected something!');"> tree indices the tree has a property currentindex, which can be used to get the currently selected item, where the first row is 0.
...And 2 more matches
command - Archive of obsolete content
see also: command attribute, commandset element attributes disabled, label, oncommand,reserved examples the following code will send a paste command (cmd_paste) to the currently focused element: // first include chrome://global/content/globaloverlay.js godocommand("cmd_paste"); example with two buttons <commandset><command id="cmd_openhelp" oncommand="alert('help');"/></commandset> <button label="help" command="cmd_openhelp"...
...if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
...And 2 more matches
listhead - Archive of obsolete content
if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
...And 2 more matches
menubar - Archive of obsolete content
> <menuitem label="save" disabled="true"/> <menuitem label="close"/> <menuseparator/> <menuitem label="quit"/> </menupopup> </menu> <menu id="edit-menu" label="edit"> <menupopup id="edit-popup"> <menuitem label="undo"/> <menuitem label="redo"/> </menupopup> </menu> </menubar> attributes grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden.
... when set to false, the default, the grippy will be shown.
... statusbar type: id if you set this attribute to the id of a statusbar element, the label on the statusbar will update to the statustext of the items on the menu as the user moves the mouse over them.
...And 2 more matches
stack - Archive of obsolete content
ArchiveMozillaXULstack
the bottom and right attributes can also be used in conjunction with top and left to set the width and/or height of the children of the stack.
... when using these attributes to set width or height, both attributes for the given axis must be explicitly set, eg, if setting width, both "left" and "right" must be set.
... in some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results.
...And 2 more matches
where - Archive of obsolete content
ArchiveMozillaXULwhere
attributes ignorecase, multiple, negate, rel, subject, value examples (example needed) attributes ignorecase type: boolean set to true to indicate that the case does not matter when making comparisons.
... multiple type: boolean set to true to indicate that the value contains multiple values separated by commas.
... negate type: boolean set to true to indicate that the comparison should be reversed.
...And 2 more matches
Application Update - Archive of obsolete content
application settings you will need to configure the following settings in your application: branding the update process uses branding information, setup branding for your application as described here: xulrunner tips icons the updater process for linux systems requires updater.png to be in your <application folder>/icons/, see https://bugzilla.mozilla.org/show_bug.cgi?id=706846 preferences // whether or n...
...pref("app.update.auto", true); // defines how the application update service notifies the user about updates: // // aum set to: minor releases: major releases: // 0 download no prompt download no prompt // 1 download no prompt download no prompt if no incompatibilities // 2 download no prompt prompt // // see chart in nsupdateservice.js.in for more details // pref("app.update.mode", 1); // if set to true, the update service will present no ui for any event.
...pref("app.update.url.details", "http://yourserver.net/yourpage"); // user-settable override to app.update.url for testing purposes.
...And 2 more matches
Debugging a XULRunner Application - Archive of obsolete content
see also debugging javascript prefs setting the following prefs will make your debugging life much easier!
... to output dump calls instead to a file, set browser.dom.window.dump.file to the file destination where the log should be created and restart the application.
...to show errors in chrome javascript, the pref pref("javascript.options.showinconsole", true) must be set.
...And 2 more matches
How to enable locale switching in a XULRunner application - Archive of obsolete content
normally the application locale is inherited from the os environment of the host system, however there are situations when you might want to give users the option to override the default setting and choose a different locale.
...edit the application preferences file and set "intl.locale.matchos" to false.
...defaults/preferences/prefs.js /* don't inherit os locale */pref("intl.locale.matchos", "false");/* choose own fallback locale; later it can be overridden by the user */pref("general.useragent.locale", "en-gb"); note that some distributions of xulrunner or firefox don't honour the "intl.locale.matchos" setting, so in those cases you won't be able to override the os locale [debian iceweasel bug #417961].
...And 2 more matches
Mozprofile - Archive of obsolete content
in addition to creating profiles, mozprofile can install addons and set preferences.
...command line usage mozprofile may be used to create profiles, set preferences in profiles, or install addons into profiles.
...in addition, subclasses firefoxprofile and thundebirdprofile are available with preset preferences for those applications.
...And 2 more matches
Extentsions FAQ - Archive of obsolete content
the ietab (opens ie in a firefox tab) should be able do this if you set it to always open "file://*" urls in an ie tab.
...also, check out this site to learn how to set up a proxy: http://www.mozilla.org/projects/xpcom/proxies.html how to test a tab has been closed or not?
... //setting the state document.getelementbyid("toolbar-button").setattribute("toolbar-button", "on"); //or document.getelementbyid("toolbar-button").setattribute("toolbar-button","off"); //css #myexten-toolbar-button[myexten-toolbar-button="on"] { list-style-image: url("chrome://myexten/skin/toolbar-button.png"); -moz-image-region: rect(0px 24px 24px 0px);} #myexten-toolbar-button[myexten-toolba...
...And 2 more matches
NPByteRange - Archive of obsolete content
syntax typedef struct _npbyterange { int32 offset; /* negative offset = from the end */ uint32 length; struct _npbyterange* next; } npbyterange; fields the data structure has the following fields: offset offset in bytes to the start of the requested range.
... this value may be either positive or negative: positive value: offset from the beginning of the stream.
... negative value: offset from the end of the stream.
...And 2 more matches
NP_Port - Archive of obsolete content
the np_port is valid for the lifetime of the npwindow, that is, until npp_setwindow is called again with a different value or the instance is destroyed.
... save the current port settings before changing the port for drawing.
... set the desired port settings before drawing.
...And 2 more matches
Theme changes in Firefox 4 - Archive of obsolete content
omni.jar firefox 4 achieves performance improvements by moving many of its internal parts from being standalone files or sets of jar files into just one jar file; this reduces the amount of i/o needed to load firefox.
...the theme can now override the value by setting a special css property on the toolbar.
... overriding the default values themes can override the value of the iconsize attribute on each toolbar by specifying a special value for the counter-reset css property on the toolbar itself.
...And 2 more matches
Browser Detection and Cross Browser Support - Archive of obsolete content
if (document.all) { // ie4 height = document.body.offsetheight; } else if (document.layers) { // nn4 height = window.innerheight; } else { // other height = 0; } with the introduction of the w3c dom, the standard method document.getelementbyid became available in internet explorer 5 and later in netscape 6 (gecko).
...if (document.all) { // ie4 height = document.body.offsetheight; } else if (document.layers) { // nn4 height = window.innerheight; } else if (document.getelementbyid) { // they think this is gecko // but could be wrong!
... using noframes to support non-frames capable browsers <html> <head> <title>frames</title> </head> <frameset rows="30,*"> <frame src="foo.html"> <frame src="bar.html"> <noframes> <body> <p> this page requires frames.
...And 2 more matches
Mozilla's DOCTYPE sniffing - Archive of obsolete content
a doctype declaration with an internal subset.
... the public identifier "-//w3c//dtd xhtml 1.0 frameset//en".
... the public identifier "-//w3c//dtd html 4.01 frameset//en", with a system identifier.
...And 2 more matches
Explaining basic 3D theory - Game development
vertex processing vertex processing is about combining the information about individual vertices into primitives and setting their coordinates in the 3d space for the viewer to see.
...then there's view transformation which takes care of positioning and setting the orientation of the camera in the 3d space.
... projection transformation (also called perspective transformation) then defines the camera settings.
...And 2 more matches
Desktop gamepad controls - Game development
te the state of the gamepad's currently pressed buttons we will need a function that will do exactly that on every frame: function gamepadupdatehandler() { buttonspressed = []; if(controller.buttons) { for(var b=0; b<controller.buttons.length; b++) { if(controller.buttons[b].pressed) { buttonspressed.push(b); } } } } we first reset the buttonspressed array to get it ready to store the latest info we'll write to it from the current frame.
... then, if the buttons are available we loop through them; if the pressed property is set to true, then we add them to the buttonspressed array for later processing.
... the pressed() function gets the input data and sets the information about it in our object, and the axes property stores the array containing the values signifying the amount an axis is pressed in the x and y directions, represented by a float in the (-1, 1) range.
...And 2 more matches
Mobile touch controls - Game development
pure javascript approach we could implement touch events on our own — setting up event listeners and assigning relevant functions to them would be quite straightforward: var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("touchstart", handlestart); el.addeventlistener("touchmove", handlemove); el.addeventlistener("touchend", handleend); el.addeventlistener("touchcancel", handlecancel); this way, touching the game's <canvas> on the mobile screen ...
... use it for both cases: when the player touches the screen but doesn't move it (touchstart), and when the finger is moved on the screen (touchmove): document.addeventlistener("touchstart", touchhandler); document.addeventlistener("touchmove", touchhandler); the touchhandler function looks like this: function touchhandler(e) { if(e.touches) { playerx = e.touches[0].pagex - canvas.offsetleft - playerwidth / 2; playery = e.touches[0].pagey - canvas.offsettop - playerheight / 2; output.innerhtml = "touch: "+ " x: " + playerx + ", y: " + playery; e.preventdefault(); } } if the touch occurs (touches object is not empty), then we will have all the info we need in that object.
... we can get the first touch (e.touches[0], our example is not multitouch-enabled), extract the pagex and pagey variables and set the player's ship position on the screen by subtracting the canvas offset (distance from the canvas and the edge of the screen) and half the player's width and height.
...And 2 more matches
Crisp pixel art look with image-rendering - Game development
the steps to achieve this effect are: create a <canvas> element and set its width and height attributes to the original, smaller resolution.
... set its css width and height properties to be 2x or 4x the value of the html width and height.
... if the canvas was created with a 128 pixel width, for example, we would set the css width to 512px if we wanted a 4x scale.
...And 2 more matches
Square tilemaps implementation: Scrolling maps - Game development
var startcol = math.floor(this.camera.x / map.tsize); var endcol = startcol + (this.camera.width / map.tsize); var startrow = math.floor(this.camera.y / map.tsize); var endrow = startrow + (this.camera.height / map.tsize); once we have the first tile, we need to calculate how much its rendering (and therefore the rendering of the other tiles) is offset by.
...in our demo the shifting amount is stored in the offsetx and offsety variables.
... var offsetx = -this.camera.x + startcol * map.tsize; var offsety = -this.camera.y + startrow * map.tsize; with these values in place, the loop that renders the map is quite similar to the one used for rendering static tilemaps.
...And 2 more matches
Images, media, and form elements - Learn web development
there are some additional elements, such as <textarea> for multiline text input, and also elements used to contain and label parts of forms such as <fieldset> and <legend>.
...you learned about the box-sizing property in our box model lesson and you can use this knowledge when styling forms to ensure a consistent experience when setting widths and heights on form elements.
... for consistency it is a good idea to set margins and padding to 0 on all elements, then add these back in when styling particular controls button, input, select, textarea { box-sizing: border-box; padding: 0; margin: 0; } other useful settings in addition to the rules mentioned above, you should also set overflow: auto on <textarea>s to stop ie showing a scrollbar when there is no need for one: textarea { overflow: auto; } putting it all together into a "reset" as a final step, we can wrap up the various properties discussed above into the following "form reset" to provide a consistent base to work from.
...And 2 more matches
Overflowing content - Learn web development
the first example is a box that has been restricted by setting a height.
... to crop content when it overflows, you can set overflow: hidden.
...to just scroll on the y axis, you could use the overflow-y property, setting overflow-y: scroll.
...And 2 more matches
Floats - Learn web development
agnis dis parturient montes, nascetur ridiculus mus.</p> body { width: 90%; max-width: 900px; margin: 0 auto; font: .9em/1.2 arial, helvetica, sans-serif } .box { float: left; margin-right: 15px; width: 150px; height: 150px; border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } so let's think about how the float works — the element with the float set on it (the <div> element in this case) is taken out of the normal layout flow of the document and stuck to the left-hand side of its parent container (<body>, in this case).
...try changing the float value to right and replace margin-right with margin-left in the last ruleset to see what the result is.
...this involves inserting some generated content after the box which contains the float and wrapping content, and setting that to clear both.
...And 2 more matches
Beginner's guide to media queries - Learn web development
a set of css rules that will be applied if the test passes and the media type is correct.
... media types the possible types of media you can specify are: all print screen speech the following media query will only set the body to 12pt if the page is printed.
... "or" logic in media queries if you have a set of queries, any of which could match, then you can comma separate these queries.
...And 2 more matches
Positioning - Learn web development
static positioning static positioning is the default that every element gets — it just means "put the element into its normal position in the document layout flow — nothing special to see here." to demonstrate this, and get your example set up for future sections, first add a class of positioned to the second <p> in the html: <p class="positioned"> ...
...try setting top: 0; bottom: 0; left: 0; right: 0; and margin: 0; on your positioned elements and see what happens!
...this is done by setting positioning on one of the element's ancestors — to one of the elements it is nested inside (you can't position it relative to an element it is not nested inside).
...And 2 more matches
What text editors are available? - Learn web development
try digging through the settings of your editor and read the manual or documentation to see what its capabilities are.
... in particular (if possible in your editor), try to: change syntax highlighting settings and colors play with indentation width, setting it to an appropriate setting for your needs check autosave and session saving settings configure any available plugins and investigate how to get new ones change color schemes adjust view settings and see how you can change the layout of the views check what programming languages/technologies your editor supports while you're learning the default settings of most text editors should be fine to use, but it is important to become familiar with your chosen tools, so you can select the best one for your usage.
...that means, if you've set your heart on an obscure text editor, you may have to compile it from source yourself (not for the faint-hearted).
...And 2 more matches
Common questions - Learn web development
tools and setup questions related to the tools/software you can use to build websites.
... every browser features a set of devtools for debugging html, css, and other web code.
... how do you set up a local testing server?
...And 2 more matches
CSS property compatibility table for form controls - Learn web development
text and font color[1] yes yes if the border-color property is not set, some webkit based browsers will apply the color property to the border as well as the font on <textarea>s.
... on opera the border-radius property is applied only if an explicit border is set.
... buttons see the button, submit, and reset input types and the <button> element.
...And 2 more matches
Your first form - Learn web development
designing a quick mockup will help you to define the right set of data you want to ask your user to enter.
...all of its attributes are optional, but it's standard practice to always set at least the action and method attributes: the action attribute defines the location (url) where the form's collected data should be sent when it is submitted.
...this is done by using the <button> element; add the following just above the closing </ul> tag: <li class="button"> <button type="submit">send your message</button> </li> the <button> element also accepts a type attribute — this accepts one of three values: submit, reset, or button.
...And 2 more matches
Test your skills: Links - Learn web development
the second link should be turned into a link you can click to open up an email in the user's default mail application, with the recipient set as "whales@example.com".
... you'll get a bonus point if you also set it so that the subject line of the email is automatically filled in as "question about whales".
... note: the first link in the example has the target="_blank" attribute set on it, so that when you click on it, it opens the page in a new tab.
...And 2 more matches
HTML table basics - Learn web development
LearnHTMLTablesBasics
a table is a structured set of data made up of rows and columns (tabular data).
...to set other properties you'll have to either style every <td> or <th> in the column, or use a complex selector such as :nth-child().
...style="background-color: yellow">orange</td> </tr> <tr> <td>robots</td> <td style="background-color: yellow">jazz</td> </tr> </table> which gives us the following result: data 1 data 2 calcutta orange robots jazz this isn't ideal, as we have to repeat the styling information across all three cells in the column (we'd probably have a class set on all three in a real project and specify the styling in a separate stylesheet).
...And 2 more matches
Silly story generator - Learn web development
basic setup: create a new file called main.js, in the same directory as your index.html file.
... store the first set of three strings inside an array called insertx.
... store the second set of three strings inside an array called inserty.
...And 2 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
have a look at line 78, and you'll see the following code: loworhi.textcontent = 'last guess was too high!'; this line is trying to set the textcontent property of the loworhi constant to a text string, but it's not working because loworhi does not contain what it's supposed to.
...so it will print the value of loworhi to the console as soon as we have tried to set it in line 48.
... at that point, the game fails again, and the same error is spat out that we got at the beginning — "typeerror: resetbutton.addeventlistener is not a function"!
...And 2 more matches
What is web performance? - Learn web development
making the site usable as soon as possible: this basically means loading your web site assets in a sensible order so that the user can start to actually use it really quickly.
... any other assets can continue to load in the background while the user gets on with primary tasks, and sometimes we only load assets when they are actually needed (this is called lazy loading).
...the download of additional assets linked to from the index file is generally sequential, based on source order, but this can be manipulated and should definitely be optimized, realizing that some resources block additional downloads until their content is parsed and executed.
...And 2 more matches
The business case for web performance - Learn web development
performance budgets setting a web performance budget can help you make sure the team stays on track in keeping the site and help prevent regressions.
... a performance budget is a set of limits that are set to specify limits, such as maximum number of http requests allowed, the maximum total size of all the assets combined, the minimum allowable fps on a specific device, etc, that must be maintained.
... key performance indicators setting key performance indicators (kpi) as objectives can hiltie performance objectives that are also business objectives.
...And 2 more matches
Server-side web frameworks - Learn web development
the model doesn't state any information about the underlying database as that is a configuration setting that may be changed separately of our code.
...however if a smaller framework has everything you (will ever) need then it can run in more constrained environments and will have a smaller and easier subset of things to learn.
...c++ or javascript, may well be offset by the costs of learning and maintenance.
...And 2 more matches
Ember resources and troubleshooting - Learn web development
for more information on sourcemaps, why they're needed, and what the ember-cli does with them, see the advanced use: asset compilation guide.
...it could be thought of as a build-time transform that wraps its argument with a setter function.
... more concretely, using mut allows for template-only settings functions to be declared: <checkbox @value={{this.somedata}} @ontoggle={{fn (mut this.somedata) (not this.somedata)}} /> whereas, without mut, a component class would be needed: import component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; export default class example extends component { @tracked somedata = false; @action setdata(newvalue) { this.somedata = newvalue; } } which would then be called in the template like so: <checkbox @data={{this.somedata}} @onchange={{this.setdata}} /> due to the conciseness of using mut, it may be desireable to reach for it.
...And 2 more matches
Creating our first Vue component - Learn web development
making components dynamic with props our todoitem component is still not very useful because we can only really include this once on a page (ids need to be unique), and we have no way to set the label text.
...set the value for this property as the javascript string type (note the capital "s").
...we now have a working checkbox where we can set the state programmatically.
...And 2 more matches
Multiprocess on Windows
you should always embed your typelib with its resource id set to 1.
...this should usually be set to vt_unknown | vt_byref, which is telling the interceptor that the outparam is an iunknown**.
... mflag may currently be set to one of two values: arraydata::flag::enone or arraydata::flag::eallocatedbyserver.
...And 2 more matches
Creating a Language Pack
to create a language pack, or a localization repack, you first need to go through the initial setup process.
...you have to set your selected language still.
... you can either use the locale switcher extension, or set it in about:config.
...And 2 more matches
Configuring Build Options
setting the mozconfig path: export mozconfig=$home/mozilla/mozconfig-firefox calling the file .mozconfig (with a leading dot) is also supported, but this is not recommended because it may make the file harder to find.
...if you do not specify a moz_objdir, it will be automatically set to @topsrcdir@/obj-@config_guess@.
...ptions --enable-debug and a mozconfig-rel-opt: mk_add_options moz_objdir=@topsrcdir@/obj-ff-rel-opt ac_add_options --disable-debug ac_add_options --enable-optimize allow for building both versions by specifiying the configuration via the mozconfig environment variable: $ env mozconfig=/path/to/mozconfig-dbg ./mach build $ env mozconfig=/path/to/mozconfig-rel-opt ./mach build don't forget to set the mozconfig environment variable for the mach run command as well.
...And 2 more matches
Installing headers using EXPORTS
this is accomplished by setting make variables telling the build system which module the headers are for (since headers are organized by module under <tt>dist/include</tt>), and which headers need to be created from idl files by xpidl.
... for all <tt>makefile.in</tt>s which export public headers, you should set module to the module name where the files should be copied to in <tt>dist/include</tt>.
... for normal headers that are to be exported, you should set exports to the list of headers to be exported.
...And 2 more matches
Simple Instantbird build
setup: depending on your operating system you will need to carry out a different process to prepare your machine.
... windows build prerequisites gnu/linux build prerequisites mac os x build prerequisites tip: after completing setup for your os, and before you get the source, you can opt to add the progressextension to your mercurial.ini (for windows) or .hgrc (for *nix / mac) file.
... get the source note: on windows, you won't be able to build the instantbird source code if it's under a directory with spaces in the path (e.g., don't use "documents and settings").
...And 2 more matches
ESLint
in order to help people write standard-compliant code from the start and avoid wasting time during code reviews, a set of eslint configuration files have been added to the code base so that javascript can be analyzed automatically.
... running eslint eslint comprises of a set of rules that are used to analyse the code for correctness and style consistency.
... setting up eslint ./mach eslint --setup running eslint eslint can be run via: ./mach lint -l eslint you can limit running it to a specific directory with: ./mach lint -l eslint browser/components or work directory changes: ./mach lint -l eslint -w or outgoing commits only: ./mach lint -l eslint -o see ./mach eslint --help for more options when running eslint.
...And 2 more matches
Frame script loading and lifetime
if you've set allowdelayedload, the script is loaded into a new tab as soon as it is created.
... to listen for an event, when your frame script is unloaded (due to tab close for instance), you must set the third argument of addmessagelistener to true.
... for example, from bootstrap.js: services.mm.addmessagelistener( 'my-addon-id', { receivemessage: function() { console.log('incoming message from frame script:', amsg.data); } }, true // must set this argument to true, otherwise sending message from framescript will not work during and after the unload event on the contentmessagemanager triggers ); then in your frame script, listen for the unload event of the message manager (which is the global this), and sending a message.
...And 2 more matches
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
the html an <iframe> is turned into a browser iframe by setting the mozbrowser attribute on it: <iframe src="http://mozilla.org" mozbrowser> in addition, the <iframe> can be loaded in its own child process — separate to the page embedding this frame — by including the remote attribute.
...we then set the browser iframe's src attribute to equal the value of the url bar, which causes the new url to be loaded in the iframe.
...when this fires, we set the value inside the url bar input to be equal to the event object detail property — this is so that the url displayed continues to match the website being shown when the user navigates back and forth through the history.
...And 2 more matches
Extending a Protocol
once it's compiled, ./mach run and you should be able to spin up the developer console and type: navigator.echo("hi!"); that will return a pending promise that never settles.
... our goal is now to get that to settle with the value we sent in.
... async echo(nscstring data) returns (nscstring aresult); - the "returns" here translates to a mozpromise, with a resolver that will settle a promise with the expected value.
...And 2 more matches
Assert.jsm
cted, message); undefined notstrictequal(actual, expected, message); undefined throws(block, expected, message); promise rejects(promise, expected, message); undefined greater(lhs, rhs, message); undefined greaterorequal(lhs, rhs, message); undefined less(lhs, rhs, message); undefined lessorequal(lhs, rhs, message); undefined setreporter(reporterfunc); undefined report(failed, actual, expected, message, operator); constructor creates a new assert object.
... ok, equal, notequal, deepequal, notdeepequal, strictequal, notstrictequal, throws, setreporter, report methods ok() pure assertion tests whether a value is truthy, as determined by !!guard.
... undefined lessorequal( lhs, rhs, message ); parameters lhs the left hand side of the operator rhs the right hand side of the operator message short explanation of the expected result setreporter() set a custom assertion report handler function.
...And 2 more matches
Localizing XLIFF files for iOS
go through the full xliff page adding <target></target> below each <source> tag set to help you to identify strings that need to be translated.
... do not delete the <source> tag sets.
... <trans-unit id="add to bookmarks"> <source>add to bookmarks</source> <target>your_translation_here</target> </trans-unit> provide translations of the strings in the <source> tag sets by placing their translations in the <target> tag sets beneath them.
...And 2 more matches
Mozilla Style System
nsistylerule an nsistylerule is animmutable set of css property-value pairs.
... computed style (front end) the interface that the front end exposes to the rest of mozilla consists of a single nsstyleset object and many nsstylecontext objects, each of which holds the computed style for an element, pseudo-element, or text node.
... the style set provides the api managing the rule processors and for creating style contexts.
...And 2 more matches
Mozilla Style System Documentation
the pres context forwards these calls to its style set object (stylesetimpl, interface nsistyleset), which does the real work (and also maintains the lists of stylesheets and owns the rule tree).
... these methods may all return an existing style context rather than a new one (see stylesetimpl::getcontext), if there is a current style context with the same parent, that matches the same rules (a check that is easy because of the ruletree), and is for the same pseudo-element (or not for a pseudo-element, or a "non-element").
...each of the structs includes either only features that are inherited by default or single properties that are set to the initial value by default (see css26.1.1), which is essential for the ruletree.
...And 2 more matches
Optimizing Applications For NSPR
one can only determine the immediate setting of daylight savings time, not what it would be at some arbitrary time in the past or the future.
... windows 3.1 does not support 64 bit file offsets.
... the nspr 64 bit file offset apis map to windows 3.1 32 bit file offset apis.
...And 2 more matches
PR_Open
pr_append 0x10 the file pointer is set to the end of the file prior to each write.
... pr_sync 0x40 if set, each write will wait for both the file data and file status to be physically updated.
... mode when pr_create_file flag is set and the file is created, these flags define the access permission bits of the newly created file.
...And 2 more matches
NSPR API Reference
introduction to nspr nspr naming conventions nspr threads thread scheduling setting thread priorities preempting threads interrupting threads nspr thread synchronization locks and monitors condition variables nspr sample code nspr types calling convention types algebraic types 8-, 16-, and 32-bit integer types signed integers unsigned integers 64-bit integer types floating-point integer type native os integer types miscellaneous types size type pointer difference types boolean types status type for return values threads threading types and constants threading functions creating, joining, and identifying threads controlling thread priorities cont...
...rolling per-thread private data interrupting and yielding setting global thread concurrency getting a thread's scope process initialization identity and versioning name and version constants initialization and cleanup module initialization locks lock type lock functions condition variables condition variable type condition variable functions monitors monitor type monitor functions cached monitors cached monitor functions i/o types directory type file descriptor types file info types network address types types used with socket options functions type used with memory-mapped i/o offset interpretation for seek functions i/o functions functions that operate on pathnames functions that act on file descriptors directory i/o f...
...unctions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers network addresses network address types and constants network address functions atomic operations pr_atomicincrement pr_atomicdecrement pr_atomicset interval timing interval time type and constants interval functions date and time types and constants time parameter callback functions functions memory management operations memory allocation functions memory allocation macros string operations pl_strlen pl_strcpy pl_strdup pl_strfree floating point number to string conversion pr_strtod pr_dtoa pr_cnvtf long long (64-bit) integers bitmaps formatted pr...
...And 2 more matches
Build instructions for JSS 4.3.x
build instructions for jss 4.3.x newsgroup: mozilla.dev.tech.crypto before building jss, you need to set up your system as follows: build nspr/nss by following the nspr/nss build instructions, to check that nss built correctly, run all.sh (in mozilla/security/nss/tests) and examine the results (in mozilla/test_results/security/computername.#/results.html.
... cvs co -r jss_4_3_1_rtm mozilla/security/jss or cvs co -r jss_4_3_rtm mozilla/security/jss setup environment variables needed for compiling java source.
...note, on windows platforms it is best to have java_home set to a directory path that doest not have spaces.
...And 2 more matches
JSS Provider Notes
if you do not wish the provider to be installed, create a cryptomanager.initializationvalues object, set its installjssprovider field to false, and pass the initializationvalues object to cryptomanager.initialize().
... in order to use a different token, use cryptomanager.setthreadtoken().
... this sets the token to be used by the jss jca provider in the current thread.
...And 2 more matches
Mozilla-JSS JCA Provider notes
if you do not wish the provider to be installed, create a cryptomanager.initializationvalues object, set its installjssprovider field to false, and pass the initializationvalues object to cryptomanager.initialize().
...in order to use a different token, use cryptomanager.setthreadtoken().
... this sets the token to be used by the jss jca provider in the current thread.
...And 2 more matches
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.
... the following functions have been added to the libssl library included in nss 3.14: dtls_importfd (in ssl.h) dtls_gethandshaketimeout (in ssl.h) ssl_getsrtpcipher (in ssl.h) ssl_setrtpciphers (in ssl.h) support for aes-gcm support for aes-gcm has been added to the nss pkcs #11 module (softoken), based upon the draft 7 of pkcs #11 v2.30.
...the defaults now better match the set that most major web browsers enable by default.
...And 2 more matches
NSS 3.21 release notes
new in nss 3.21 new functionality certutil now supports a --rename option to change a nickname (bug 1142209) tls extended master secret extension (rfc 7627) is supported (bug 1117022) new info functions added for use during mid-handshake callbacks (bug 1084669) new functions in nss.h nss_optionset - sets nss global options nss_optionget - gets the current value of nss global options in secmod.h secmod_createmoduleex - create a new secmodmodule structure from module name string, module parameters string, nss specific parameters string, and nss configuration parameter string.
... in ssl.h ssl_getpreliminarychannelinfo - obtains information about a tls channel prior to the handshake being completed, for use with the callbacks that are invoked during the handshake ssl_signatureprefset - configures the enabled signature and hash algorithms for tls ssl_signatureprefget - retrieves the currently configured signature and hash algorithms ssl_signaturemaxcount - obtains the maximum number signature algorithms that can be configured with ssl_signatureprefset in utilpars.h nssutil_argparsemodulespecex - takes a module spec and breaks it into shared library string, module name stri...
... ckm_tls_kdf ck_tls_mac_params{_ptr} - parameters {or pointer} for ckm_tls_mac in sslt.h sslhashtype - identifies a hash function sslsignatureandhashalg - identifies a signature and hash function sslpreliminarychannelinfo - provides information about the session state prior to handshake completion new macros in nss.h nss_rsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum rsa key size nss_dh_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum dh key size nss_dsa_min_key_size - used with nss_optionset and nss_optionget to set or get the minimum dsa key size in pkcs11t.h ckm_tls12_master_key_derive - derives tls 1.2 master secret ckm_tls12_key_and_mac_derive - derives tls...
...And 2 more matches
NSS 3.24 release notes
this mode is triggered by setting the database password to the empty string.
... in fips mode, you may move from level 1 to level 2 (by setting an appropriate password), but not the reverse.
...use this new function in place of ssl_configsecureserver, ssl_configsecureserverwithcertchain, ssl_setstapledocspresponses, and ssl_setsignedcerttimestamps.
...And 2 more matches
NSS 3.30 release notes
nss 3.30 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_30_rtm/src/ new in nss 3.30 new functionality in the pkcs#11 root ca module (nssckbi), cas with positive trust are marked with a new boolean attribute, cka_nss_mozilla_ca_policy, set to true.
... applications that need to distinguish them from other other root cas, may use the exported function pk11_hasattributeset.
... in pk11pub.h pk11_hasattributeset - allows to check if a pkcs#11 object in a given slot has a specific boolean attribute set.
...And 2 more matches
NSS 3.35 release notes
if a master password was set on the dbm database, then the initial migration may be partial, and migration of keys from dbm to sql will be delayed, until this master password is provided to nss.
... the signatures of functions ssl_optionset, ssl_optionget, ssl_optionsetdefault and ssl_optiongetdefault have been modified, to take a printn argument rather than prbool.
... in order to ease transitions, experimental functions return secfailure and set the ssl_error_unsupported_experimental_api code if the selected api is not available.
...And 2 more matches
NSS 3.45 release notes
if no such certificates can be found, returns secsuccess and sets *results to null.
... note: in 3.45 the sslchannelinfo is left unmodified, while an upcoming change in 3.46 will set sslchannelinfo.authkeybits to that of the delegated credential for better policy enforcement.
... from fiat-crypto bug 1551129 - support static linking on windows bug 1552262 - expose a function pk11_findrawcertswithsubject for finding certificates with a given subject on a given slot bug 1546229 - add ipsec ike support to softoken bug 1554616 - add support for the elbrus lcc compiler (<=1.23) bug 1543874 - expose an external clock for ssl this adds new experimental functions: ssl_settimefunc, ssl_createantireplaycontext, ssl_setantireplaycontext, and ssl_releaseantireplaycontext.
...And 2 more matches
nss tech note8
that is, the client session lifetime was not separately settable from the server session lifetime.
...there was no api function by which client programs could set these values.
... for server programs, the function for initializing the server session cache would set these two variables according to two of the arguments to that function.
...And 2 more matches
PKCS #11 Module Specs
a new ck_c_initialize_args structure is defined as typedef struct ck_c_initialize_args { ck_createmutex createmutex; ck_destroymutex destroymutex; ck_lockmutex lockmutex; ck_unlockmutex unlockmutex; ck_flags flags; ck_void_ptr libraryparameters; ck_void_ptr preserved; } ck_c_initialize_args; applications/libraries must set libraryparameters to null if no parameter value is specified.
...setting this flags means nss will not try to authenticate to the token when searching for certificates.
... this removes spurious password prompts, but if incorrectly set it can also cause nss to miss certificates in a token until that token is explicitly logged in.
...And 2 more matches
NSC_InitToken
ckr_device_error: failed to reset the key database.
... examples application usage nsc_inittoken() is used to reset the password for the key database when the user forgets the password.
... the "reset password" button of the mozilla application suite and seamonkey (in preferences->privacy & security->master passwords) calls nsc_inittoken().
...And 2 more matches
GC Rooting Guide
if you use these types directly, or create classes, structs or arrays that contain them, you must follow the rules set out in this guide.
...js::mutablehandle<t> is exactly like a js::handle<t> except that it adds a .set(t &t) method and must be created from a js::rooted<t> explicitly.
... if (!waserror) valueout.set(resultvalue); return waserror; } void otherfunction(jscontext *cx) { js::rootedvalue value(cx); bool success = maybegetvalue(cx, &value); // ...
...And 2 more matches
JIT Optimization Outcomes
singleton one of the types present in the typeset was a singleton type, preventing the optimization from being enabled.
... inconsistentfieldoffset the offset of an unboxed field is not consistent across all the different types of objects it could be accessed from.
... accessnottypedarray accessnotstring statictypedarrayuint32 statictypedarraycantcomputemask outofbounds getelemstringnotcached nonnativereceiver indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled.
...And 2 more matches
JSErrorReport
callers should set this flag for cross-origin scripts, and it will be propagated appropriately to child scripts and passed back in jserrorreports.
...a jserrorreporter might choose to ignore a jserrorreport that has this flag set, since the exception may be caught and handled by javascript code.
...set linebuf to point at the buffer before your application executes a script.
...And 2 more matches
JSFastNative
native methods must not call js_callee after calling js_set_rval.
... native methods must not call js_this after calling js_set_rval.
... native methods must not call js_this_object after calling js_set_rval.
...And 2 more matches
JSNewResolveOp
jsnewresolveop is the type of the jsclass.resolve callback when the jsclass_new_resolve bit is set in the jsclass.flags field.
...on success, the resolve hook must set *objp to the object in which the property has been defined, or null if it was not defined.
...on success, the callback must set the *objp out parameter to null if id was not resolved; or non-null, referring to obj or one of its prototypes, if id was resolved; and return js_true.
...And 2 more matches
JSObjectOps.getProperty
jsobjectops.getproperty, setproperty, and deleteproperty are high-level callbacks that implement object property accesses.
... each of these callbacks is responsible for everything involved with an individual property access operation, including: any locking necessary for thread safety; security checks; finding the property, including walking the prototype chain if needed; calling the lower-level jsclass hooks; calling getters or setters; and actually getting, setting, or deleting the property once it is found.
... contrast jsclass.getproperty, jsclass.setproperty, and jsclass.delproperty, which are hooks called during property accesses and don't have to implement any of that.
...And 2 more matches
JSObjectOps.getRequiredSlot
the jsobjectops.getrequiredslot and setrequiredslot callbacks get and set a required slot—one that should already have been allocated.
... syntax typedef jsval (*jsgetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot); typedef jsbool (*jssetrequiredslotop)(jscontext *cx, jsobject *obj, uint32 slot, jsval v); name type description cx jscontext * the js context in which we access the slot.
... v jsval the value to store in the slot, for jssetrequiredslotop.
...And 2 more matches
JS_GetGCParameter
syntax uint32_t js_getgcparameter(jsruntime *rt, jsgcparamkey key); void js_setgcparameter(jsruntime *rt, jsgcparamkey key, uint32_t value); uint32_t js_getgcparameterforthread(jscontext *cx, jsgcparamkey key); // added in spidermonkeysidebar 17 void js_setgcparameterforthread(jscontext *cx, jsgcparamkey key, uint32_t value); // added in spidermonkeysidebar 17 name type description rt jsruntime * the runtime to configure.
... key jsgcparamkey specifies which garbage collection parameter to get or set.
... value uint32_t (js_setgcparameter only) the value to assign to the parameter.
...And 2 more matches
JS_GetSecurityCallbacks
syntax /* added in spidermonkey 17 */ void js_setsecuritycallbacks(jsruntime *rt, const jssecuritycallbacks *callbacks); const jssecuritycallbacks * js_getsecuritycallbacks(jsruntime *rt); /* obsolete since jsapi 13 */ jssecuritycallbacks * js_setcontextsecuritycallbacks(jscontext *cx, jssecuritycallbacks *callbacks); jssecuritycallbacks * js_getruntimesecuritycallbacks(jsruntime *rt); jssecuritycallbacks * js_setruntimesecuritycallbacks(jsruntime *rt, jssecuritycallbacks *callbacks); name type description rt jsruntime * a runtime to get/set the security callbacks.
... description js_setsecuritycallbacks sets the runtime's security callbacks to callbacks.
... it allows the embedding to control certain aspects of js code execution based on security settings of the global object the code is executed in.
...And 2 more matches
JS_NewGlobalObject
clasp->flags must have the jsclass_global_flags bits set.
...it initially has no prototype either, since it is typically the first object created; call js_initstandardclasses to create all the standard objects, including object.prototype, and set the global object's prototype.
...but this creates a problem for consumers that need to set slots on the global to put it in a consistent state.
...And 2 more matches
JS_ScheduleGC
this article covers features introduced in spidermonkey 17 set nextscheduled parameter of gc.
...the gc zeal level of the associated jsruntime is set.
... description js_schedulegc sets the nextscheduled parameter of gc.
...And 2 more matches
Mozilla Projects
internet explorer supports the ability to make an entire document editable by setting the designmode property of the document object; this is how midas is invoked in gecko.
... network security services network security services (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications.
... personal security manager (psm) personal security manager (psm) consists of a set of libraries that perform cryptographic operations on behalf of a client application.
...And 2 more matches
Mork
MozillaTechMork
at its core, it can be viewed as a set of rows, collections of name-value pairs, which can be organized into various tables.
...the file is a collection of top-level structures, of which there exists four: dictionaries, tables, rows, and groups (changesets).
...meta-rows do not appear to be used at all, although the parser seems to consider setting the charset, row scope, and atom scope.
...And 2 more matches
History Service Design
charset for pages: allows setting and reading charset for each page.
... once the database connection has been set-up the schema version of the database is checked.
...if a page can be added we first check if it exists already, then it is added or updated accordingly to the previous check, and common attributes are set based on concurrent visit properties.
...And 2 more matches
extIPreferenceBranch
the root branch is set based on the context of the owner.
... method overview boolean has(in astring aname) extipreference get(in astring aname) nsivariant getvalue(in astring aname, in nsivariant adefaultvalue) void setvalue(in astring aname, in nsivariant avalue) void reset() attributes attribute type description root readonly attribute astring the name of the branch root.
... setvalue() sets the value of a preference with the given name.
...And 2 more matches
XPCOM hashtable guide
a hashtable is a data construct that stores a set of items.
... hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or removed.
... hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access.
...And 2 more matches
Detailed XPCOM hashtable guide
a hashtable is a data construct that stores a set of items.
... hashtables are useful for sets of data that need swift random access; with non-integral keys or non-contiguous integral keys; or where items will be frequently added or removed.
... hashtables should not be used for sets that need to be sorted; very small datasets (less than 12-16 items); data that does not need random access.
...And 2 more matches
Introduction to XPCOM for the DOM
interface to a set of methods that manipulate an object (often represented by a class), without worrying about the details of the implementation.
... the attributes of the interface become two functions: a getter, and a setter.
...the class that implements the interface has to explicitly implement each method and implement the setter and the getter of each attribute defined on the interface.
...And 2 more matches
nsACString_internal
cii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar data members no public members.
... const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruint32 countchar(char) const - source parameters char <anonymous> findchar print32 findchar(char, pruint32) const - source parameters char <anonymous> pruint32 offset equals prbool equals(const nsacstring_internal&) const - source equality parameters nsacstring_internal& <anonymous> prbool equals(const nsacstring_internal&, const nscstringcomparator&) const - source parameters nsacstring_internal& <anonymous> nscstringcomparator& <anonymous> prbool equals(const char*) const - source parameters char* data prbool equals(const char*, cons...
...nt32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring_internal&, pruint32) - source parameters nsacstring_internal& str pruint32 pos void insert(const nscsubstringtuple&, pruint32) - source parameters nscsubstringtuple& tuple pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength setcapacity void setcapacity(pruint32) - source buffer sizing parameters pruint32 newcapacity setlength void setlength(pruint32) - source parameters pruint32 newlength truncate void truncate(pruint32) - source parameters pruint32 newlength getdata pruint32 getdata(const char**) const - source get a const pointer to the string's internal buffer.
...And 2 more matches
nsAString_internal
cii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar data members no public members.
...t32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source countchar pruint32 countchar(prunichar) const - source parameters prunichar <anonymous> findchar print32 findchar(prunichar, pruint32) const - source parameters prunichar <anonymous> pruint32 offset equals prbool equals(const nsastring_internal&) const - source equality parameters nsastring_internal& <anonymous> prbool equals(const nsastring_internal&, const nsstringcomparator&) const - source parameters nsastring_internal& <anonymous> nsstringcomparator& <anonymous> prbool equals(const prunichar*) const - source parameters prunichar* data prbool equals(const prunich...
...t32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring_internal&, pruint32) - source parameters nsastring_internal& str pruint32 pos void insert(const nssubstringtuple&, pruint32) - source parameters nssubstringtuple& tuple pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength setcapacity void setcapacity(pruint32) - source buffer sizing parameters pruint32 newcapacity setlength void setlength(pruint32) - source parameters pruint32 newlength truncate void truncate(pruint32) - source parameters pruint32 newlength getdata pruint32 getdata(const prunichar**) const - source get a const pointer to the string's internal buffer.
...And 2 more matches
nsDependentCSubstring
cii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsacstring_internal data members no public members.
... const - source parameters pruint32 i operator[] char operator[](pruint32) const - source parameters pruint32 i first char first() const - source last char last() const - source countchar pruint32 countchar(char) const - source parameters char <anonymous> findchar print32 findchar(char, pruint32) const - source parameters char <anonymous> pruint32 offset equals prbool equals(const nsacstring_internal&) const - source equality parameters nsacstring_internal& <anonymous> prbool equals(const nsacstring_internal&, const nscstringcomparator&) const - source parameters nsacstring_internal& <anonymous> nscstringcomparator& <anonymous> prbool equals(const char*) const - source parameters char* data prbool equals(const char*, cons...
...nt32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring_internal&, pruint32) - source parameters nsacstring_internal& str pruint32 pos void insert(const nscsubstringtuple&, pruint32) - source parameters nscsubstringtuple& tuple pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength setcapacity void setcapacity(pruint32) - source buffer sizing parameters pruint32 newcapacity setlength void setlength(pruint32) - source parameters pruint32 newlength truncate void truncate(pruint32) - source parameters pruint32 newlength getdata pruint32 getdata(const char**) const - source get a const pointer to the string's internal buffer.
...And 2 more matches
nsDependentSubstring
cii equalsliteral(const char equalsliteral(char lowercaseequalsascii lowercaseequalsliteral(const char lowercaseequalsliteral(char assign assignascii assignliteral(const char assignliteral(char operator= adopt replace replaceascii append appendascii appendliteral(const char appendliteral(char operator+= insert cut setcapacity setlength truncate getdata getmutabledata setisvoid stripchar base classes nsastring_internal data members no public members.
...t32 i operator[] prunichar operator[](pruint32) const - source parameters pruint32 i first prunichar first() const - source last prunichar last() const - source countchar pruint32 countchar(prunichar) const - source parameters prunichar <anonymous> findchar print32 findchar(prunichar, pruint32) const - source parameters prunichar <anonymous> pruint32 offset equals prbool equals(const nsastring_internal&) const - source equality parameters nsastring_internal& <anonymous> prbool equals(const nsastring_internal&, const nsstringcomparator&) const - source parameters nsastring_internal& <anonymous> nsstringcomparator& <anonymous> prbool equals(const prunichar*) const - source parameters prunichar* data prbool equals(const prunich...
...t32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring_internal&, pruint32) - source parameters nsastring_internal& str pruint32 pos void insert(const nssubstringtuple&, pruint32) - source parameters nssubstringtuple& tuple pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength setcapacity void setcapacity(pruint32) - source buffer sizing parameters pruint32 newcapacity setlength void setlength(pruint32) - source parameters pruint32 newlength truncate void truncate(pruint32) - source parameters pruint32 newlength getdata pruint32 getdata(const prunichar**) const - source get a const pointer to the string's internal buffer.
...And 2 more matches
mozIJSSubScriptLoader
method overview jsval loadsubscript(in string url, in object targetobj optional, in string charset optional); jsval loadsubscriptwithoptions(in string url, in object options); methods loadsubscript() synchronously loads and executes the script from the specified url.
... jsval loadsubscript( in string url, in object targetobj optional, in string charset optional, ); example let context = {}; services.scriptloader.loadsubscript("chrome://my-package/content/foo-script.js", context, "utf-8" /* the script's encoding */); parameters url the url pointing to the script to load.
... charset an optional string to specify the character encoding of the file.
...And 2 more matches
nsIAnnotationObserver
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void onitemannotationremoved(in long long aitemid, in autf8string aname); void onitemannotationset(in long long aitemid, in autf8string aname); void onpageannotationremoved(in nsiuri auri, in autf8string aname); void onpageannotationset(in nsiuri apage, in autf8string aname); methods onitemannotationremoved() this method is called when an annotation is deleted for an item.
... onitemannotationset() this method is called when an annotation value is set for an item.
...void onitemannotationset( in long long aitemid, in autf8string aname ); parameters aitemid the item on which the annotation is to be set.
...And 2 more matches
nsIBrowserHistory
note: if removing fewer than 10 pages, calling this repeatedly is preferable over calling removepages(), since that's about the point at which the overhead of setting up a batch operation doesn't make sense anymore.
... note: if removing fewer than 10 pages, calling removepage() repeatedly is preferable over calling this, since that's about the point at which the overhead of setting up a batch operation doesn't make sense anymore.
... adobatchnotify obsolete since gecko 9.0 if set to true, the beginupdatebatch and endupdatebatch events are sent; otherwise, no notification of changes to the history is provided.
...And 2 more matches
nsICollection
it provides basic operations on those items like: getting, setting, appending, removing, and so on.
...ed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32 index); void queryelementat(in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32 index, in nsisupports item); methods appendelement() appends a new item to the collection.
... setelementat() replaces an item at a specified index in the collection with a new one.
...And 2 more matches
nsICommandLineRunner
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method overview void init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text provided by each command-line handler.
...it assumes a native character set.
... on windows the character set is utf-8, not the native codepage.
...And 2 more matches
nsIContentPrefService
nsivariant agroup); nsipropertybag2 getprefsbyname(in astring aname); boolean haspref(in nsivariant agroup, in astring aname); void removegroupedprefs(); void removeobserver(in astring aname, in nsicontentprefobserver aobserver); void removepref(in nsivariant agroup, in astring aname); void removeprefsbyname(in astring aname); void setpref(in nsivariant agroup, in astring aname, in nsivariant avalue); attributes attribute type description dbconnection mozistorageconnection the database connection to the content preferences database.
... setpref() sets the value of a preference for a particular uri.
... void setpref( in nsivariant agroup, in astring aname, in nsivariant avalue ); parameters agroup the group for which to set a preference; this may be specified as either a uri or as a string; in either case, the group consists of all sites matching the hostname portion of the specified uri.
...And 2 more matches
nsIDOMChromeWindow
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void beginwindowmove(in nsidomevent mousedownevent); void getattention(); void getattentionwithcyclecount(in long acyclecount); void maximize(); void minimize(); void notifydefaultbuttonloaded(in nsidomelement defaultbutton); void restore(); void setcursor(in domstring cursor); attributes attribute type description browserdomwindow nsibrowserdomwindow the related nsibrowserdomwindow instance which provides access to yet another layer of utility functions by chrome script.
...if set to -1, cycles indefinitely until window is brought into the foreground.
...when this method is called on windows, gecko moves the mouse cursor to center of the button if the auto cursor snap setting is enabled on the system.
...And 2 more matches
nsIDOMWindow
it represents a single window object that may contain child windows if the document in the window contains an html frameset document, or if the document contains iframe elements.
... name domstring get or set the name of this window.
... textzoom float get or set the document scale factor as a multiplier of the default size.
...And 2 more matches
nsIINIParser
ini sections are * defined by square brakets and look like this: [settings] * all entries below such a section definition belong to that * section (until the next section).
...function getinivalue (inifile, section, prop) { var inifact = components.manager.getclassobjectbycontractid( "@mozilla.org/xpcom/ini-parser-factory;1", components.interfaces.nsiiniparserfactory ); var iniparser = inifact.createiniparser(inifile); try { return iniparser.getstring(section,prop); } catch(e) { return undefined; } } // usage: var lang = getinivalue(file,"setting","language"); enumerating sections this example gets a list of all the sections in the ini file.
... // get all sections in the ini file var sectenum = iniparser.getsections(); // save the sections in an array var sections = []; while (sectenum && sectenum.hasmore()) { var section = sectenum.getnext(); // add an array entry for each section sections.push(section); } enumerating keys this example shows how to fetch the values for all the keys in the section named "setting".
...And 2 more matches
nsIINIParserWriter
once the writer object is created, you can use the setstring() method to set the value of a property within a given section; the section is created if it hasn't been yet.
... method overview void setstring(in autf8string asection, in autf8string akey, in autf8string avalue); void writefile([optional] in nsifile ainifile, [optional] in unsigned long aflags); constants file writing constants these constants are specified when calling writefile(), in order to change its behavior.
... methods setstring() set the value of a property string for a particular section and key.
...And 2 more matches
nsILivemarkService
in astring name, in nsiuri siteuri, in nsiuri feeduri, in long index); nsiuri getfeeduri(in long long container); long long getlivemarkidforfeeduri(in nsiuri afeeduri); nsiuri getsiteuri(in long long container); boolean islivemark(in long long folder); void reloadalllivemarks(); void reloadlivemarkfolder(in long long folderid); void setfeeduri(in long long container, in nsiuri feeduri); void setsiteuri(in long long container, in nsiuri siteuri); void start(); void stopupdatelivemarks(); methods createlivemark() creates a new livemark.
... setfeeduri() this method sets the uri of the feed associated with a livemark container.
... void setfeeduri( in long long container, in nsiuri feeduri ); parameters container the folder id of a livemark container.
...And 2 more matches
nsILocalFileMac
obsolete since gecko 1.9.2 boolean ispackage(); void launchwithdoc(in nsilocalfile adoctoload, in boolean alaunchinbackground); void opendocwithapp(in nsilocalfile aapptoopenwith, in boolean alaunchinbackground); void setfiletypeandcreatorfromextension(in string aextension); obsolete since gecko 1.9.2 void setfiletypeandcreatorfrommimetype(in string amimetype); obsolete since gecko 1.9.2 attributes attribute type description bundledisplayname astring returns the display name of the application bundle (usually the human readable name of the application) read only.
... constants constant value description current_process_creator 0x8000000 use with setfiletype() to specify the signature of current process.
... setfiletypeandcreatorfromextension() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) sets the file type and creator code from a file extension internet config is used to determine the mapping.
...And 2 more matches
nsILoginManager
nsilogininfo logins); boolean getloginsavingenabled(in astring ahost); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); methods addlogin() stores a new login in the login manager.
... note: this method will attempt to fill out the form regardless of the setting of the signon.autofillforms preference.
...this works without a need for the master password, if one is set.
...And 2 more matches
nsIMarkupDocumentViewer
obsolete since gecko 1.8 authorstyledisabled boolean disable entire author style level (including html presentation hints) bidicharacterset octet whether to force the user's character set 1 - use the document character set 2 - use the character set chosen by the user.
...1 - the default order for the charset 2 - logical order 3 - visual order.
... defaultcharacterset acstring forcecharacterset acstring fullzoom float the amount by which to scale all lengths.
...And 2 more matches
nsIMsgCompFields
properties attribute type description attachments char * obsolete attachments obsolete, do not use anymore attachmentsarray nsisupportsarray readonly attachvcard prbool bcc astring body astring bodyisasciionly prbool cc astring characterset char * defaultcharacterset char * readonly drafid char * dsn prbool fcc astring fcc2 astring followupto char * forcemsgencoding prbool forceplaintext prbool from astring hasrecipients prbool readonly new in thunderbird 23 i...
...(bug 68784) messageid char * needtocheckcharset prbool indicates whether we need to check if the current documentcharset can represent all the characters in the message body.
... it should be initialized to true and set to false when 'send anyway' is selected by a user.
...And 2 more matches
nsIMsgHeaderParser
the caller may pass nsnull for charset and it will be interpreted as "us-ascii".
...if preserveintegrity is set to true, quote will not be removed in case the name part of the email contains a comma.
... preserveintegrity set to true, quote will not be removed return value user friendly names exceptions thrown missing exception missing description unquotephraseoraddrwstring() this function removes the quoting if you want to show the names to users.
...And 2 more matches
nsIMsgSearchTerm
attribute acstring customid; beginsgrouping attribute boolean beginsgrouping; endsgrouping attribute boolean endsgrouping; methods matchrfc822string boolean matchrfc822string(in string astring, in string charset, in boolean charsetoverride); matchrfc2047string boolean matchrfc2047string(in string astring, in string charset, in boolean charsetoverride); matchdate boolean matchdate(in prtime atime); matchstatus boolean matchstatus(in unsigned long astatus); matchpriority boolean matchpriority(in nsmsgpriorityvalue priority); matchage boolean matchage(in prtime days); matchsize boolean mat...
...status boolean matchjunkstatus(in string ajunkscore); matchjunkpercent /* * test search term match for junkpercent * * @param ajunkpercent junkpercent for message (0-100, 100 is junk) * @return true if matches */ boolean matchjunkpercent(in unsigned long ajunkpercent); matchjunkscoreorigin /* * test search term match for junkscoreorigin * @param ajunkscoreorigin who set junk score?
... * @param ascopeterm scope of search * @param aoffset offset of message in message store.
...And 2 more matches
nsINavHistoryResultNode
the indent level of the root node is set to -1.
...for other nodes, this value is set to -1.
...note: when an item is added lastmodified is set to the same value as dateadded.
...And 2 more matches
nsIPluginHost
void reloadplugins(in boolean reloadpages); void setisscriptableinstance(in nsiplugininstance ainstance, in boolean ascriptable); native code only!
... obsolete since gecko 2.0 void setupplugininstance(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); native code only!
... on failure outpostdata and outpostdatalen will be set in 0.
...And 2 more matches
nsIPrincipal
void setcanenablecapability(in string capability, in short canenable); native code only!
...setting this has no effect on the uri.
...the order is significant; if an operation is performed on a set of capabilities, the minimum is computed.
...And 2 more matches
nsIPrinterEnumerator
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void displaypropertiesdlg(in wstring aprinter, in nsiprintsettings aprintsettings); void enumerateprinters(out pruint32 acount,[retval, array, size_is(acount)] out wstring aresult); obsolete since gecko 1.9 void initprintsettingsfromprinter(in wstring aprintername, in nsiprintsettings aprintsettings); attributes attribute type description defaultprintername wstring the name of the system default printer.
...this is not necessarily gecko's default printer; see nsiprintsettingsservice.defaultprintername for that.
... methods displaypropertiesdlg() void displaypropertiesdlg( in wstring aprinter, in nsiprintsettings aprintsettings ); parameters aprinter aprintsettings enumerateprinters() obsolete since gecko 1.9 (firefox 3) returns an array of the names of all installed printers.
...And 2 more matches
nsIWebBrowserPersist
it is best to set this value explicitly unless you are prepared to accept the default values.
...the basic set is just & < > " for interoperability with older products that don't support α and friends.
...this includes the basic set and accented letters between 128 and 255.
...And 2 more matches
nsIWindowsRegKey
it is possible to initialize this object by setting an hkey on it.
... in that case, it is the responsibility of the consumer setting the hkey to ensure that it is a valid hkey.
... warning: setting the key does not close() the old key.
...And 2 more matches
nsIXmlRpcClient
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void init(in string serverurl); void setauthentication(in string username, in string password); void clearauthentication(in string username, in string password); void setencoding(in string encoding); void setencoding(in unsigned long type, out nsiidref uuid, out nsqiresult result); void asynccall (in nsixmlrpcclientlistener listener, in nsisupports ctxt, in string methodname, in nsisupports arguments, in pruint32 count); attributes attribute type description serverurl readonly ns...
... constants constant type description int unsigned long nsisupportsprint32 boolean unsigned long nsisupportsprbool string unsigned long nsisupportscstring double unsigned long nsisupportsdouble datetime unsigned long nsisupportsprtime array readonly unsigned long nsisupportsarray struct readonly unsigned long nsisupportsdictionary methods init() set server url.
... call this before using this object void getdata ( in string serverurl ) ; parameters serverurl url of server side object on which methods should be called setauthentication() set authentication info if needed.
...And 2 more matches
XPCOM Interface Reference
ssubscriptloadermozipersonaldictionarymoziplaceinfomoziplacesautocompletemoziregistrymozirepresentativecolorcallbackmozispellcheckingenginemozistorageaggregatefunctionmozistorageasyncstatementmozistoragebindingparamsmozistoragebindingparamsarraymozistoragecompletioncallbackmozistorageconnectionmozistorageerrormozistoragefunctionmozistoragependingstatementmozistorageprogresshandlermozistorageresultsetmozistoragerowmozistorageservicemozistoragestatementmozistoragestatementcallbackmozistoragestatementparamsmozistoragestatementrowmozistoragestatementwrappermozistoragevacuumparticipantmozistoragevaluearraymozitxttohtmlconvmozithirdpartyutilmozivisitinfomozivisitinfocallbackmozivisitstatuscallbacknsiabcardnsiaboutmodulensiabstractworkernsiaccelerometerupdatensiaccessnodensiaccessibilityservicensiac...
...ibinaryoutputstreamnsiblocklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensic...
...tentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontf...
...And 2 more matches
NS_CStringInsertData
#include "nsstringapi.h" nsresult ns_cstringinsertdata( nsacstring& astring, pruint32 aoffset, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified.
... aoffset [in] an offset into the string's internal buffer specifying where to place the given characters.
... remarks this function is defined inline as a wrapper around ns_cstringsetdatarange.
...And 2 more matches
NS_StringInsertData
#include "nsstringapi.h" nsresult ns_stringinsertdata( nsacstring& astring, pruint32 aoffset, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to be modified.
... aoffset [in] an offset into the string's internal buffer specifying where to place the given characters.
... remarks this function is defined inline as a wrapper around ns_stringsetdatarange .
...And 2 more matches
Using nsIDirectoryService
this implementation will allow you to get(), set(), define(), and undefine() nsifile.
...you can directly add a new nsifile with any property string using the nsiproperties interface: components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties) .set("myfilename", file); now, if your cost is too high to set all of these properties at once, you can register to be a callback that can provide an nsifile.
...in most cases you would set this to be true.
...And 2 more matches
XPCOM
xpcom itself provides a set of core components and classes, e.g.
...the majority of xpcom components are not part of this core set and are provided by other parts of the platform (e.g.
...unless otherwise noted you register for the topics using the nsiobserverservice.setting http request headershttp is one of the core technologies behind the web.
...And 2 more matches
Thunderbird Configuration Files
locate your profile folder before the configuration files are presented, you should know how to find your profile folder, which is where thunderbird saves all your settings on your hard drive.
...just browse to c:\documents and settings\[user name]\application data\thunderbird\profiles\ on windows xp/2000 or c:\users\[user name]\appdata\roaming\thunderbird\profiles\ on windows vista, and the rest should be obvious.
...you will be taken to the "real" folder, which is normally c:\documents and settings\[user name]\application data on windows xp/2000, c:\users\[user name]\appdata\roaming on windows vista.
...And 2 more matches
Using tab-modal prompts
disabling tab-modal prompts you can disable tab-modal prompts and get back window-modal prompts by setting the prompts.tab_modal.enabled preference to false.
...you can force a prompt to be tab-modal using code like this: var thewindow = gbrowser.contentwindow; let prompt = components.classes["@mozilla.org/prompter;1"] .getservice(components.interfaces.nsipromptfactory) .getprompt(thewindow, components.interfaces.nsiprompt); let bag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); bag.setpropertyasbool("allowtabmodal", true); the var "thewindow" is a reference to the dom window.
... even if you set it to the browser window ("var thewindow = window") the modal alert will be shown in the current tab.
...And 2 more matches
Working with windows in chrome code
"onload();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script><![cdata[ var gstatus, gprogressmeter; var maxprogress = 100; function onload() { gstatus = document.getelementbyid("status"); gprogressmeter = document.getelementbyid("progressmeter"); if("arguments" in window && window.arguments.length > 0) { maxprogress = window.arguments[0].maxprogress; setprogress(window.arguments[0].progress); setstatus(window.arguments[0].status); } } function setprogress(value) { gprogressmeter.value = 100 * value / maxprogress; } function setstatus(text) { gstatus.value = "status: " + text + "..."; } ]]></script> <label id="status" value="(no status)" /> <hbox> <progressmeter id="progressmeter" mode="determined" /> <button label="cancel" oncom...
...indow, url, windowname, features) { var array = components.classes["@mozilla.org/array;1"] .createinstance(components.interfaces.nsimutablearray); for (var i = 4; i < arguments.length; i++) { var variant = components.classes["@mozilla.org/variant;1"] .createinstance(components.interfaces.nsiwritablevariant); variant.setfromvariant(arguments[i]); array.appendelement(variant, false); } var watcher = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher); return watcher.openwindow(parentwindow, url, windowname, features, array); } the function almost works the same as window.opendialog but accepts an option...
... advanced data sharing the above code is useful when you need to pass data from one window to another or to a set of windows, but sometimes you just want to share a javascript variable in common between different windows.
...And 2 more matches
Plug-in Basics - Plugins
/usr/lib64/firefox/plugins (for 64-bit firefox) note: firefox nightly checks a subset of these locations.
...the plug-in application programming interface (api) is made up of two groups of functions and a set of shared data structures.
... </object> the first set of object element attributes are urls.
...And 2 more matches
URLs - Plugins
if the target parameter is set to null, the application creates a new stream and delivers the data to the plug-in instance, through calls to npp_newstream, npp_writeready and npp_write, and npp_destroystream.
... _parent: load the url into the immediate frameset parent of the plug-in instance document.
...to post a file, set the flag file to true, the buffer buf to the path name string for a file, and len to the length of the path string.
...And 2 more matches
Gecko Plugin API Reference - Plugins
or mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shutdown initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless...
... npp_destroy npp_destroystream npp_getvalue np_getvalue npp_handleevent np_initialize npp_new npp_newstream npp_print npp_setvalue npp_setwindow np_shutdown npp_streamasfile npp_urlnotify npp_write npp_writeready browser side plug-in api this chapter describes methods in the plug-in api that are available from the browser.
... npn_setvalue sets windowless plug-in as transparent or opaque.
...And 2 more matches
UI Tour - Firefox Developer Tools
set directory root changes the source list view so that only that item and its children are visible.
... a settings menu that contains: disable javascript: disables javascript for this tab.
... this option enables you to see how your web page looks if the user has disabled javascript via an extension or a configuration setting.
...And 2 more matches
Debugger.Frame - Firefox Developer Tools
offset the offset of the bytecode instruction currently being executed in script, or undefined if the frame’s script property is null.
... if multiple debugger instances each have debugger.frame instances for a given stack frame with onstep handlers set, their handlers are run in an unspecified order.
... when this handler is called, this frame’s current execution location, as reflected in its offset and environment properties, is the operation which caused it to be unwound.
...And 2 more matches
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
visit the url about:config, and set the devtools.chrome.enabled preference to true: setting the 'devtools.chrome.enabled' preference open a developer scratchpad (menu button > developer > scratchpad), and select "browser" from the "environment" menu.
... site = components.utils.waivexrays(site.frame); if (!counts.has(site)) counts.set(site, 0); counts.set(site, counts.get(site) + 1); } // walk from each site that allocated something up to the // root, computing allocation totals that include // children.
... var totals = new map; for (let [site, count] of counts) { for(;;) { if (!totals.has(site)) totals.set(site, 0); totals.set(site, totals.get(site) + count); if (!site) break; site = site.parent; } } // compute parent-to-child links, since saved stack frames // have only parent links.
...And 2 more matches
DevTools API - Firefox Developer Tools
closetoolbox(target) closes the toolbox for given target.
... zoomreset() resets the zoom level of the toolbox document.
... setzoom(value) set the zoom level to an arbitrary value.
...And 2 more matches
All keyboard shortcuts - Firefox Developer Tools
command windows macos linux cycle through tools left to right ctrl + ] cmd + ] ctrl + ] cycle through tools right to left ctrl + [ cmd + [ ctrl + [ toggle between active tool and settings.
... command windows macos linux increase font size ctrl + + cmd + + ctrl + + decrease font size ctrl + - cmd + - ctrl + - reset font size ctrl + 0 cmd + 0 ctrl + 0 source editor this table lists the default shortcuts for the source editor.
... in the editor preferences section of the developer tools settings, you can choose to use vim, emacs, or sublime text key bindings instead.
...And 2 more matches
Migrating from Firebug - Firefox Developer Tools
examine css shorthand properties css shorthand properties can be split into their related longhand properties by setting the option expand shorthand properties within the style side panel.
...to stop the script execution there, you need to set a breakpoint on the line with the modification within the debugger panel.
... managing breakpoints in firebug you can set different types of breakpoints, which are all listed within the breakpoints side panel.
...And 2 more matches
Tips - Firefox Developer Tools
settings: choose between a light and a dark theme for the developer tools.
... check "enable persistent logs" in the settings to keep logged messages from before even after navigation.
... check "enable timestamps" in the settings to show timestamps besides the logged messages.
...And 2 more matches
Toolbox - Firefox Developer Tools
extra tools next there's an array of buttons that can be added or removed in the developer tool settings.
... the following tools are not included in the toolbar by default, but you can add them in the settings: highlight painted area 3d view (note that this is not available in firefox 40) scratchpad grab a color from the page take a screenshot of the entire page: take a screenshot of the complete web page and saves it in your downloads directory toggle rulers for the page measure a portion of the page: measure a part of the website by selecting areas within the page toolbox controls finally there's a row of buttons to: close the window toggle the window between attached to the bottom of the br...
...owser window, and attached to the side of the browser window toggle the window between standalone and attached to the browser window access developer tool settings settings see the separate page on the developer tools settings.
...And 2 more matches
Firefox Developer Tools
firefox developer tools is a set of web developer tools built into firefox.
... the ellipsis menu on the right-hand side of developer tools contains several commands that let you perform actions or change tool settings.
...(note: this feature is not turned on by default and must be enabled in settings before the icon will appear.) toggles responsive design mode.
...And 2 more matches
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
in addition, it can execute multiple instances of a set of elements.
... syntax void ext.drawelementsinstancedangle(mode, count, type, offset, primcount); parameters mode a glenum specifying the type primitive to render.
...possible values are: gl.unsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying an offset in the element array buffer.
...And 2 more matches
AddressErrors - Web APIs
} } this code creates a new paymentrequest, providing the supported handlers and payment options we set up above, as well as additional options (in this case, that we want to ask for shipping information).
... after that, we set up the handler for the shippingaddresschange event so we can validate address information and call the request's show() method to start running the payment ui.
... that's done by removing all shipping options currently set on the request, then set up an object named shippingaddresserrors which contains a country property which is an error message describing why the stated country isn't being permitted as a value.
...And 2 more matches
Animation.updatePlaybackRate() - Web APIs
the updateplaybackrate() method of the web animations api's animation interface sets the speed of an animation after first synchronizing its playback position.
...in such a case, setting the playbackrate on the animation directly may cause the animation's playback position to jump since its playback position on the main thread may have drifted from the playback position where it is currently running.
... updateplaybackrate() is an asynchronous method that sets the speed of an animation after synchronizing with its current playback position, ensuring that the resulting change in speed does not produce a sharp jump.
...And 2 more matches
AudioBufferSourceNode.loopEnd - Web APIs
the loopend property of the audiobuffersourcenode interface specifies is a floating point number specifying, in seconds, at what offset into playing the audiobuffer playback should loop back to the time indicated by the loopstart property.
... syntax audiobuffersourcenode.loopend = endoffsetinseconds; var endoffsetinseconds = audiobuffersourcenode.loopend; value a floating-point number indicating the offset, in seconds, into the audio buffer at which each loop will loop return to the beginning of the loop (that is, the current play time gets reset to audiobuffersourcenode.loopstart).
...for example, if you set their values to 20 and 25, respectively, then begin playback, the sound will play normally until it reaches the 25 second mark.
...And 2 more matches
AudioBufferSourceNode - Web APIs
if there's no buffer set—that is, if buffer is null—the output contains a single channel of silence (every sample is 0).
... audiobuffersourcenode.buffer an audiobuffer that defines the audio asset to be played, or when set to the value null, defines a single channel of silence (in which every sample is 0.0).
... audiobuffersourcenode.loop a boolean attribute indicating if the audio asset must be replayed when the end of the audiobuffer is reached.
...And 2 more matches
AudioWorkletNodeOptions - Web APIs
if the number of inputs and number of outputs are both set to 0, a notsupportederror will be thrown and the node construction process aborted.
... if outputchannelcount isn't specified, and numberofinputs and numberofoutputs are both 1, the audioworkletnode's initial channel count is set to 1.
... this has the effect of changing the output channel count to dynamically change to the computed number of channels, based on the input's channel count and the current setting of the audionode property channelcountmode.
...And 2 more matches
writeValue() - Web APIs
the bluetoothremotegattdescriptor.writevalue() method sets the value property to the bytes contained in an arraybuffer and returns a promise.
...}) parameters array sets the value with the bytes contained in the array.
... full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
...And 2 more matches
CanvasRenderingContext2D.getLineDash() - Web APIs
if the number, when setting the elements, is odd, the elements of the array get copied and concatenated.
... for example, setting the line dash to [5, 15, 25] will result in getting back [5, 15, 25, 5, 15, 25].
... examples getting the current line dash setting this example demonstrates the getlinedash() method.
...And 2 more matches
CanvasRenderingContext2D.shadowColor - Web APIs
note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
... one of the shadowblur, shadowoffsetx, or shadowoffsety properties must be non-zero, as well.
...the shadowcolor property sets the shadows' color, while shadowoffsetx and shadowoffsety set their position relative to the shapes.
...And 2 more matches
Basic usage of canvas - Web APIs
at the end of this page, you will know how to set up a canvas 2d context and have drawn a first example in your browser.
...these are both optional and can also be set using dom properties.
... <!doctype html> <html> <head> <meta charset="utf-8"/> <title>canvas tutorial</title> <script type="text/javascript"> function draw() { var canvas = document.getelementbyid('tutorial'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); } } </script> <style type="text/css"> canvas { border: 1px solid black; } </style> </head> <body onload="draw();"> <ca...
...And 2 more matches
Pixel manipulation with canvas - Web APIs
for example, to read the blue component's value from the pixel at column 200, row 50 in the image, you would do the following: bluecomponent = imagedata.data[((50 * (imagedata.width * 4)) + (200 * 4)) + 2]; if given a set of coordinates (x and y), you may end up doing something like this: var xcoord = 50; var ycoord = 100; var canvaswidth = 1024; function getcolorindicesforcoord(x, y, width) { var red = y * (width * 4) + x * 4; return [red, red + 1, red + 2, red + 3]; } var colorindices = getcolorindicesforcoord(xcoord, ycoord, canvaswidth); var redindex = colorindices[0]; var greenindex = colorindices[1];...
...all pixels are preset to transparent black (all zeroes i.e rgba(0,0,0,0)).
...the new object's pixels are all preset to transparent black.
...And 2 more matches
ConvolverNode.normalize - Web APIs
the normalize property of the convolvernode interface is a boolean that controls whether the impulse response from the buffer will be scaled by an equal-power normalization when the buffer attribute is set, or not.
...if normalize is set to false, then the convolution will be rendered with no pre-processing/scaling of the impulse response.
... changes to this value do not take effect until the next time the buffer attribute is set.
...And 2 more matches
DataTransfer.dropEffect - Web APIs
when the datatransfer object is created, dropeffect is set to a string value.
...on setting, if the new value is one of the values listed below, then the property's current value will be set to the new value and other values will be ignored.
... for the drop and dragend events, dropeffect will be set to the action that was desired, which will be the value dropeffect had after the last dragenter or dragover event.
...And 2 more matches
DataTransfer.effectAllowed - Web APIs
this property should be set in the dragstart event to set the desired drag effect for the drag source.
... within the dragenter and dragover event handlers, this property will be set to whatever value was assigned during the dragstart event, thus effectallowed may be used to determine which effect is permitted.
... uninitialized the default value when the effect has not been set, equivalent to all.
...And 2 more matches
Introduction to the DOM - Web APIs
document.getelementbyid(id) document.getelementsbytagname(name) document.createelement(name) parentnode.appendchild(node) element.innerhtml element.style.left element.setattribute() element.getattribute() element.addeventlistener() window.content window.onload window.scrollto() testing the dom api this document provides samples for every interface that you can use in your own web development.
...to run examples that only demonstrate the basic relationship of the interface to the html elements, you may want to set up a test page in which interfaces can be easily accessed from scripts.
... the following very simple web page provides a <script> element in the header in which you can place functions that test the interface, a few html elements with attributes that you can retrieve, set, or otherwise manipulate, and the web user interface necessary to call those functions from the browser.
...And 2 more matches
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
for example, setting fill to "none" means the animation's effects are not applied to the element if the current time is outside the range of times during which the animation is running, while "forwards" ensures that once the animation's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame.
...forwards makes the rabbit retain its last keyframe rather than reverting to its unanimated state: // create a set of keyframes to slide the rabbit down the hole--and keep him down with 'fill'!
... 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.
...And 2 more matches
Element: click event - Web APIs
usage notes the mouseevent object passed into the event handler for click has its detail property set to the number of times the target was clicked.
...this counter resets after a short interval without any clicks occurring; the specifics of how long that interval is may vary from browser to browser and across platforms.
... known workarounds for this bug: for ie9 only: set background-color: rgba(0,0,0,0) set opacity: 0 and an explicit background-color other than transparent for ie8 and ie9: set filter: alpha(opacity=0); and an explicit background-color other than transparent safari mobile safari mobile 7.0+ (and likely earlier versions too) suffers from a bug where click events aren't fired on elements that aren't typically interactive (e.g.
...And 2 more matches
Element: mousedown event - Web APIs
its functionality is simple: the thickness of the line is set to 1, and the color is always black.
...first we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
... the mouseup event draws the final line segment, sets x and y to 0, and stops further drawing by setting isdrawing to false.
...And 2 more matches
Element: mousemove event - Web APIs
its functionality is simple: the thickness of the line is set to 1, and the color is always black.
...first we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
... the mouseup event draws the final line segment, sets x and y to 0, and stops further drawing by setting isdrawing to false.
...And 2 more matches
Element: mouseup event - Web APIs
its functionality is simple: the thickness of the line is set to 1, and the color is always black.
...first we store the x and y coordinates of the mouse pointer in the variables x and y, and then set isdrawing to true.
... the mouseup event draws the final line segment, sets x and y to 0, and stops further drawing by setting isdrawing to false.
...And 2 more matches
Element.scrollLeft - Web APIs
the element.scrollleft property gets or sets the number of pixels that an element's content is scrolled from its left edge.
... setting the value // set the number of pixels scrolled element.scrollleft = 10; scrollleft can be specified as any integer value.
... however: if the element can't be scrolled (e.g., it has no overflow), scrollleft is set to 0.
...And 2 more matches
Element.scrollTop - Web APIs
WebAPIElementscrollTop
the element.scrolltop property gets or sets the number of pixels that an element's content is scrolled vertically.
... // set the number of pixels scrolled.
... element.scrolltop = intvalue; scrolltop can be set to any integer value, with certain caveats: if the element can't be scrolled (e.g.
...And 2 more matches
Introduction to the File and Directory Entries API - Web APIs
it can improve performance by letting an app pre-fetch assets in the background and cache locally.
... video game or other apps with lots of media assets the app downloads one or several large tarballs and expands them locally into a directory structure.
... the app pre-fetches assets in the background, so the user can go to the next task or game level without waiting for a download.
...And 2 more matches
Frame Timing API - Web APIs
performance frames the performanceframetiming interface extends the following performanceentry properties (for "frame" performance entry types) by qualifying and constrainting the properties as follows: performanceentry.entrytype set to "frame".
... performanceentry.name set to the document's address.
... performanceentry.starttime set to the domhighrestimestamp when the frame was started.
...And 2 more matches
Guide to the Fullscreen API - Web APIs
view live examples watching for the enter key when the page is loaded, this code is run to set up an event listener to watch for the enter key.
...alternate name alternate name uses the non-standard name: webkitisfullscreenfirefox full support 64 full support 64 no support 49 — 65disabled disabled from version 49 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true).
...e name alternate name uses the non-standard name: webkitisfullscreenfirefox android full support 64 full support 64 no support 49 — 65disabled disabled from version 49 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true).
...And 2 more matches
GlobalEventHandlers.onanimationiteration - Web APIs
we set its size, position, color, and layout.
... var box = document.getelementbyid("box"); var iterationcounter = 0; box.onanimationiteration = function(event) { box.style.animationplaystate = "paused"; document.getelementbyid("play").innerhtml = "start iteration #" + (iterationcounter+1); }; this sets up two global variables: box, which references the "box" element that we're animating, and iterationcounter, which is initially zero, which indicates how many iterations of the animation have occurred.
... the onanimationiteration event handler is then set up.
...And 2 more matches
HTMLImageElement.currentSrc - Web APIs
this is useful when you provide multiple image options using the sizes and/or htmlimageelement.srcset properties.
... currentsrc lets you determine which image from the set of provided images was selected by the browser.
... 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.body.appendchild(p);...
...And 2 more matches
HTMLLinkElement - Web APIs
htmllinkelement.crossorigin is a domstring that corresponds to the cors setting for this link element.
... see cors settings attributes for details.
... htmllinkelement.sizes read only is a domsettabletokenlist that reflects the sizes html attribute, as a list of tokens.
...And 2 more matches
HTMLMediaElement.load() - Web APIs
the htmlmediaelement method load() resets the media element to its initial state and begins the process of selecting a media source and loading the media in preparation for playback to begin at the beginning.
... this method is generally only useful when you've made dynamic changes to the set of sources available for the media element, either by changing the element's src attribute or by adding or removing <source> elements nested within the media element itself.
... load() will reset the element and rescan the available sources, thereby causing the changes to take effect.
...And 2 more matches
HTMLSelectElement - Web APIs
htmlselectelement.optionsread only an htmloptionscollection representing the set of <option> (htmloptionelement) elements contained by this element.
... htmlselectelement.selectedoptionsread only an htmlcollection representing the set of <option> elements that are selected.
... htmlselectelement.typeread only a domstring represeting the form control's type.
...And 2 more matches
HTMLSlotElement.name - Web APIs
the name property of the htmlslotelement interface returns or sets the slot name.
... 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...And 2 more matches
HTMLVideoElement.msZoom - Web APIs
mszoom is a read/write property which gets or sets whether the video frame is trimmed, on the top and bottom or left and right, to fit the video display.
... syntax htmlvideoelement.mszoom; value boolean value set to true trims the video frame to the display space.
... set to false the video frame uses letter box or pillarbox to display video.
...And 2 more matches
In depth: Microtasks and the JavaScript runtime environment - Web APIs
starting with the addition of timeouts and intervals as part of the web api (settimeout() and setinterval()), the javascript environment provided by web browsers has gradually advanced to include powerful features that enable scheduling of tasks, multi-threaded application development, and so forth.
... using execution contexts in this manner, each program and function is able to have its own set of variables and other objects.
... run, javascript, run to run javascript code, the runtime engine maintains a set of agents in which to execute javascript code.
...And 2 more matches
History.pushState() - Web APIs
WebAPIHistorypushState
if this parameter isn't specified, it's set to the document's current url.
... description in a sense, calling pushstate() is similar to setting window.location = "#foo", in that both will also create and activate another history entry associated with the current document.
...in contrast, setting window.location keeps you at the same document only if you modify only the hash.
...And 2 more matches
Working with the History API - Web APIs
this parameter is optional; if it isn't specified, it's set to the document's current url.
... in a sense, calling pushstate() is similar to setting window.location = "#foo", in that both will also create and activate another history entry associated with the current document.
...in contrast, setting window.location keeps you at the same document only if you modify only the hash.
...And 2 more matches
MediaStreamTrack.applyConstraints() - Web APIs
the applyconstraints() method of the mediastreamtrack interface applies a set of constraints to the track; these constraints let the web site or app establish ideal values and acceptable ranges of values for the constrainable properties of the track, such as frame rate, dimensions, echo cancelation, and so forth.
...see applying constraints in capabilities, constraints, and settings for more information on how to apply your preferred constraints.
...if this parameter is omitted, all currently set custom constraints are cleared.
...And 2 more matches
MediaStream Recording API - Web APIs
overview of the recording process the process of recording a stream is simple: set up a mediastream or htmlmediaelement (in the form of an <audio> or <video> element) to serve as the source of the media data.
... set mediarecorder.ondataavailable to an event handler for the dataavailable event; this will be called whenever data is available for you.
...you can listen for error events by setting up a onerror event handler.
...And 2 more matches
MediaTrackConstraints.cursor - Web APIs
see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints.
... usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's video mediastreamtrack, then checking the value of the returned mediatracksettings object's cursor object.
... 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 rendered into the stream already.
...And 2 more matches
MutationObserverInit.characterDataOldValue - Web APIs
the mutationobserverinit dictionary's optional characterdataoldvalue property is used to specify whether or not the mutationrecord.oldvalue property for dom mutations should be set to the previous value of text nodes which changed.
... if you set the mutationobserverinit.characterdata property to true but don't set characterdataoldvalue to true as well, the mutationrecord will not include information describing the prior state of the text node's contents.
... syntax var options = { characterdataoldvalue: true | false } value a boolean value indicating whether or not to set the mutationrecord's oldvalue property to be a string containing the value of the character node's contents prior to the change represented by the mutation record.
...And 2 more matches
OscillatorNode.type - Web APIs
you never set type to custom manually; instead, use the setperiodicwave() method to provide the data representing the waveform.
... doing so automatically sets the type to custom.
...to set a custom waveform, just call setperiodicwave().
...And 2 more matches
PaymentResponse.shippingAddress - Web APIs
you can trigger this by setting paymentoptions.requestshipping to true when calling the paymentrequest constructor.
...when the paymentrequest.onshippingaddresschange is called, updatedetails() is called to update the details of the paymentrequest, using shippingaddress to set the correct shipping cost.
... 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
...And 2 more matches
PaymentResponse - Web APIs
this option is only present when the requestpayeremail option is set to true in the options parameter of the paymentrequest() constructor.
...this option is only present when the requestpayername option is set to true in the options parameter of the paymentrequest() constructor.
...this option is only present when the requestpayerphone option is set to true in the options parameter of the paymentrequest() constructor.
...And 2 more matches
performance.measure() - Web APIs
the measure's performance entry will have the following property values: entrytype - set to "measure".
... name - set to the "name" given when the measure was created.
... starttime - set to the start mark timestamp.
...And 2 more matches
PeriodicWave - Web APIs
periodicwave has no inputs or outputs; it is used to define custom oscillators when calling oscillatornode.setperiodicwave().
...if you wish to establish custom property values at the outset, use the audiocontext.createperiodicwave() factory method instead.
... var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag, {disablenormalization: true}); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values.
...And 2 more matches
Using the Permissions API - Web APIs
"denied" the "enable geolocation" button is revealed (this code needs to be here too, in case the permission state is already set to denied for this origin when the page is first loaded).
... function handlepermission() { navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state == 'granted') { report(result.state); geobtn.style.display = 'none'; } else if (result.state == 'prompt') { report(result.state); geobtn.style.display = 'none'; navigator.geolocation.getcurrentposition(revealposition,positiondenied,geosettings); } else if (result.state == 'denied') { report(result.state); geobtn.style.display = 'inline'; } result.onchange = function() { report(result.state); } }); } function report(state) { console.log('permission ' + state); } handlepermission(); permission descriptors the permissions.query() method takes a permissiondescriptor dictionary as a parameter �...
...it can be re-enabled by setting the preference dom.permissions.revoke.enable to true.
...And 2 more matches
Pointer Lock API - Web APIs
if that happens, movementx and movementy could be set to zero.
... simple example walkthrough we've written a simple pointer lock demo to show you how to use it to set up a simple control system (see source code).
... we set initial x and y positions on the canvas: var x = 50; var y = 50; the pointer lock methods are currently prefixed, so next we'll fork them for the different browser implementations.
...And 2 more matches
RTCPeerConnection: icecandidate event - Web APIs
an icecandidate event is sent to an rtcpeerconnection when an rtcicecandidate has been identified and added to the local peer by a call to rtcpeerconnection.setlocaldescription().
... the event handler should transmit the candidate to the remote peer over the signaling channel so the remote peer can add it to its set of remote candidates.
... indicating that ice gathering is complete once all ice transports have finished gathering candidates and the value of the rtcpeerconnection object's icegatheringstate has made the transition to complete, an icecandidate event is sent with the value of complete set to null.
...And 2 more matches
ReadableStream.ReadableStream() - Web APIs
the contents of this method are defined by the developer, and should aim to get access to the stream source, and do anything else required to set up the stream fuctionality.
...this can be used by the developer to control the stream during set up.
...if it is included with a value set to "bytes", the passed controller object will be a readablebytestreamcontroller capable of handling a byob (bring your own buffer)/byte stream.
...And 2 more matches
SVGSVGElement - Web APIs
this method is most useful at the very end of a set of svg dom calls to ensure that all pending suspendredraw() method calls have been cancelled.
... svgsvgelement.setcurrenttime() adjusts the clock for this svg document fragment, establishing a new current time.
... if setcurrenttime() is called before the document timeline has begun (for example, by script running in a <script> element before the document's svgload event is dispatched), then the value of seconds in the last invocation of the method gives the time that the document will seek to once the document timeline has begun.
...And 2 more matches
Screen Capture API - Web APIs
mediatracksettings mediatracksettings.cursor a string which indicates whether or not the display surface currently being captured includes the mouse cursor, and if so, whether it's only visible while the mouse is in motion or if it's always visible.
... mediatracksettings.displaysurface a string indicating what type of display surface is currently being captured.
... mediatracksettings.logicalsurface a boolean value which is true if the video being captured doesn't directly correspond to a single onscreen display area.
...And 2 more matches
Slottable: assignedSlot - Web APIs
syntax var slotelement = elementinstance.assignedslot value an htmlslotelement instance, or null if the element is not assigned to a slot, or if the associated shadow root was attached with its mode set to closed (see element.attachshadow for further details).
... 53edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...And 2 more matches
StaticRange - Web APIs
it offers the same set of properties and methods as abstractrange.
...the offset into the node at which the end position is located is indicated by endoffset.
... staticrange.endoffset read only returns an integer value indicating the offset into the node given by endcontainer at which the last character of the range is found.
...And 2 more matches
SubtleCrypto.exportKey() - Web APIs
to export a key, the key must have cryptokey.extractable set to true.
...*/ async function exportcryptokey(key) { const exported = await window.crypto.subtle.exportkey( "raw", key ); const exportedkeybuffer = new uint8array(exported); const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = `[${exportedkeybuffer}]`; } /* generate an encrypt/decrypt secret key, then set up an event listener on the "export" button.
...e.exportkey( "pkcs8", key ); const exportedasstring = ab2str(exported); const exportedasbase64 = window.btoa(exportedasstring); const pemexported = `-----begin private key-----\n${exportedasbase64}\n-----end private key-----`; const exportkeyoutput = document.queryselector(".exported-key"); exportkeyoutput.textcontent = pemexported; } /* generate a sign/verify key pair, then set up an event listener on the "export" button.
...And 2 more matches
Touch - Web APIs
WebAPITouch
these values are set to describe an ellipse that as closely as possible matches the entire area of contact (such as the user's fingertip).
... touch.clientx read only returns the x coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.
... touch.clienty read only returns the y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset.
...And 2 more matches
VisualViewport - Web APIs
visualviewport.offsetleft read only returns the offset of the left edge of the visual viewport from the left edge of the layout viewport in css pixels.
... visualviewport.offsettop read only returns the offset of the top edge of the visual viewport from the top edge of the layout viewport in css pixels.
... var bottombar = document.getelementbyid('bottombar'); var viewport = window.visualviewport; function viewporthandler() { var layoutviewport = document.getelementbyid('layoutviewport'); // since the bar is position: fixed we need to offset it by the visual // viewport's offset from the layout viewport origin.
...And 2 more matches
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
syntax // read from the buffer bound to gl.pixel_unpack_buffer void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imagesize, offset); void gl.compressedtexsubimage3d(target, level, xoffset, yoffset, zoffset, width, height, depth, format, arraybufferview srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active texture.
... xoffset a glint specifying the x offset within the compressed texture image.
... yoffset a glint specifying the y offset within the compressed texture image.
...And 2 more matches
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
in addition, it can execute multiple instances of a set of elements.
... syntax void gl.drawelementsinstanced(mode, count, type, offset, instancecount); parameters mode a glenum specifying the type primitive to render.
...possible values are: gl.unsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying an offset in the element array buffer.
...And 2 more matches
WebGL2RenderingContext.drawRangeElements() - Web APIs
syntax void gl.drawrangeelements(mode, start, end, count, type, offset); parameters mode a glenum specifying the type primitive to render.
... start a gluint specifying the minimum array index contained in offset.
... end a gluint specifying the maximum array index contained in offset.
...And 2 more matches
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
syntax // webgl 1: void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, arraybufferview?
... pixels); // additionally available in webgl 2: void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, imagesize, offset); void gl.compressedtexsubimage2d(target, level, xoffset, yoffset, width, height, format, arraybufferview srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active compressed texture.
... xoffset a glint specifying the horizontal offset within the compressed texture image.
...And 2 more matches
Color masking - Web APIs
the color mask state of webgl is preserved, so we do not need to call colormask() every frame to set up the color mask.
...it allows us to setup webgl in a single initialization phase, and then just execute drawing commands for each frame.
...so, for example, clearing operation sets the value of each pixel to the chosen clear color.
...And 2 more matches
Background audio processing using AudioWorklet - Web APIs
set up any audio parameters the audioworkletnode needs, or that you wish to configure.
...this call to registerprocessor() registers your class as the basis for any audioworkletprocessors created when audioworkletnodes are set up.
...you can then change its value effective at a given time using the audioparam method setvalueattime().
...And 2 more matches
WindowOrWorkerGlobalScope - Web APIs
this object enables functionality such as storing assets for offline use, and generating custom responses to requests.
... windoworworkerglobalscope.clearinterval() cancels the repeated execution set using windoworworkerglobalscope.setinterval().
... windoworworkerglobalscope.cleartimeout() cancels the delayed execution set using windoworworkerglobalscope.settimeout().
...And 2 more matches
XMLHttpRequest() - Web APIs
setting the mozanon flag to true effectively resembles the anonxmlhttprequest() constructor described in older versions of the xmlhttprequest specification.
... const request = new xmlhttprequest(paramsdictionary); parameters (non-standard) objparameters there are two flags you can set: mozanon boolean: setting this flag to true will cause the browser not to expose the origin and user credentials when fetching resources.
... most important, this means that cookies will not be sent unless explicitly added using setrequestheader.
...And 2 more matches
XRPermissionDescriptor - Web APIs
the xrpermissiondescriptor's name must be set to xr in order to direct the permissions api to correctly handle the request as applying to webxr.
...if permission has been granted, we call a function setupxr() that handles preparing the webxr environment for use.
... if permission is conditional based on prompting, we call a function promptandsetupxr() that would handle asking for permission before enabling and starting up the environment.
...And 2 more matches
Text labels and names - Accessibility
<figure> <img src="milkweed.jgp" alt="black and white close-up photo of milkweed flowers"> <figcaption>asclepias verticillata</figcaption> </figure> fieldset elements must be labeled fieldset elements must have a text description, similar to other form elements.
... use the <legend> element to describe the purpose of a fieldset.
... use a legend to label a fieldset when grouping a set of form elements together with a <fieldset> element, you should include a nested <legend> element inside it, containing a clear description of the group.
...And 2 more matches
-moz-outline-radius - CSS: Cascading Style Sheets
/* one value */ -moz-outline-radius: 25px; /* two values */ -moz-outline-radius: 25px 1em; /* three values */ -moz-outline-radius: 25px 1em 12%; /* four values */ -moz-outline-radius: 25px 1em 12% 4mm; /* global values */ -moz-outline-radius: inherit; -moz-outline-radius: initial; -moz-outline-radius: unset; constituent properties this property is a shorthand for the following css properties: -moz-outline-radius-bottomleft -moz-outline-radius-bottomright -moz-outline-radius-topleft -moz-outline-radius-topright syntax values elliptical outlines and <percentage> values follow the syntax described in border-radius.
... if a single value is set, it applies to all 4 corners.
... if two values are set, the first one applies to the top-left and bottom-right corners and the second one to the top-right and bottom-left corners.
...And 2 more matches
@counter-style - CSS: Cascading Style Sheets
the @counter-style css at-rule lets you define counter styles that are not part of the predefined set of styles.
... @counter-style thumbs { system: cyclic; symbols: "\1f44d"; suffix: " "; } ul { list-style: thumbs; } the initial version of css defined a set of useful counter styles.
... 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.
...And 2 more matches
@keyframes - CSS: Cascading Style Sheets
from a starting offset of 0%.
... to an ending offset of 100%.
... resolving duplicates if multiple keyframe sets exist for a given name, the last one encountered by the parser is used.
...And 2 more matches
prefers-reduced-motion - CSS: Cascading Style Sheets
alternatively, add gtk-enable-animations = false to the [settings] block of the gtk 3 configuration file.
... in windows 10: settings > ease of access > display > show animations in windows.
... in ios: settings > general > accessibility > reduce motion.
...And 2 more matches
At-rules - CSS: Cascading Style Sheets
WebCSSAt-rule
/* general structure */ @identifier (rule); /* example: tells browser to use utf-8 character set */ @charset "utf-8"; there are several at-rules, designated by their identifiers, each with a different syntax: @charset — defines the character set used by the style sheet.
... nested at-rules — a subset of nested statements, which can be used as a statement of a style sheet as well as inside of conditional group rules: @media — a conditional group rule that will apply its content if the device meets the criteria of the condition defined using a media query.
...(currently at the working draft stage) @counter-style — defines specific counter styles that are not part of the predefined set of styles.
...And 2 more matches
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 this beginner's learning article we go through all the basic fundamentals of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.
...these are all referred to as opentype features, and are made available to use on the web via specific properties and a low-level control property — font-feature-settings.
...And 2 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
a grid is a set of intersecting horizontal and vertical lines defining columns and rows.
...this sets the grid to the specified pixel which fits to the layout you desire.
... you can also define a set size for tracks created in the implicit grid with the grid-auto-rows and grid-auto-columns properties.
...And 2 more matches
Subgrid - CSS: Cascading Style Sheets
if you set the value subgrid on grid-template-columns, grid-template-rows or both, instead of creating a new track listing the nested grid uses the tracks defined on the parent.
... subgrid for rows the next example is the same setup, however we are using subgrid as the value of grid-template-rows and defining explicit column tracks.
...the subgrid has row-gap set to 0.
...And 2 more matches
Logical properties for sizing - CSS: Cascading Style Sheets
logical property physical property inline-size width block-size height min-inline-size min-width min-block-size min-height max-inline-size max-width max-block-size max-height width and height example the logical mappings for width and height are inline-size, which sets the length in the inline dimension and block-size, which sets the length in the block dimension.
... in the live example below i have set the writing mode to horizontal-tb.
...these work in the same way as the inline-size and block-size properties, but setting a minimum rather than a fixed size.
...And 2 more matches
CSS Scrollbars - CSS: Cascading Style Sheets
noedge no support nofirefox full support 64 full support 64 full support 63disabled disabled from version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true).
... nochrome android no support nofirefox android full support 64 full support 64 full support 63disabled disabled from version 63: this feature is behind the layout.css.scrollbar-width.enabled preference (needs to be set to true).
...bviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetscrollbar-colorchrome no support noedge no support nofirefox full support 64notes full support 64notes notes on macos, you need to set the general > show scroll bars setting in system preferences to "always" for this property to have any effect.
...And 2 more matches
Overview of CSS Shapes - CSS: Cascading Style Sheets
the specification defines three new properties: shape-outside — allows definition of basic shapes shape-image-threshold — sets an opacity threshold value.
... shape-margin — sets a margin around the defined shape defining basic shapes the shape-outside property allows us to a define a shape.
...the specification defines four <basic-shape> values, which are: inset() circle() ellipse() polygon() using the value inset() wraps text around a rectangular shape however you are able to add offset values, thus pulling the line boxes of any wrapping content closer to the object than would otherwise happen.
...And 2 more matches
Using CSS transforms - CSS: Cascading Style Sheets
css transforms are implemented using a set of css properties that let you apply affine linear transformations to html elements.
... perspective the first element to set is the perspective.
... setting perspective this example shows a cube with the perspective set at different positions.
...And 2 more matches
CSS values and units - CSS: Cascading Style Sheets
there are a common set of data types -- values and units -- that css properties accept.
...be a <custom-ident>, so if we had a grid area named content we would use it without quotes: .item { grid-area: content; } in comparison, a data type that is a <string>, such as a string value of the content property, must be quoted: .item::after { content: "this is my content."; } while you can generally create any name you want, including using emojis, the identifier can't be none, unset, initial, or inherit, start with a digit or two dashes, and generally you don't want it to be any other pre-defined css keyword.
... left | right | none | inline-start | inline-end such values are used without quotes: .box { float: left; } css-wide values in addition to the pre-defined keywords that are part of the specification for a property, all css properties accept the css-wide property values initial, inherit, and unset, which explicitly specify defaulting behaviors.
...And 2 more matches
Value definition syntax - CSS: Cascading Style Sheets
css value definition syntax, a formal grammar, is used for defining the set of valid values for a css property or function.
... in addition to this syntax, the set of valid values can be further restricted by semantic constraints (for example, for a number to be strictly positive).
... the specific case of inherit, initial and unset all css properties accept the keywords inherit, initial and unset, that are defined throughout css.
...And 2 more matches
animation-delay - CSS: Cascading Style Sheets
it is often convenient to use the shorthand property animation to set all animation properties at once.
... syntax /* single animation */ animation-delay: 3s; animation-delay: 0s; animation-delay: -1500ms; /* multiple animations */ animation-delay: 2.1s, 480ms; values <time> the time offset, from the moment at which the animation is applied to the element, at which the animation should begin.
...for more information, see setting multiple animation property values.
...And 2 more matches
border-bottom - CSS: Cascading Style Sheets
the border-bottom shorthand css property sets an element's bottom border.
... it sets the values of border-bottom-width, border-bottom-style and border-bottom-color.
... as with all shorthand properties, border-bottom always sets the values of all of the properties that it can set, even if they are not specified.
...And 2 more matches
border-image-source - CSS: Cascading Style Sheets
the border-image-source css property sets the source image used to create an element's border image.
... syntax /* keyword value */ border-image-source: none; /* <image> values */ border-image-source: url(image.jpg); border-image-source: linear-gradient(to top, red, yellow); /* global values */ border-image-source: inherit; border-image-source: initial; border-image-source: unset; values none no border image is used.
...it also applies to ::first-letter.inheritednocomputed valuenone or the image with its uri made absoluteanimation typediscrete formal syntax none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...And 2 more matches
border-radius - CSS: Cascading Style Sheets
you can set a single radius to make circular corners, or two radii to make elliptical corners.
... constituent properties this property is a shorthand for the following css properties: border-bottom-left-radius border-bottom-right-radius border-top-left-radius border-top-right-radius syntax /* the syntax of the first radius allows one to four values */ /* radius is set for all 4 sides */ border-radius: 10px; /* top-left-and-bottom-right | top-right-and-bottom-left */ border-radius: 10px 5%; /* top-left | top-right-and-bottom-left | bottom-right */ border-radius: 2px 4px 2px; /* top-left | top-right | bottom-right | bottom-left */ border-radius: 1px 0 3px 4px; /* the syntax of the second radius allows one to four values */ /* (first radius values) / radius *...
...ght-and-bottom-left */ border-radius: 10px 5% / 20px 30px; /* (first radius values) / top-left | top-right-and-bottom-left | bottom-right */ border-radius: 10px 5px 2em / 20px 25px 30%; /* (first radius values) / top-left | top-right | bottom-right | bottom-left */ border-radius: 10px 5% / 20px 25em 30px 35em; /* global values */ border-radius: inherit; border-radius: initial; border-radius: unset; the border-radius property is specified as: one, two, three, or four <length> or <percentage> values.
...And 2 more matches
box-direction - CSS: Cascading Style Sheets
/* keyword values */ box-direction: normal; box-direction: reverse; /* global values */ box-direction: inherit; box-direction: initial; box-direction: unset; syntax the box-direction property is specified as one of the keyword values listed below.
... if the direction is set using the element's dir attribute, then the style is ignored.
... formal definition initial valuenormalapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | reverse | inherit examples setting box direction .example { /* bottom-to-top layout */ -moz-box-direction: reverse; /* mozilla */ -webkit-box-direction: reverse; /* webkit */ box-direction: reverse; /* as specified */ } specifications not part of any standard.
...And 2 more matches
box-sizing - CSS: Cascading Style Sheets
the box-sizing css property sets how the total width and height of an element is calculated.
...this means that when you set width and height, you have to adjust the value you give to allow for any border or padding that may be added.
...if you set an element's width to 100 pixels, then the element's content box will be 100 pixels wide, and the width of any border or padding will be added to the final rendered width, making the element wider than 100px.
...And 2 more matches
cursor - CSS: Cascading Style Sheets
WebCSScursor
the cursor css property sets the type of mouse cursor, if any, to show when the mouse pointer is over an element.
... syntax /* keyword value */ cursor: pointer; cursor: auto; /* url, with a keyword fallback */ cursor: url(hand.cur), pointer; /* url and coordinates, with a keyword fallback */ cursor: url(cursor1.png) 4 12, auto; cursor: url(cursor2.png) 2 2, pointer; /* global values */ cursor: inherit; cursor: initial; cursor: unset; the cursor property is specified as zero or more <url> values, separated by commas, followed by a single mandatory keyword value.
...these will set the cursor's hotspot, relative to the top-left corner of the image.
...And 2 more matches
<custom-ident> - CSS: Cascading Style Sheets
to prevent ambiguity, each property that uses <custom-ident> forbids the use of specific values: animation-name forbids the global css values (unset, initial, and inherit), as well as none.
... counter-reset counter-increment forbids the global css values (unset, initial, and inherit), as well as none.
... @counter-style list-style-type forbids the global css values (unset, initial, and inherit), as well as the values none, inline, and outside.
...And 2 more matches
direction - CSS: Cascading Style Sheets
WebCSSdirection
the direction css property sets the direction of text, table columns, and horizontal overflow.
... the property sets the base text direction of block-level elements and the direction of embeddings created by the unicode-bidi property.
... it also sets the default alignment of text, block-level elements, and the direction that cells flow within a table row.
...And 2 more matches
flex-basis - CSS: Cascading Style Sheets
the flex-basis css property sets the initial main size of a flex item.
... it sets the size of the content box unless otherwise set with box-sizing.
... note: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority.
...And 2 more matches
font-variant-alternates - CSS: Cascading Style Sheets
/* 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-v...
...ariant-alternates: unset; the @font-feature-values at-rule can define names for alternative glyph functions (stylistic, styleset, character-variant, swash, ornament or annotation), associating the name with opentype parameters.
... styleset() this function enables stylistic alternatives for sets of characters.
...And 2 more matches
font-variant-caps - CSS: Cascading Style Sheets
syntax /* keyword values */ font-variant-caps: normal; font-variant-caps: small-caps; font-variant-caps: all-small-caps; font-variant-caps: petite-caps; font-variant-caps: all-petite-caps; font-variant-caps: unicase; font-variant-caps: titling-caps; /* global values */ font-variant-caps: inherit; font-variant-caps: initial; font-variant-caps: unset; the font-variant-caps property is specified using a single keyword value from the list below.
... accessibility concerns large sections of text set with a font-variant value of all-small-caps or all-petite-caps may be difficult for people with cognitive concerns such as dyslexia to read.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps examples setting the small-caps font variant html <p class="small-caps">firefox rocks, small caps!</p> <p class="normal">firefox rocks, normal caps!</p> css .small-caps { font-variant-caps: small-caps; font-style: italic; } .normal { font-variant-caps: normal; font-style: italic; } result specifications specification status comment css fonts module level 3the definition of 'font-var...
...And 2 more matches
font-variant-east-asian - CSS: Cascading Style Sheets
*/ font-variant-east-asian: traditional; /* <east-asian-variant-values> */ font-variant-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.
... <east-asian-variant-values> these values specify a set of logographic glyph variants which should be used for display.
...two values are possible: proportional-width activating the set of east asian characters which vary in width.
...And 2 more matches
initial - CSS: Cascading Style Sheets
WebCSSinitial
you should consider using the inherit, unset, or revert keywords instead.
... examples using initial to reset color for an element html <p> <span>this text is red.</span> <em>this text is in the initial color (typically black).</em> <span>this is red again.</span> </p> css p { color: red; } em { color: initial; } result specifications specification status comment css cascading and inheritance level 4the definition of 'initial' in that specification.
... see also use unset to set a property to its inherited value if it inherits, or to its initial value if not.
...And 2 more matches
left - CSS: Cascading Style Sheets
WebCSSleft
syntax /* <length> values */ left: 3px; left: 2.4em; /* <percentage>s of the width of the containing block */ left: 10%; /* keyword value */ left: auto; /* global values */ left: inherit; left: initial; left: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the left edge of the containing block.
... description the effect of left depends on how the element is positioned (i.e., the value of the position property): when position is set to absolute or fixed, the left property specifies the distance between the element's left edge and the left edge of its containing block.
... (the containing block is the ancestor to which the element is relatively positioned.) when position is set to relative, the left property specifies the distance the element's left edge is moved to the right from its normal position.
...And 2 more matches
list-style-image - CSS: Cascading Style Sheets
the list-style-image css property sets an image to be used as the list item marker.
...because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items.
... syntax /* keyword values */ list-style-image: none; /* <url> values */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image: initial; list-style-image: unset; values <url> location of image to use as the marker.
...And 2 more matches
list-style-type - CSS: Cascading Style Sheets
the list-style-type css property sets the marker (such as a disc, character, or custom counter style) of a list item element.
...however, the list-style-type property may be applied to any element whose display value is set to list-item.
... moreover, because this property is inherited, it can be set on a parent element (commonly <ol> or <ul>) to make it apply to all list items.
...And 2 more matches
list-style - CSS: Cascading Style Sheets
the list-style css shorthand property allows you set all the list style properties at once.
...because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside.
... list-style-type syntax /* type */ list-style: square; /* image */ list-style: url('../img/shape.png'); /* position */ list-style: inside; /* type | position */ list-style: georgian inside; /* type | image | position */ list-style: lower-roman url('../img/shape.png') outside; /* keyword value */ list-style: none; /* global values */ list-style: inherit; list-style: initial; list-style: unset; the list-style property is specified as one, two, or three keywords in any order.
...And 2 more matches
mask-border-source - CSS: Cascading Style Sheets
the mask-border-source css property sets the source image used to create an element's mask border.
... syntax /* keyword value */ mask-border-source: none; /* <image> values */ mask-border-source: url(image.jpg); mask-border-source: linear-gradient(to top, red, yellow); /* global values */ mask-border-source: inherit; mask-border-source: initial; mask-border-source: unset; values none no mask border is used.
... formal definition initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...And 2 more matches
mask-size - CSS: Cascading Style Sheets
WebCSSmask-size
/* keywords syntax */ mask-size: cover; mask-size: contain; /* one-value syntax */ /* the width of the image (height set to 'auto') */ mask-size: 50%; mask-size: 3em; mask-size: 12px; mask-size: auto; /* two-value syntax */ /* first value: width of the image, second value: height */ mask-size: 50% auto; mask-size: 3em 25%; mask-size: auto 6px; mask-size: auto auto; /* multiple values */ /* do not confuse this with mask-size: auto auto */ mask-size: auto, auto; mask-size: 50%, 25%, 25%; mask-size: 6px, auto, contain; /* global values */ mask-size: inherit; mask-size: initial; mask-size: unset; note: if the value of this...
... property is not set in a mask shorthand property that is applied to the element after the mask-size css property, the value of this property is then reset to its initial value by the shorthand property.
... a <bg-size> can be specified in one of three ways: using the keyword contain using the keyword cover using width and height values to specify a size using width and height, you can supply one or two values: if only one value is given it sets the width, with the height set to auto.
...And 2 more matches
right - CSS: Cascading Style Sheets
WebCSSright
syntax /* <length> values */ right: 3px; right: 2.4em; /* <percentage>s of the width of the containing block */ right: 10%; /* keyword value */ right: auto; /* global values */ right: inherit; right: initial; right: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the right edge of the containing block.
... description the effect of right depends on how the element is positioned (i.e., the value of the position property): when position is set to absolute or fixed, the right property specifies the distance between the element's right edge and the right edge of its containing block.
... when position is set to relative, the right property specifies the distance the element's right edge is moved to the left from its normal position.
...And 2 more matches
scroll-snap-type - CSS: Cascading Style Sheets
the scroll-snap-type css property sets how strictly snap points are enforced on the scroll container in case there is one.
...* keyword values */ scroll-snap-type: none; scroll-snap-type: x; scroll-snap-type: y; scroll-snap-type: block; scroll-snap-type: inline; scroll-snap-type: both; /* optional mandatory | proximity*/ scroll-snap-type: x mandatory; scroll-snap-type: y proximity; scroll-snap-type: both mandatory; /* etc */ /* global values */ scroll-snap-type: inherit; scroll-snap-type: initial; scroll-snap-type: unset; syntax values none when the visual viewport of this scroll container is scrolled, it must ignore snap points.
...if content is added, moved, deleted or resized the scroll offset will be adjusted to maintain the resting on that snap point.
...And 2 more matches
text-decoration-style - CSS: Cascading Style Sheets
the text-decoration-style css property sets the style of the lines specified by text-decoration-line.
... the style applies to all lines that are set with text-decoration-line.
... when setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead.
...And 2 more matches
text-decoration - CSS: Cascading Style Sheets
the text-decoration shorthand css property sets the appearance of decorative lines on text.
... values text-decoration-line sets the kind of decoration used, such as underline or line-through.
... text-decoration-color sets the color of the decoration.
...And 2 more matches
transition-delay - CSS: Cascading Style Sheets
syntax /* <time> values */ transition-delay: 3s; transition-delay: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect.
...: width height background-color font-size left top color; transition-duration:2s; transition-delay:0.5s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 1s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top color;...
...ty: width height background-color font-size left top color; transition-duration:2s; transition-delay:1s; transition-timing-function: linear; } function updatetransition() { var el = document.queryselector("div.box"); if (el) { el.classname = "box1"; } else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-delay: 2s <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: 20px; left: 0px; top: 0px; position:absolute; -webkit-transition-property: width height background-color font-size left top color; ...
...And 2 more matches
will-change - CSS: Cascading Style Sheets
browsers may set up optimizations before an element is actually changed.
... /* keyword values */ will-change: auto; will-change: scroll-position; will-change: contents; will-change: transform; /* example of <custom-ident> */ will-change: opacity; /* example of <custom-ident> */ will-change: left, top; /* example of two <animateable-feature> */ /* global values */ will-change: inherit; will-change: initial; will-change: unset; proper usage of this property can be a bit tricky: don't apply will-change to too many elements.
...find some way to predict at least slightly ahead of time that something will change, and set will-change then.
...And 2 more matches
writing-mode - CSS: Cascading Style Sheets
the writing-mode css property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress.
... when set for an entire document, it should be set on the root element (html element for html documents).
... syntax /* keyword values */ writing-mode: horizontal-tb; writing-mode: vertical-rl; writing-mode: vertical-lr; /* global values */ writing-mode: inherit; writing-mode: initial; writing-mode: unset; the writing-mode property is specified as one of the values listed below.
...And 2 more matches
Making content editable - Developer guides
all you have to do is set the contenteditable attribute on nearly any html element to make it editable.
...</div> here's the above html in action: executing commands when an html element has contenteditable set to true, the document.execcommand() method is made available.
...you can enable them by setting the preferences shown below using about:config: user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org"); user_pref("capability.policy.allowclipboard.clipboard.cutcopy", "allaccess"); user_pref("capability.policy.allowclipboard.clipboard.paste", "allaccess"); example: a simple but complete rich text editor ...
...And 2 more matches
User input and controls - Developer guides
the following is a set of recommendations and best practices for using such tools in open web apps.
...locking the screen orientation is made possible by invoking the screen.lockorientation method, while the screen.unlockorientation method removes all the previous screen locks that have been set.
... <div draggable="true" ondragstart="event.datatransfer.setdata('text/plain', 'this text may be dragged')">
 this text <strong>may</strong> be dragged.
...And 2 more matches
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
firefox 79+) setting target="_blank" on <a> elements implicitly provides the same rel behavior as setting rel="noopener".
... obsolete attributes charsetobsolete since html5 hinted at the character encoding of the linked url.
... display: inline-block; background: #69c; color: #fff; padding: 5px 10px; } javascript var canvas = document.queryselector('canvas'), c = canvas.getcontext('2d'); c.fillstyle = 'hotpink'; function draw(x, y) { if (isdrawing) { c.beginpath(); c.arc(x, y, 10, 0, math.pi*2); c.closepath(); c.fill(); } } canvas.addeventlistener('mousemove', event => draw(event.offsetx, event.offsety) ); canvas.addeventlistener('mousedown', () => isdrawing = true); canvas.addeventlistener('mouseup', () => isdrawing = false); document.queryselector('a').addeventlistener('click', event => event.target.href = canvas.todataurl() ); result security and privacy <a> elements can have consequences for users’ security and privacy.
...And 2 more matches
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
WebHTMLElementhr
align sets the alignment of the rule on the page.
... color sets the color of the rule through color name or hexadecimal value.
... noshade sets the rule to have no shading.
...And 2 more matches
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of a given format.
... webkitrelativepath a string specifying the file's path relative to the base directory selected in a directory picker (that is, a file picker in which the webkitdirectory attribute is set).
... note: you can set as well as get the value of htmlinputelement.files in all modern browsers; this was most recently added to firefox, in version 57 (see bug 1384030).
...And 2 more matches
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
to decide which url to load, the user agent examines each <source>'s srcset, media, and type attributes to select a compatible image that best matches the current layout and capabilities of the display device.
... if providing higher-density versions of an image for high-dpi (retina) display, use srcset on the <img> element instead.
... <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
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
this information is used by the browser to determine, before laying the page out, which image defined in srcset to use.
... please note that sizes will have its effect only if width dimension descriptors are provided with srcset instead of pixel ratio values (200w instead of 2x for example).
... srcset a list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use.
...And 2 more matches
HTML: Hypertext Markup Language
WebHTML
an html element is set off from other text in a document by "tags", which consist of the element name surrounded by "<" and ">".
... introduction to html this module sets the stage, getting you used to important concepts and syntax such as looking at applying html to text, how to create hyperlinks, and how to use html to structure a web page.
... cors settings attributes some html elements that provide support for cors, such as <img> or <video>, have a crossorigin attribute (crossorigin property), which lets you configure the cors requests for the element's fetched data.
...And 2 more matches
Evolution of HTTP - HTTP
oper.mozilla.org user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) gecko/20100101 firefox/50.0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us,en;q=0.5 accept-encoding: gzip, deflate, br referer: https://developer.mozilla.org/docs/glossary/simple_header 200 ok connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: wed, 20 jul 2016 10:55:30 gmt etag: "547fa7e369ef56031dd3bff2ace9fc0832eb251a" keep-alive: timeout=5, max=1000 last-modified: tue, 19 jul 2016 00:59:33 gmt server: apache transfer-encoding: chunked vary: cookie, accept-encoding (content) get /static/img/header-background.png http/1.1 host: developer.cdn.mozilla.net user-agent: mozilla/5.0 (macintosh; intel mac os x 10.9; rv:50.0) g...
... since 2005, the set of apis available to web pages greatly increased and several of these apis created extensions, mostly new specific http headers, to the http protocol for specific purposes: server-sent events, where the server can push occasional messages to the browser.
... websocket, a new protocol that can be set up by upgrading an existing http connection.
...And 2 more matches
Content negotiation - HTTP
the http/1.1 standard defines list of the standard headers that start server-driven negotiation (accept, accept-charset, accept-encoding, accept-language).
... the accept-charset header the accept-charset header indicates to the server what kinds of character encodings are understood by the user-agent.
... traditionally, it was set to a different value for each locale for the browser, like iso-8859-1,utf-8;q=0.7,*;q=0.7 for a western european locale.
...And 2 more matches
CSP: base-uri - HTTP
not setting this allows any url.
... 'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
...And 2 more matches
CSP: form-action - HTTP
not setting this allows anything.
... syntax one or more sources can be set for the form-action policy: content-security-policy: form-action <source>; content-security-policy: form-action <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number.
... 'none' refers to the empty set; that is, no urls match.
...And 2 more matches
CSP: frame-ancestors - HTTP
setting this directive to 'none' is similar to x-frame-options: deny (which is also supported in older browsers).
...not setting this allows anything.
... syntax one or more sources can be set for the frame-ancestors policy: content-security-policy: frame-ancestors <source>; content-security-policy: frame-ancestors <source> <source>; sources <source> can be one of the following: the frame-ancestors directive’s syntax is similar to a source list of other directives (e.g.
...And 2 more matches
CSP: navigate-to - HTTP
not setting this allows anything.
... syntax one or more sources can be set for the navigate-to policy: content-security-policy: navigate-to <source>; content-security-policy: navigate-to <source> <source>; sources <source> can be one of the following: <host-source> internet hosts by name or ip address, as well as an optional url scheme and/or port number.
... 'none' refers to the empty set; that is, no urls match.
...And 2 more matches
CSP: upgrade-insecure-requests - HTTP
the upgrade-insecure-requests directive is evaluated before block-all-mixed-content and if it is set, the latter is effectively a no-op.
... it is recommended to set either directive, but not both, unless you want to force https on older browsers that do not force it after a redirect to http.
... the upgrade-insecure-requests directive will not ensure that users visiting your site via links on third-party sites will be upgraded to https for the top-level navigation and thus does not replace the strict-transport-security (hsts) header, which should still be set with an appropriate max-age to ensure that users are not subject to ssl stripping attacks.
...And 2 more matches
X-Frame-Options - HTTP
examples note: setting x-frame-options inside the <meta> element is useless!
... x-frame-options works only by setting through the http header, as in the examples below.
... configuring apache to configure apache to send the x-frame-options header for all pages, add this to your site's configuration: header always set x-frame-options "sameorigin" to configure apache to set the x-frame-options deny, add this to your site's configuration: header set x-frame-options "deny" configuring nginx to configure nginx to send the x-frame-options header, add this either to your http, server or location configuration: add_header x-frame-options sameorigin always; configuring iis to configure iis to send the x-frame-options header, add this to your site's web.config file: <system.webserver> ...
...And 2 more matches
Network Error Logging - HTTP
include_subdomains if true, the policy applies to all subdomains under the origin that the policy header is set.
... the reporting group should also be set to include subdomains, if this option is to be enabled.
....com/previous-page", "body": { "elapsed_time": 338, "method": "post", "phase": "application", "protocol": "http/1.1", "referrer": "https://example.com/previous-page", "sampling_fraction": 1, "server_ip": "137.205.28.66", "status_code": 400, "type": "http.error", "url": "https://example.com/bad-request" } } dns name not resolved note that the phase is set to dns in this report and no server_ip is available to include.
...And 2 more matches
Grammar and types - JavaScript
javascript is case-sensitive and uses the unicode character set.
... in web pages, the global object is window, so you can set and access global variables using the window.variable syntax.
...when you create an array using an array literal, it is initialized with the specified values as its elements, and its length is set to the number of arguments specified.
...And 2 more matches
Arrow function expressions - JavaScript
this.age = 0; setinterval(function growup() { // in non-strict mode, the growup() function defines `this` // as the global object (because it's where growup() is executed.), // which is different from the `this` // defined by the person() constructor.
... function person() { var that = this; that.age = 0; setinterval(function growup() { // the callback refers to the `that` variable of which // the value is the expected object.
... thus, in the following code, the this within the function that is passed to setinterval has the same value as the this in the lexically enclosing function: function person(){ this.age = 0; setinterval(() => { this.age++; // |this| properly refers to the person object }, 1000); } var p = new person(); relation with strict mode given that this comes from the surrounding lexical context, strict mode rules with regard to this are ignored.
...And 2 more matches
DataView() constructor - JavaScript
syntax new dataview(buffer [, byteoffset [, bytelength]]) parameters buffer an existing arraybuffer or sharedarraybuffer to use as the storage backing the new dataview object.
... byteoffset optional the offset, in bytes, to the first byte in the above buffer for the new view to reference.
... exceptions rangeerror thrown if the byteoffset or bytelength parameter values result in the view extending past the end of the buffer.
...And 2 more matches
Date.parse() - JavaScript
this function is useful for setting date values based on string values, for example in conjunction with the settime() method and the date object.
...when the time zone offset is absent, date-only forms are interpreted as a utc time and date-time forms are interpreted as local time.
...therefore date objects produced using those strings may represent different moments in time depending on the version of ecmascript supported unless the system is set with a local time zone of utc.
...And 2 more matches
Object.freeze() - JavaScript
description nothing can be added to or removed from the properties set of a frozen object.
... for data properties of a frozen object, values cannot be changed, the writable and configurable attributes are set to false.
... accessor properties (getters and setters) work the same (and still give the illusion that you are changing the value).
...And 2 more matches
Comparing Reflect and Object methods - JavaScript
n/a set() n/a reflect.set() returns true if the property was set successfully on the object and false if it was not.
... setprototypeof() object.setprototypeof() returns the object itself if its prototype was set successfully.
... throws a typeerror if the prototype being set was anything other than an object or null, or if the prototype for the object being modified is non-extensible.
...And 2 more matches
RegExp.prototype.exec() - JavaScript
javascript regexp objects are stateful when they have the global or sticky flags set (e.g.
... if the match fails, the exec() method returns null, and sets lastindex to 0.
... note that the lastindex property will not be reset when searching a different string, it will start its search at its existing lastindex .
...And 2 more matches
String.prototype.replace() - JavaScript
offset the offset of the matched substring within the whole string being examined.
... (the exact number of arguments depends on whether the first argument is a regexp object—and, if so, how many parenthesized submatches it specifies.) the following example will set newstring to 'abc - 12345 - #$*%': function replacer(match, p1, p2, p3, offset, string) { // p1 is nondigits, p2 digits, and p3 non-alphanumerics return [p1, p2, p3].join(' - '); } let newstring = 'abc12345#$*%'.replace(/([^\d]*)(\d*)([^\w]*)/, replacer); console.log(newstring); // abc - 12345 - #$*% examples defining the regular expression in replace() in the following example, the reg...
... function stylehyphenformat(propertyname) { function uppertohyphenlower(match, offset, string) { return (offset > 0 ?
...And 2 more matches
TypedArray.from() - JavaScript
description typedarray.from() lets you create typed arrays from: array-like objects (objects with a length property and indexed elements); or iterable objects (objects where you can get its elements, such as map and set).
...hence, when working with proxy objects, it calls handler.set to create new elements rather than handler.defineproperty().
... when the source parameter is an iterator, the typedarray.from() first collects all the values from the iterator, then creates an instance of thisarg using the count, then sets the values on the instance.
...And 2 more matches
WeakMap - JavaScript
setting elements on this map would involve pushing a key and value onto the end of each of those arrays simultaneously.
... such an implementation would have two main inconveniences: the first one is an o(n) set and search (n being the number of keys in the map) since both operations must iterate through the list of keys to find a matching value.
... weakmap.prototype.set(key, value) sets the value for the key in the weakmap object.
...And 2 more matches
Object initializer - JavaScript
syntax let o = {} let o = {a: 'foo', b: 42, c: {}} let a = 'foo', b = 42, c = {} let o = {a: a, b: b, c: c} let o = { property: function (parameters) {}, get property() {}, set property(value) {} }; new notations in ecmascript 2015 please see the compatibility table for support for these notations.
... function havees2015duplicatepropertysemantics() { 'use strict'; try { ({prop: 1, prop: 2}); // no error thrown, duplicate property names allowed in strict mode return true; } catch(e) { // error thrown, duplicates prohibited in strict mode return false; } } method definitions a property of an object can also refer to a function or a getter or setter method.
... let o = { property: function (parameters) {}, get property() {}, set property(value) {} } in ecmascript 2015, a shorthand notation is available, so that the keyword "function" is no longer necessary.
...And 2 more matches
<mtable> - MathML
WebMathMLElementmtable
note: the <mtable> element resets the displaystyle attribute to false.
... if you want to use this element as an inline-block, you might want to set <mtable displaystyle="true">...</mtable>.
... displaystyle a boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas.
...And 2 more matches
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
this article explains a change that has occured in the way sizes are worked out on web documents when width and height attributes are set on them.
...ers when the container becomes narrower than the image, developers started using css like the following: img { max-width: 100%; height: auto; } this is really useful for responsive layouts, but unfortunately it causes the jank problem to return — the above css overrides the width and height attribute information, meaning that if the image has not loaded for some reason, its height will be set to 0.
...when such an element has width and height attributes set on it, its aspect ratio will be calculated before load time, and be available to the browser.
...And 2 more matches
CSS and JavaScript animation performance - Web Performance
css animations, on the other hand, allow developers to make animations between a set of starting property values and a final set rather than between two states.
... css animations consist of two components: a style describing the css animation, and a set of key frames that indicate the start and end states of the animation's style, as well as possible intermediate points.
...compared to settimeout()/setinterval(), which need a specific delay parameter, requestanimationframe() is much more efficient.
...And 2 more matches
Performance fundamentals - Web Performance
for example, the user taps a "settings" button to transition into an application configuration screen, or a settings menu "pops up".
... use css animations and transitions instead of using some library’s animate() function, which probably currently uses many badly performing technologies (window.settimeout() or top/left positioning, for example) use css animations.
... css animations give you very granular control over your effects using keyframes, and you can even watch events fired during the animation process in order to handle other tasks that need to be performed at set points in the animation process.
...And 2 more matches
Recommended Web Performance Timings: How long is too long? - Web Performance
there are no clear set rules as to what constitutes a slow pace when loading pages, but there are specific guidelines for indicating content will load (1 second), idling (50ms), animating (16.7s) and responding to user input (50 to 200ms).
... the first asset retrieved from a request is usually an html document, which then makes calls for additional assets.
... as noted in the description of the critical rendering path, when received, browsers immediately start processing the html, rendering the content as it is received rather than waiting for additional assets to load.
...And 2 more matches
Mobile first - Progressive web apps (PWAs)
we consider the overall experience during the planning stage, look at what subset of features will be available on mobile, desktop, etc.
...this way, mobile devices don't have to load assets and other information twice.
... one word of warning about this technique though - positioning doesn't work as expected on elements with display: table set on them.
...And 2 more matches
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.org/2000/svg"> <g> <rect fill="forestgreen" x="10" y="10" height="25" width="230" /> <text x="20" y="27">requiredfeatures supported</text> </g> <g requiredfeatures=""> <rect fill="crimson" x="10" y="10" he...
...in some cases the feature strings map directly to a set of attributes, properties or elements, in others they represent some functionality of the browser.
... http://www.w3.org/tr/svg11/feature#basictext the browser supports the <text> element http://www.w3.org/tr/svg11/feature#paintattribute the browser supports the color, fill, fill-rule, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-width, color-interpolation and color-rendering attributes http://www.w3.org/tr/svg11/feature#basicpaintattribute the browser supports the color, fill, fill-rule, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-width and color-rendering attributes http://www.w3.org/tr/svg11/...
...And 2 more matches
spreadMethod - SVG: Scalable Vector Graphics
to see the effects of this attribute, you will need to set the size of the gradient smaller than the shape.
... examples of spreadmethod with linear gradients svg <svg width="220" height="150" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="padgradient" x1="33%" x2="67%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> <lineargradient id="reflectgradient" spreadmethod="reflect" x1="33%" x2="67%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> <lineargradient id="repeatgradient" spreadmethod="repeat" ...
... x1="33%" x2="67%"> <stop offset="0%" stop-color="fuchsia"/> <stop offset="100%" stop-color="orange"/> </lineargradient> </defs> <rect fill="url(#padgradient)" x="10" y="0" width="200" height="40"/> <rect fill="url(#reflectgradient)" x="10" y="50" width="200" height="40"/> <rect fill="url(#repeatgradient)" x="10" y="100" width="200" height="40"/> </svg> result notice that the middle third of each gradient is the same.
...And 2 more matches
to - SVG: Scalable Vector Graphics
WebSVGAttributeto
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="100" height="100"> <animate attributetype="xml" attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, to specifies the ending value of the animation.
... set for the <set> element, to specifies the value for the attribute during the duration of the element.
... specifications specification status comment svg animations level 2the definition of 'to for <set>' in that specification.
...And 2 more matches
transform-origin - SVG: Scalable Vector Graphics
the transform-origin svg attribute sets the origin for an item’s transformations.
...rcentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> default value 50%, 50% animatable yes the transform-origin property may be specified using one, two, or three values, where each value represents an offset.
... offsets that are not explicitly defined are reset to their corresponding initial values.
...And 2 more matches
Clipping and masking - SVG: Scalable Vector Graphics
<svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="gradient"> <stop offset="0" stop-color="black" /> <stop offset="1" stop-color="white" /> </lineargradient> <mask id="mask"> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" /> </mask> </defs> <rect x="0" y="0" width="200" height="200" fill="green" /> <rect x="0" y="0" width="200" height="200" fill="red" mask="url(#mask)" /> </svg> you see a green-filled rect at the lowes...
...as a result the pixels of the red rectangle use the luminance value of the mask content as the alpha value (the transparency), and we see a green-to-red gradient as a result: screenshotlive sample transparency with opacity there is a simple possibility to set the transparency for a whole element.
...hence, if you set a stroke opacity on an element, that also has a fill, the fill will shine through on half of the stroke, while on the other half the background will appear: <svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="0" y="0" width="200" height="200" fill="blue" /> <circle cx="100" cy="100" r="50" stroke="yellow" stroke-width="40" stroke-opacity=".5"...
...And 2 more matches
Types of attacks - Web security
cookies that are used for sensitive actions (such as session cookies) should have a short lifetime with the samesite attribute set to strict or lax.
...this may happen by stealing a cookie for an existing session, or by fooling the user (or their browser) into setting a cookie with a predetermined session id.
... session fixation a third party is able to determine a user’s session identifier (i.e., by reading it or setting it), and therefore interact with the server as that user.
...And 2 more matches
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> th...
... you can affect the nodes in the shadow dom in exactly the same way as non-shadow nodes — for example appending children or setting attributes, styling individual nodes using element.style.foo, or adding style to the entire shadow dom tree inside a <style> element.
...h a value of open or closed: let shadow = elementref.attachshadow({mode: 'open'}); let shadow = elementref.attachshadow({mode: 'closed'}); open means that you can access the shadow dom using javascript written in the main page context, for example using the element.shadowroot property: let myshadowdom = mycustomelem.shadowroot; if you attach a shadow root to a custom element with mode: closed set, you won't be able to access the shadow dom from the outside — mycustomelem.shadowroot returns null.
...And 2 more matches
Compiling from Rust to WebAssembly - WebAssembly
rust environment setup let's go through all the required steps to get our environment set up.
... building our webassembly npm package enough setup; let's create a new package in rust.
... whenever you want to call javascript functions, you can add them to this file, and wasm-bindgen takes care of setting everything up for you.
...And 2 more matches
Classes and Inheritance - Archive of obsolete content
the problem is that when we overrode the prototype of circle with an object whose prototype is the prototype of shape, we didn't correctly set its constructor property.
... this property is set automatically for the prototype property of a constructor, but not for objects created with object.create.
...class uses this information to automatically set up the prototype chain of the constructor.
...x, y, radius) { shape.prototype.initialize.call(this, x, y); this.radius = radius; }, draw: function (context) { context.beginpath(); context.arc(this.x, this.y, this.radius, 0, 2 * math.pi, false); context.fill(); } }); unlike the definition of circle in the previous section, we no longer have to override its prototype, or set its constructor property.
page-worker - Archive of obsolete content
so you can rewrite the above code like this: pageworker = require("sdk/page-worker").page({ contentscript: "console.log(document.body.innerhtml);", contenturl: "./myfile.html" }); you can load a new page by setting the page worker's contenturl property.
...see working with content scripts for help on setting this property.
...setting it loads the content immediately.
... include a set of match patterns to define the urls which the page-worker's content script will be applied.
passwords - Archive of obsolete content
usage a credential is the set of information a user supplies to authenticate herself with a service.
... you pass it any subset of the possible properties a credential can contain.
... so if you pass in an empty set of properties, all stored credentials are returned: function show_all_passwords() { require("sdk/passwords").search({ oncomplete: function oncomplete(credentials) { credentials.foreach(function(credential) { console.log(credential.username); console.log(credential.password); }); } }); } if you pass it a single property, only credentials matching that property are returned: function show_passwords_for_joe() { require("sdk/passwords").search({ username: "joe", oncomplete: function oncomplete(credentials) { credentials.foreach(function(credential) { console.log(credential.usernam...
...w.example.com", formsubmiturl: "http://login.example.com", username: "joe", usernamefield: "uname", password: "secret123", passwordfield: "pword" }); to store an http authentication credential: require("sdk/passwords").store({ url: "http://www.example.com", realm: "exampleco login", username: "joe", password: "secret123", }); see "credentials" above for more details on how to set these properties.
core/heritage - Archive of obsolete content
class module exports class utility function for making constructor functions with a proper prototype chain setup in declarative manner: var { class } = require('sdk/core/heritage'); var dog = class({ initialize: function initialize(name) { this.name = name; }, type: 'dog', bark: function bark() { return 'ruff!
... ruff!' } }); note: we use term class to refer an exemplar constructs in a form of constructor functions with a proper prototype chain setup.
...as a matter of fact since result is just a plain constructor function with proper prototype chain setup you could sub-class it as any other constructor: function labrador() { // ...
...as mentioned before you could pass constructors that were not created using class function as long as they have proper prototype setup.
tabs/utils - Archive of obsolete content
globals functions activatetab(tab, window) set the specified tab as the active, or selected, tab.
... closetab(tab) close the specified tab.
... returns string : settabtitle(tab, title) set the title of the document hosted by the specified tab, or the tab's label if the tab doesn't host a document.
... settaburl(tab, url) set the specified tab's url.
Low-Level APIs - Archive of obsolete content
chrome the chrome module gives an add-on sdk add-on access to the components object, which in turn gives it access to a large set of privileged low-level firefox apis.
... system/environment access, set and clear environment variables.
... test/harness test harness setup and execution.
... test/runner sets up unit tests.
Bookmarks - Archive of obsolete content
ervice(components.interfaces.nsibookmarksservice); // create the bookmark bmsvc.createbookmarkincontainer(win.document.title, // bookmark name win.location.href.tostring(), // uri of the bookmark null, // shortcut win.document.title, // description win.document.characterset, // charset null, // postdata bookmarksservice.getbookmarkstoolbarfolder(), // bookmark folder 0); // index in the folder firefox 3 firefox 3 provides a reworked set of api for working with history and bookmarks.
... the item title to change the title of a bookmark or bookmark folder, you use the nsinavbookmarksservice.setitemtitle() method.
... bmsvc.setitemtitle(newbkmkid, "new title"); this sets the title of the item referenced by the id newbkmkid to "new title".
... var parentfolderid = bmsvc.getfolderidforitem(newbkmkid); observing changes to bookmarks and tags to set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods.
Forms related code snippets - Archive of obsolete content
date picker (before implementing it in a working environment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>datepicker example - mdn</title> <script type="text/javascript"> /*\ |*| |*| datepicker example mdndeveloper network |*| |*| https://developer.mozilla.org/docs/code_snippets/forms |*| https://developer.mozilla.org/user:fusionchess |*| |*| this snippet is released under the gnu public license, version 3 or later.
...{ oth = document.createelement("th"); oth.innerhtml = sdays[nthid]; ohrow.appendchild(oth); } othead.appendchild(ohrow); ocapt.appendchild(odecryear); ocapt.appendchild(odecrmonth); ocapt.appendchild(oincryear); ocapt.appendchild(oincrmonth); ocapt.appendchild(this.display); this.container.appendchild(ocapt); this.container.appendchild(othead); this.current.setdate(1); this.writedays(); otarget.onclick = function () { if (otable.parentnode) { otable.parentnode.removechild(otable); return; } otable.style.zindex = nzindex++; otable.style.position = "absolute"; otable.style.left = otarget.offsetleft + "px"; otable.style.top = (otarget.offsettop + otarget.offsetheight) + "px"; otarget.parent...
..."setmonth" : "setyear"](othiscal.current[bismonth ?
...if you want to emulate an editable select through a <fieldset> of radioboxes and textboxes (written in pure css, without javascript), please see this example.
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
it was specified in 1998 by w3c, the organization that sets standards for web-related technologies.
... nevertheless, the rise of web services like google maps, which used javascript and asynchronous communications, created an awareness of a set of technologies nicknamed ajax (asynchronous javascript and xml); that plus the advent of a number of libraries that paper over implementation differences between different web browsers has more recently led to a re-evaluation of javascript as a programming language.
...listing 4 shows an example that deletes the second child element of the element with the "toolbar" id, adds a new button element as a substitute, and sets a label attribute.
... listing 4: an example manipulation using the dom var bar = document.getelementbyid('toolbar'); bar.removechild(bar.childnodes[1]); bar.appendchild(document.createelement('button')); bar.lastchild.setattribute('label', 'hello!'); « previousnext » ...
Appendix F: Monitoring DOM changes - Archive of obsolete content
often times, this must be used in combination with a slight delay, or even polling, via settimeout, for cases where the url change happens before the page is fully loaded.
... */ if ('mozcsskeyframerule' in window || 'csskeyframerule' in window) { var watchnodes = function watchnodes(selector, callback, doc) { const event = watchnodes.prefix + (watchnodes._i++); const xhtml = 'http://www.w3.org/1999/xhtml'; doc = doc || document; let style = doc.createelementns(xhtml, 'style'); style.setattribute('type', 'text/css'); let preamble = ' @-moz-keyframes ' + event + ' { \n\ from { clip: rect(1px, auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); } \n\ }\n'; let properties = [ 'animation-duration: 0.0001s;', 'animation-name: ' + event + ' !important;' ]; properties = properties.map(function (pr...
...for instance, when using the selector div:not([foo-binding-done]), you can detach your binding by running this.setattribute("foo-binding-done", true) in your constructor.
...for instance, if you need to know about attribute changes to a particular node, then you should replace its setattribute method with a function that calls the original setattribute function as originalsetattribute.apply(this, arguments) before running your necessary event code.
Session store API - Archive of obsolete content
in order to properly restore your extension's state when a tab is restored, it needs to use the session store api's settabvalue() method to save any data it will need in order to restore its state, and then call gettabvalue() to retrieve the previous setting when the tab is restored.
... if you want to set permissions or otherwise manipulate a restored tab before the page is loaded into it, you should watch sstabrestoring.
... var ss = components.classes["@mozilla.org/browser/sessionstore;1"] .getservice(components.interfaces.nsisessionstore); var currenttab = gbrowser.selectedtab; var datatoattach = "i want to attach this"; ss.settabvalue(currenttab, "key-name-here", datatoattach); this code sets the value of the key "key-name-here" to datatoattach.
...however seamonkey reuses the browser element (up to the undo close tab limit) which means that you can set state on the browser element and it will be restored with the tab.
Using Dependent Libraries In Extension Components - Archive of obsolete content
// assume that we're in <extensiondir>/components, and we want to find // <extensiondir>/libraries nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); prlibrary *lib; library->load(&lib); // 1) we don't care if this failed!
... } library->setnativeleafname(ns_literal_cstring(krealcomponent)); prlibrary *lib; rv = library->load(&lib); if (ns_failed(rv)) return rv; nsgetmoduleproc getmoduleproc = (nsgetmoduleproc) pr_findfunctionsymbol(lib, ns_get_module_symbol); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } extensions/stub/bdsstubloader.cpp (for mac os x) the code as written above won't work for mac os x.
... // assume that we're in <extensiondir>/components, and we want to find // <extensiondir>/libraries nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); nscstring path; // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); rv = library->getnativepath(path); if (ns_failed(rv)) return rv; //...
... } library->setnativeleafname(ns_literal_cstring(krealcomponent)); rv = library->getnativepath(path); if (ns_failed(rv)) return rv; const mach_header * componentlib = nsaddimage(path.get(), nsaddimage_option_return_on_error | nsaddimage_option_with_searching | nsaddimage_option_match_filename_by_installname); if (componentlib == null) return ns_error_unexpected; //find the nsgetmodu...
Same-origin policy for file: URIs - Archive of obsolete content
this load can occur through a subframe, link, location set, call to window.open(), or the like.
... for example, if the file /home/user/foo.html is a frameset and one of the frames is /home/user/subdir/bar.html, the frame and frameset are considered to share the same origin.
... on the other hand, if the file /home/user/subdir/foo.html is a frameset and the frame is /home/user/bar.html, the frame and frameset are considered to have different origins.
... the new security.fileuri.strict_origin_policy preference, which defaults to true, can be set to false if the user doesn't want to strictly enforce the same origin policy on file: uris.
Creating a Firefox sidebar extension - Archive of obsolete content
chrome/content/firefoxoverlay.xul <?xml version="1.0"?> <!doctype overlay system "chrome://emptysidebar/locale/emptysidebar.dtd"> <overlay id="emptysidebaroverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="viewsidebarmenu"> <menuitem key="key_openemptysidebar" observes="viewemptysidebar" /> </menupopup> <keyset id="mainkeyset"> <key id="key_openemptysidebar" command="viewemptysidebar" key="&openemptysidebar.commandkey;" modifiers="&openemptysidebar.modifierskey;" /> </keyset> <broadcasterset id="mainbroadcasterset"> <broadcaster id="viewemptysidebar" label="&emptysidebar.title;" autocheck="false" type="checkbox" ...
... group="sidebar" sidebarurl="chrome://emptysidebar/content/emptysidebar.xul" sidebartitle="&emptysidebar.title;" oncommand="togglesidebar('viewemptysidebar');" /> </broadcasterset> </overlay> the overlay file consists of three entries, the menu definition, shortcut keys and the broadcaster.
... if the sidebar is not going to have a command-key, one can remove the openemptysidebar.commandkey and openemptysidebar.modifierskey keys from the dtd, remove the <keyset> from the firefoxoverlay.xul file.
... one must then set the key attribute of the menuitem to "".
Exception logging in JavaScript - Archive of obsolete content
exception reporting in firefox 3 firefox 3 improves reporting of unhandled exceptions by establishing a set of rules that determines whether or not an exception is worth reporting: any methods on interfaces annotated with the [function] attribute in idl (see, for example, nsidomeventlistener) that throw exceptions always report those exceptions into the error console.
...first, you can set the boolean preference dom.report_all_js_exceptions.
...alternatively, you can set the environment variable moz_report_all_js_exceptions.
... it doesn't matter what value you set this to (it can even be 0).
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
we then set the channel's nsiloadgroup to the one from the window context.
... openchannel returns to openuri which just opens the channel, setting the nsdocumentopeninfo as the stream listener.
...first it checks whether the channel has "content-disposition: attachment" set.
...this creates a new nsdocumentopeninfo object and sets it as the output streamlistener of the converter.
Layout System Overview - Archive of obsolete content
the presentation shell also owns the root of the style system, the style set.
... in many cases the presentation shell provides pass-through methods to the style set, and generally uses the style set to do style resolution and style sheet management.
...for this overview, the frames, style set, and reflow queue are the most important high-level parts of the presentation shell.
...block frame reflow state reflow metrics space manager styleset stylecontext see also layout faq document history 05/20/2002 - marc attinasi: created, wrote highest level introduction to general layout concepts, links to relevant specs and existing documents.
Java in Firefox Extensions - Archive of obsolete content
.net.url's, pass to java.net.urlclassloader to get a class loader, and finally pass the classloader and array to a function which gives the necessary privileges: // this function will be called to give the necessary privileges to your jar files // however, the policy never comes into play, because // (1) adding permissions doesn't add to the policy itself, and // (2) addurl alone does not set the grant codebase function policyadd (loader, urls) { try { //if have trouble with the policy try changing it to //edu.mit.simile.javafirefoxextensionutils.urlsetpolicy var str = 'edu.mit.simile.javafirefoxextensionutils.urlsetpolicy'; var policyclass = java.lang.class.forname( str, true, loader ); ...
... var policy = policyclass.newinstance(); policy.setouterpolicy(java.security.policy.getpolicy()); java.security.policy.setpolicy(policy); policy.addpermission(new java.security.allpermission()); for (var j=0; j < urls.length; j++) { policy.addurl(urls[j]); } }catch(e) { alert(e+'::'+e.linenumber); } } //get extension folder installation path...
...ng var myjarpath = extensionurl + "/java/testjava.jar"; // seems you don't actually have to replace the backslashes as they work as well var urlarray = []; // build a regular javascript array (liveconnect will auto-convert to a java array) urlarray[0] = new java.net.url(myjarpath); urlarray[1] = new java.net.url(classloaderjarpath); var cl = java.net.urlclassloader.newinstance(urlarray); //set security policies using the above policyadd() function policyadd(cl, urlarray); now you can begin using liveconnect, including referencing the classes in your jars.
...one example seems to be the fact that the "java" global is not immediately available if the extension operates in a sidebar (using settimeout solved it at least).
Simple Storage - Archive of obsolete content
for the most part this object is like any other javascript object, and a jetpack can set whatever properties it wants on it.
...function updatejetpackmenu() { jetpack.menu.set({ label: "notes", menu: new jetpack.menu(notes.length > 0 ?
...:( jetpack.menu.context.page.beforeshow = function (menu) { menu.reset(); if (jetpack.selection.text) menu.add({ label: "note", command: function () { notes.unshift(jetpack.selection.text); if (notes.length > 20) notes.pop(); updatejetpackmenu(); } }); }; // initialize the jetpack menu with the current notes.
... updatejetpackmenu(); see also settings jep 11 ...
Message Summary Database - Archive of obsolete content
nsimsgdatabase is an abstraction on top of mdb, which is a set of db interfaces.
...this includes a set of per-message flags, the more commonly used headers (e.g., subject, sender, from, to, cc, date, etc), and a few other attributes, e.g., keywords.
... there are a set of generic property methods so that core code and extensions can set attributes on msg headers without changing nsimsghdr.idl.msg threads we store thread information persistently in the database and expose these object through the [nsimsgthread interface.
...and we only pay the storage cost for a property if the row has the property set.
Nanojit - Archive of obsolete content
internally to nanojit, another set of filters operates on the lir as it passes from the lirbuffer toward the assembler.
... figuring out how to compile it is left as an exercise for the reader; the following works when run in the object directory of an --enable-debug spidermonkey shell: g++ -ddebug -g3 -wno-invalid-offsetof -fno-rtti -include js-confdefs.h -i dist/include/ -i..
... #include <stdio.h> #include <stdint.h> #include "jsapi.h" #include "jstracer.h" #include "nanojit.h" using namespace nanojit; const uint32_t cache_size_log2 = 20; static avmplus::gc gc = avmplus::gc(); static avmplus::avmcore core = avmplus::avmcore(); int main() { logcontrol lc; #ifdef debug lc.lcbits = lc_readlir | lc_assembly; #else lc.lcbits = 0; #endif // set up the basic nanojit objects.
... lins *rec_ins = out.insskip(sizeof(guardrecord) + sizeof(sideexit)); guardrecord *guard = (guardrecord *) rec_ins->payload(); memset(guard, 0, sizeof(*guard)); sideexit *exit = (sideexit *)(guard + 1); guard->exit = exit; guard->exit->target = f; f->lastins = out.insguard(lir_loop, out.insimm(1), rec_ins); // compile the fragment.
Proxy UI - Archive of obsolete content
camino configured in os (networking preferences) (recently added - some support for reading os and account settings.)ui elements preferences panel overview the ui is based on selecting a proxy mode, then filling out any additional needed information in "related" ui.
...for example, firefox 3: [ ] no proxy [ ] auto-detect proxy settings for this network [ ] manual proxy configuration: [ ] automatic proxy configuration url: behavior default value: "no proxy" is selected all other "type" radio buttons are enabled, but not selected.
... the radio buttons do not map to the proxy type in order (due the evolution of the ui): proxy mode "network.proxy.type" no proxy (direct) network.proxy.type=0 auto-detect proxy settings...
...selecting an enabled item sets the menu selection and the proxy mode (network.proxy.type) selecting a disabled item is not allowed.
RDF Datasource How-To - Archive of obsolete content
the "rdf universe" consists of a set of statements about internet resources; for example, "my home page was last modified april 2nd", or "that news article was sent by bob".
...deciding on a vocabulary the vocabulary is the set of properties that you will use to express relationships between elements (resources and literals) in your data model.
...typically, you provide a parser for reading in some sort of static storage (e.g., a data file); the parser translates the datafile into a series of calls to assert() to set up the in-memory datasource.
...you may also need to choose this implementation if the data set which your datasource is modeling is too large to fit in to memory (e.g., the entire file system structure).
Tamarin Build System Documentation - Archive of obsolete content
the smoke phase runs a set of tests on each platform until 2 minute is exceeded.
... the set of smoke tests can contain any shell build and any test suite (including performance).
...; cd scripts edit environment.sh, change the basedir and buildsdir settings (around line 51) basedir=~/hg/tamarin-redux (path to my test repository) (next line) buildsdir=~/hg/builds (a directory to store downloaded builds) always set current working directory to the scripts directory when running a script run a script (e.g.) ../all/run-acceptance-release.sh <optional hg revision number like 1902> how do i navigate the build status page?
...uildstep and result the left side contains the time column and the user/revision link to represent the revision triggering a build, mouse over the user to see the revision and submission notes each buildstep run on a slave is a box with color indicating status, red is failed, green passed, yellow has warnings click the stdio link to see the output click on the build yellow box at the bottom of a set of buildsteps to see the result of all of the buildsteps for a build and the time each buildstep took scroll down to see previous builds triggered at the bottom of the page click on the [next page] link to display more previous builds what are the goals of the build system (qos)?
The new nsString class implementation (1999) - Archive of obsolete content
static void ensurecapacity(nsstrimpl& astring,pruint32 anewlength); static void growcapacity(nsstrimpl& astring,pruint32 anewlength); static void append(nsstrimpl& adest,const nsstrimpl& asource,pruint32 anoffset,print32 acount); static void appendcstring(nsstrimpl& adest,const char* asource,pruint32 anoffset,print32 acount); static void assign(nsstrimpl& adest,const nsstrimpl& asource,pruint32 anoffset,print32 acount); static void assigncstring(nsstrimpl& adest,const char* asource,pruint32 anoffset,print32 acount); // assign a char or a substring into the existing string...
... static void insert(nsstrimpl& adest,pruint32 adestoffset, const nsstrimpl& asource,pruint32 asrcoffset,print32 acount); static void insertcstring(nsstrimpl& adest,pruint32 adestoffset, const char* asource,pruint32 asrcoffset,print32 acount); static void insertchar(nsstrimpl& adest,pruint32 adestoffset,char thechar); static void insertchar(nsstrimpl& adest,pruint32 adestoffset,prunichar theunichar); static void insertchar(nsstrimpl& adest,pruint32 adestoffset,print32 thequadchar); static void delete(nsstrimpl& adest,pruint32 adestoffset,pruint32 acount); static void truncate(nsstrimpl& adest,pruint32 adestoffset); static print32 compare(const nsstrimpl& adest,const nsstrimpl& asource, print32 acount,...
...first, nsstrimpl offers charset conversion hooks for use during construction, comparison and assignment.
...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.
XML in Mozilla - Archive of obsolete content
mozilla will read internal (dtd) subsets, and in special circumstances external dtds as explained above and will use this information to recognize id type attributes, default attribute values, and general entities.
...the public identifiers that are recognized are: -//w3c//dtd xhtml 1.0 transitional//en -//w3c//dtd xhtml 1.1//en -//w3c//dtd xhtml 1.0 strict//en -//w3c//dtd xhtml 1.0 frameset//en -//w3c//dtd xhtml basic 1.0//en -//w3c//dtd xhtml 1.1 plus mathml 2.0//en -//w3c//dtd xhtml 1.1 plus mathml 2.0 plus svg 1.1//en -//w3c//dtd svg 20001102//en -//wapforum//dtd xhtml mobile 1.0//en xml linking and pointing xml linking support includes xml base and simple xlinks.
...there is no ui for setting this pref yet, so you will need to manually edit the preferences file.
...we don't use that always, so if you want to avoid doing duplicate work you could start working on bugs that have future milestone, or otherwise have a milestone that is set way into the future.
Mac stub installer - Archive of obsolete content
the mac stub installer project resides at: <http://lxr.mozilla.org/seamonkey/sou...ll/wizard/mac/> the mac stub installer source code resides at: <http://lxr.mozilla.org/seamonkey/sou...izard/mac/src/> how do we get setup to debug the mac installer?
... how we get setup to debug the xpinstall engine from the mac installer?
...to do this, in addition to the above steps to set up the mac installer to debug you will need to do the following: create a file named xpcom.xpi with the shared libraries in the structure described under the [xpcom] section in: <http://lxr.mozilla.org/seamonkey/sou...ackages-mac#33> note that if you are using the debug target of the installer binary all shared libraries are expected to have the name format <libname>debug.shlb now set a break point at xpi_init() in the mac installer code and step into xpistub and eventually the xpinstall engine will load including symbols so you can set a break point in the xpinstal...
...then add the componentx into the appropriate setup types so the installer module installs when users select the setup types you choose it to be in.
Unix stub installer - Archive of obsolete content
the unix stub installer project resides at: <http://lxr.mozilla.org/seamonkey/sou...ard/unix/src2/> how do we get setup to debug the unix stub installer?
... how we get setup to debug the xpinstall engine from the unix stub installer?
... debug using "gdb mozilla-installer-bin" and set a breakpoint at xpi_init().
...then add the componentx into the appropriate setup types so the installer module installs it when users select the setup types you choose it to be in.
Methods - Archive of obsolete content
setrootkey changes the root key being accessed.
... setvalue sets the value of an arbitrary key.
... setvaluenumber sets the value of a key, when that value is an integer.
... setvaluestring sets the value of a key, when that value is a string.
WinReg Object - Archive of obsolete content
when you construct a winreg object, it is set to operate with hkey_classes_root as its root key.
... to use a different root key, use the setrootkey method.
...to manipulate such values, use the getvaluestring and setvaluestring methods.
... to manipulate other values, use the getvalue and setvalue methods.
A XUL Bestiary - Archive of obsolete content
the parts of the document, such as the head, the links, the body, any tags, are available as nodes whose attributes can be got and set.
... in briefest terms, xul is the xml-based language used for creating interfaces, xptoolkit is the set of xul widgets (menus, toolbar, etc.) actually assembed for this purpose -- the building blocks of the interface, as it were -- and xpfe, the cross platform front end, is the front end that has been created from xptoolkit.
... the differences here are significant: xul is the universe of elements, attributes, syntax, rules, and relationships, while xptoolkit is really the finite set of interface-specific elements created in xul.
...if, however, you write event handlers inside event listeners, as we will describe shortly, you can use these events to set off other actions.
panel.consumeoutsideclicks - Archive of obsolete content
if it is not set, it defaults to the platform behavior.
... if it set to true the rollup event is consumed.
... if set to false, the rollup event is not consumed.
... this attribute should be used instead of setconsumerollupevent.
findbar - Archive of obsolete content
for example, the standard findbar in firefox 3.5 looks like this on the mac: you may attach a findbar to a particular browser element by either setting the findbar's browserid attribute to the id of the browser element before the findbar element is bound, or by setting the findbar's browser property to the browser element itself.
... you should use the browser property to get and set this value from a script.
...wevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width browser type: browser element lets you set and get the browser in which the findbar is located.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata close() return type: no return value closes the notification or findbar and removes it from its enclosing notificationbox or findbar.
Methods - Archive of obsolete content
« xul reference home acceptdialog additemtoselection addpane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffir...
...chat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto gotoindex goup hidepopup increase increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwithflags removeallitems removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification remov...
...eprogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange selecttabatindex setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addeventlistener dom:element.appendchild dom:element.comparedocumentposition dom:element.dispatchevent dom:element.getattribute dom:element.getattributenode dom:element.getattributenodens dom:element.getattributens dom:element.getelementsbytagname dom:element.getelementsbytagnamens dom:element.getfeature fixme: brokenlink ...
....haschildnodes dom:element.insertbefore dom:element.isequalnode dom:element.issamenode dom:element.issupported dom:element.lookupnamespaceuri dom:element.lookupprefix dom:element.normalize dom:element.removeattribute dom:element.removeattributenode dom:element.removeattributens dom:element.removechild dom:element.removeeventlistener dom:element.replacechild dom:element.setattribute dom:element.setattributenode dom:element.setattributenodens dom:element.setattributens dom:element.setuserdata ...
Extensions - Archive of obsolete content
the insertbefore attribute is set to 'tools-menu' to ensure that the new menu is added at the right place.
...while the popup is open, the gcontextmenu global variable is set to an object which handles all of the functionality specific to the firefox context menu.
... specifically, this object is initialized with a set of properties that indiciate the type of object that was the target of the context menu.
... for instance, the 'onlink' property is set to true when a link was context-clicked.
Actions - Archive of obsolete content
the id attribute of the new element will be set to the same value of the member variable, ?relateditem.
...since the first result has a value of 'http://www.xulplanet.com/rdf/b' for the ?relateditem variable, the id will be set to this value.
...additional content the previous example generated only a set of buttons, but the action body may contain additional content.
...the effect will be a toolbar with a set of three buttons inside it.
Recursive Generation - Archive of obsolete content
« previousnext » in the previous example, the template builder generated an extra set of two buttons for the second row.
... however, the labels on the second set of buttons are different than the first set.
...this extra arrow which neither b or d have causes an extra set of buttons to be created.
...<hbox id="http://www.xulplanet.com/rdf/c"> <button label="http://www.xulplanet.com/rdf/a"/> <button label="http://www.xulplanet.com/rdf/c"/> <hbox id="http://www.xulplanet.com/rdf/d"> <button label="http://www.xulplanet.com/rdf/c"/> <button label="http://www.xulplanet.com/rdf/d"/> </hbox> </hbox> the recursive nature of templates has useful applications in menus and trees so that sets of iterative content can be generated automatically.
Things I've tried to do with XUL - Archive of obsolete content
:) silver: if you set height="0" and include "overflow: hidden" on each box that is sharing the space, current gecko will quite happily split the space out according to flex, ignoring the contents of each box, as desired.
...a workaround for that is to create the element, insert it in the document and set its style attribute with a -moz-binding property, all of that from c++ instead of js.
... multi-column listboxes when adding items to multi-column listboxes, you can't use the appenditem api: // auto-create and attach 1st cell var row = mylistbox.appenditem( label, value ); // create and attach 2nd cell var cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ...
...instead, you must build up your own listitem full of listcells, and then add that listitem to the listbox, using generic dom calls: var row = document.createelement('listitem'); // create and attach 1st cell var cell = document.createelement('listcell'); cell.setattribute('label', label ); cell.setattribute('value', value ); row.appendchild( cell ); // create and attach 2nd cell cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ...
Adding Event Handlers - Archive of obsolete content
by setting this value to true, non-standard, poorly written, or syntax prone to cause logic errors are logged to the javascript console.
...various properties are set on the event object such as the mouse position, the key that was pressed, and so forth.
...the target is useful when using a bubbling event so that you could have a set of buttons which are all handled by a single script.
...you can also listen during the bubbling phase by setting the last argument to false.
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
a common reason to set handlers is to modify the custom properties when an event occurs.
...the button attribute should be set to either 0 for the left mouse button, 1 for the middle mouse button or 2 for the right mouse button.
...this should be set to one of the values set below: alt the user must press the alt key.
... if set, the handler is only called when the modifier is pressed.
Adding Methods to XBL-defined Elements - Archive of obsolete content
instead, you must call the document's getanonymousnodes() method: var value=document.getanonymousnodes(element); here, 'element' should be set to a reference to the element that you want to get the anonymous content of.
...tle(true)"/> <button label="hide" oncommand="document.getelementbyid('num').showtitle(false)"/> xbl: <binding id="labeledbutton"> <content> <xul:label xbl:inherits="value=title"/> <xul:label xbl:inherits="value"/> </content> <implementation> <method name="showtitle"> <parameter name="state"/> <body> if (state) { document.getanonymousnodes(this)[0].setattribute("style", "visibility: visible"); } else { document.getanonymousnodes(this)[0].setattribute("style", "visibility: collapse"); } </body> </method> </implementation> </binding> two buttons added to the xul have oncommand handlers which are used to change the visibility of the label.
.../> <xul:label xbl:inherits="value"/> <xul:button label="show" oncommand="document.getbindingparent(this).showtitle(true);"/> <xul:button label="hide" oncommand="document.getbindingparent(this).showtitle(false);"/> </content> <implementation> <method name="showtitle"> <parameter name="state"/> <body> if (state) { document.getanonymousnodes(this)[0].setattribute("style","visibility: visible"); } else { document.getanonymousnodes(this)[0].setattribute("style","visibility: collapse"); } </body> </method> </implementation> </binding> the oncommand handlers here first get a reference to their parent bound element.
...it is used to initialize the content such as loading preferences or setting the default values of fields.
Box Objects - Archive of obsolete content
about mozilla layout mozilla divides things into two sets of trees, the content tree and the layout tree.
...these properties will return an empty string if the width or height attributes or properties were not set already.
...this may be a bit confusing, but, the key is to remember that the width and height properties on an element return the size that was set in the xul while the width and height properties of the box object return the current size.
...if this is set to reverse, all of the children in the box are displayed in reverse order.
Commands - Archive of obsolete content
additionally, if you set the disabled attribute on the command, the command will be disabled and it will not be invoked.
... example: toggling command disabled example 2 : source view <command id="cmd_openhelp" oncommand="alert('help');"/> <button label="help" command="cmd_openhelp"/> <button label="more help" command="cmd_openhelp"/> <button label="disable" oncommand="document.getelementbyid('cmd_openhelp').setattribute('disabled','true');"/> <button label="enable" oncommand="document.getelementbyid('cmd_openhelp').removeattribute('disabled');"/> in this example, both buttons use the same command.
... when the disable button is pressed, the command is disabled by setting its disabled attribute, and both buttons will be disabled as well.
... it is normal to put a group of commands inside a commandset element, together near the top of the xul file, as in the following: <commandset> <command id="cmd_open" oncommand="alert('open!');"/> <command id="cmd_help" oncommand="alert('help!');"/> </commandset> a command is invoked when the user activates the button or other element attached to the command.
More Menu Features - Archive of obsolete content
by setting its value to checkbox, the menu item can be checked on and off by selecting the menu item.
... menu with radios in addition to standard checks, you can create the radio style of checks by setting the type to a value of radio.
...in order to group a set of menu items together, you need to put a name attribute on each one to group.
... set the value to the same string.
Stack Positioning - Archive of obsolete content
so if you set a left attribute to 400, the stack will have a width around 400 pixels plus the width of the element.
... width and height the bottom and right attributes can also be used in conjunction with top and left to set the width and/or height of the children of the stack.
... when using these attributes to set width or height, both attributes for the given axis must be explicitly set, eg, if setting width, both "left" and "right" must be set.
...--> </hbox> </stack> in some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results.
Stacks and Decks - Archive of obsolete content
« previousnext » there may be need to display elements as a set of overlapping cards.
...the first, however is offset one pixel to the right and down by adding a padding to its left and top sides.
... this has the result of drawing the same text 'shadowed' again but slightly offset from the other.
...the displayed page of the deck can be changed by setting an selectedindex attribute on the deck element.
Tabboxes - Archive of obsolete content
the user can click each tab to see a different set of options.
... the currently selected tab element is given an additional selected attribute which is set to true.
...you simply set the orient and dir attributes as necessary.
...alternatively, you could set the dir attribute to reverse on the tabbox.
Updating Commands - Archive of obsolete content
command updaters a command updater is a feature of the commandset element which allows it to update commands when certain events happen.
...a simple command updater looks like this: <commandset id="updatepasteitem" commandupdater="true" events="focus" oncommandupdate="goupdatecommand('cmd_paste');"/> a command updater is indicated by using the commandupdater attribute, which should be set to true.
...<commandset id="globaleditmenuitems" commandupdater="true" events="focus" oncommandupdate="goupdateglobaleditmenuitems()"/> <commandset id="selecteditmenuitems" commandupdater="true" events="select" oncommandupdate="goupdateselecteditmenuitems()"/> <commandset id="undoeditmenuitems" commandupdater="true" events="u...
...ndo" oncommandupdate="goupdateundoeditmenuitems()"/> <commandset id="clipboardeditmenuitems" commandupdater="true" events="clipboard" oncommandupdate="goupdatepastemenuitems()"/> next, we'll find out how to use observers.
Using Remote XUL - Archive of obsolete content
this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true.
...we set this value to the mozilla.org home page by default so that page loads into the iframe when we first load the xul document.
...the bar consists of a set of links organized into four main categories: the mozilla organization, developer docs, testing, and tools.
... <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript"> function loadurl(event) { var contentframe = document.getelementbyid("contentframe"); var url = event.target.getattribute("value"); if (url) contentframe.setattribute("src", url); } </script> ...
XUL Reference - Archive of obsolete content
« xul reference « alphabetical list of all xul elements action arrowscrollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale scr...
...ipt scrollbar scrollbox scrollcorner separator spacer spinbuttons splitter stack statusbar statusbarpanel stringbundle stringbundleset tab tabbrowser (firefox-only starting with firefox 3/gecko 1.9) tabbox tabpanel tabpanels tabs template textnode textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage categorical list of all xul elements « xul reference « windows window wizard wizardpage titlebar window structure --- menus and popups ...
... layout --- templates --- scripting --- helper elements other xul lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox caption separator spacer button checkbox colorpicker datepicker menulist progressmeter radio radiogroup scale splitter textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepi...
...cker description label image listbox listitem listcell listcol listcols listhead listheader richlistbox richlistitem tree treecell treechildren treecol treecols treeitem treerow treeseparator box hbox vbox bbox deck stack grid columns column rows row scrollbox action assign binding bindings conditions content member param query queryset rule template textnode triple where script commandset command broadcaster broadcasterset observes key keyset stringbundle stringbundleset arrowscrollbox dropmarker grippy scrollbar scrollcorner spinbuttons all attributes all properties all methods attributes defined for all xul elements style classes event handlers deprecated/defunct markup ...
XUL controls - Archive of obsolete content
<colorpicker type="button" color="#cc0080"/> colorpicker reference <datepicker> a set of textboxes which may be used to allow the entry of a date.
... <datepicker type="grid" value="2007/02/20"/> datepicker reference <datepicker type="popup" > a datepicker which displays a set of textboxes for date entry, but also has a button for displaying a popup calendar grid.
... progressmeter reference <radio> a radio button is used when only one of a set of options may be selected at a time.
... <textbox type="timed"/> textbox reference <timepicker> a timepicker displays a set of textboxes for entering a time.
box - Archive of obsolete content
ArchiveMozillaXULbox
if the box has an orient attribute that is set to horizontal, the child elements are laid out from left to right in the order that they appear in the box.
... if orient is set to vertical, the child elements are laid out from top to bottom.
... <label value="three"/> <label value="four"/> </box> </box> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements vbox, hbox ...
listheader - Archive of obsolete content
if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listcols, listhead, listitem ...
rule - Archive of obsolete content
ArchiveMozillaXULrule
attributes iscontainer, isempty, parent, parsetype examples (example needed) attributes iscontainer type: boolean indicates whether rules match based on containment.
... parent type: element tag name if set, the rule will only match the corresponding tag.
... parsetype type: string if this attribute is set to integer, the rule will only match rdf nodes with a parse type of integer.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
script - Archive of obsolete content
usually, you would set this to application/javascript.
... note: if the javascript file is in chrome://, setting this attribute to application/javascript will always use the latest available javascript version.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
<statusbarpanel> - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
... properties image type: image url gets and sets the value of the image attribute.
... label type: string gets and sets the value of the label attribute.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata style classes the following classes may be used to style the element.
stringbundle - Archive of obsolete content
stringbundles should be placed inside a stringbundleset element.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties applocale obsolete since gecko 1.9.1 type: nsilocale returns the xpcom object which holds information about the use...
... src type: url gets and sets the value of the src attribute.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related xul property files ...
tabpanels - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container to hold the set of pages in a tabbox.
... attributes selectedindex properties selectedindex, selectedpanel examples (example needed) attributes selectedindex type: integer gets and sets the index of the currently selected panel.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tabbox, tabs, tab, tabpanel.
template - Archive of obsolete content
attributes container, member examples (example needed) attributes container type: string may optionally be set to the variable to use as the container or reference variable.
... member type: string may optionally be set to the variable to use as the member variable.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
now you need to set up a special .mozconfig file to tell mozilla to build both xulrunner and your application.
...for example, you might want to set it to "xulrunner" now and run make to ensure that everything is set up correctly so far.
...so for most xulrunner apps that use the mozilla build system, the top-level makefile will contain: dirs = components chrome app the installer/ subdirectory the installer/ makefile lets you create a setup program for distributing your application.
...you shouldn't have to change anything since moz_app_name is automatically set to the name of your application.
Getting started with XULRunner - Archive of obsolete content
step 4: set up application.ini the application.ini file acts as the xulrunner entry point for your application.
...here is mine: [app] vendor=xultest name=myapp version=1.0 buildid=20100901 id=xulapp@xultest.org [gecko] minversion=1.8 maxversion=200.* note: the minversion and maxversion fields indicate the range of gecko versions your application is compatible with; make sure that you set them so that the version of xulrunner you're using is in that range, or your application won't work.
... note: make sure your application name is lowercase and longer than 3 characters step 5: set up the chrome manifest the chrome manifest file is used by xulrunner to define specific uris which in turn are used to locate application resources.
...here is the application root chrome.manifest: manifest chrome/chrome.manifest step 6: set up preferences the prefs.js file tells xulrunner the name of the xul file to use as the main window.
nsIContentPolicy - Archive of obsolete content
type_imageset 21 indicates a request to load an <img> (with the srcset attribute or <picture>.
...this means that implementers of this method must not do any of the following: modify the dom in any way (e.g., setting attributes is a no-no).
... query any dom properties that depend on layout (e.g., offset* properties).
...this is optional only for non-gecko code: all gecko code should set this argument.
NPN_GetValue - Archive of obsolete content
the value parameter should point to a npbool, which will be set appropriately if the function returns nperr_no_error.
...the value parameter should point to an npbool, which will be set appropriately if the function returns nperr_no_error.
... description npn_getvalue returns the browser information set with npn_setvalue.
...see also npn_setvalue, npp_getvalue ...
NPP_Write - Archive of obsolete content
(remark: hence the name "npp_write" is misleading - just think of:"data_arrived") syntax #include <npapi.h> int32 npp_write(npp instance, npstream* stream, int32 offset, int32 len, void* buf); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... offset offset in bytes of buf from the beginning of the data in the stream.
... buf buffer of data, delivered by the stream, that contains len bytes of data offset bytes from the start of the stream.
... the plug-in can use the offset parameter to track the bytes that are written.
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
there are only two key differences: in the npp_setwindow call, the window parameter will be the xid of the hosting xembed window.
...please use the following diagram as a reference: as you can see from the diagram above, it's pretty easy to set up a plugin using gtk2.
... the general idea is that you use the xid that was passed into your npp_setwindow() call and create a gtkplug to host inside of that socket.
...at the browser has the compatibility you require, you can modify your npp_getvalue call like so: nperror npp_getvalue(void *future, nppvariable variable, void *value) { nperror err = nperr_no_error; switch (variable) { case nppvpluginneedsxembed: *((prbool *)value) = pr_true; break; default: err = nperr_generic_error; } return err; } once you have set those variables, it should be relatively easy to set up a plugin.
Tamarin Tracing Build Documentation - Archive of obsolete content
tamarin buildbot tryserver the tryserver/sandbox is setup to allow users to push any code changes that they would like to have tested in the automated build/test process prior to actually pushing the changes.
... the sandbox is setup so that it is able to build and test branches that are based on either tamarin-central or tamarin-tracing.
... any comments, questions or problems can be directed to brent baker how to setup a user repository with the source and patches that will be compiled.
... documentation on how to setup a user repository http://developer.mozilla.org/en/publishing_mercurial_clones.
New in JavaScript 1.3 - Archive of obsolete content
note that communicator and navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "javascript1.3" and higher.
...--> new features in javascript 1.3 new globals nan infinity undefined new methods isfinite() function.prototype.call() function.prototype.apply() date.utc() date.prototype.getfullyear() date.prototype.setfullyear() date.prototype.getmilliseconds() date.prototype.setmilliseconds() date.prototype.getutcfullyear() date.prototype.getutcmonth() date.prototype.getutcdate() date.prototype.getutchours() date.prototype.getutcminutes() date.prototype.getutcseconds() date.prototype.getutcmilliseconds() date.prototype.toutcstring() date.prototype.setutcfullyear() date.prototype.setutcmonth() date.prototype.setutcdate() date.prototyp...
...e.setutchours() date.prototype.setutcminutes() date.prototype.setutcseconds() date.prototype.setutcmilliseconds() other new features strict equality operators unicode support a javascript console was introduced.
... changed functionality in javascript 1.3 changes to date to conform with ecma-262 new constructor date(year, month, day, [,hours [, minutes [, seconds [, milliseconds ]]]]) additional method parameters: setmonth(month[, date]) sethours(hours[, min[, sec[, ms]]]) setminutes(min[, sec[, ms]]) setseconds(sec[, ms]) the length of an array (property length) is now an unsigned, 32-bit integer.
ECMAScript 2015 support in Mozilla - Archive of obsolete content
array object array iteration with for...of (firefox 13) array.from() (firefox 32) array.of() (firefox 25) array.prototype.fill() (firefox 31) array.prototype.find(), array.prototype.findindex() (firefox 25) array.prototype.entries(), array.prototype.keys() (firefox 28), array.prototype.values() array.prototype.copywithin() (firefox 32) get array[@@species] (firefox 48) new map and set objects, and their weak counterparts map (firefox 13) map iteration with for...of (firefox 17) map.prototype.foreach() (firefox 25) map.prototype.entries() (firefox 20) map.prototype.keys() (firefox 20) map.prototype.values() constructor argument: new map(null) (firefox 37) monkey-patched set() in constructor (firefox 37) get map[@@species] (firefox 41) set (f...
...irefox 13) set iteration with for...of (firefox 17) set.prototype.foreach() (firefox 25) set.prototype.entries(), set.prototype.keys(), set.prototype.values() (firefox 24) constructor argument: new set(null) (firefox 37) monkey-patched add() in constructor (firefox 37) get set[@@species] (firefox 41) weakmap (firefox 6) weakmap.clear() (firefox 20) optional iterable argument in weakmap constructor (firefox 36) constructor argument: new weakmap(null) (firefox 37) monkey-patched set() in constructor (firefox 37) weakset (firefox 34) constructor argument: new weakset(null) (firefox 37) monkey-patched add() in constructor (firefox 37) new math functions math.imul() (firefox 20) math.clz32() (firefox 31) math.fround() (fi...
...isnan() (firefox 16) number.isfinite() (firefox 16) number.isinteger() (firefox 16) number.parseint() (firefox 25) number.parsefloat() (firefox 25) number.epsilon (firefox 25) number.max_safe_integer, number.min_safe_integer (firefox 31) number.issafeinteger() (firefox 32) additions to the object object object.prototype.__proto__ has been standardized object.is() (firefox 22) object.setprototypeof() (firefox 31) object.assign() (firefox 34) object.getownpropertysymbols() (firefox 33) additions to the date object date.prototype is an ordinary object (firefox 41) generic date.prototype.tostring (firefox 41) date.prototype[@@toprimitive] (firefox 44) new promise object promise (firefox 24, enabled by default in firefox 29) new proxy object proxy (firefox 18) pre...
...ventextensions() trap (firefox 22) isextensible() trap (firefox 31) getprototypeof() and setprototypeof() traps (firefox 49) new reflect object reflect (firefox 42) additions to the regexp object regexp sticky (y) flag (firefox 38) regexp unicode (u) flag (firefox 46) generic regexp.prototype.tostring (firefox 39) regexp.prototype[@@match]() (firefox 49) regexp.prototype[@@replace]() (firefox 49) regexp.prototype[@@search]() (firefox 49) regexp.prototype[@@split]() (firefox 49) get regexp[@@species] (firefox 49) additions to the string object string.fromcodepoint() (firefox 29) string.prototype.codepointat() (firefox 29) string.prototype.startswith(), string.prototype.endswith() (firefox 17) string.prototype.includes() (firefox 40) (formerly string.prototype.contain...
Object.observe() - Archive of obsolete content
if omitted, the array ["add", "update", "delete", "reconfigure", "setprototype", "preventextensions"] will be used.
...erve(obj, function(changes) { console.log(changes); }); obj.baz = 2; // [{name: 'baz', object: <obj>, type: 'add'}] obj.foo = 'hello'; // [{name: 'foo', object: <obj>, type: 'update', oldvalue: 0}] delete obj.baz; // [{name: 'baz', object: <obj>, type: 'delete', oldvalue: 2}] object.defineproperty(obj, 'foo', {writable: false}); // [{name: 'foo', object: <obj>, type: 'reconfigure'}] object.setprototypeof(obj, {}); // [{name: '__proto__', object: <obj>, type: 'setprototype', oldvalue: <prototype>}] object.seal(obj); // [ // {name: 'foo', object: <obj>, type: 'reconfigure'}, // {name: 'bar', object: <obj>, type: 'reconfigure'}, // {object: <obj>, type: 'preventextensions'} // ] data binding // a user model var user = { id: 0, name: 'brendan eich', title: 'mr.' }; // crea...
...ello, ' + user.title + ' ' + user.name + '!'; } updategreeting(); object.observe(user, function(changes) { changes.foreach(function(change) { // any time name or title change, update the greeting if (change.name === 'name' || change.name === 'title') { updategreeting(); } }); }); custom change type // a point on a 2d plane var point = {x: 0, y: 0, distance: 0}; function setposition(pt, x, y) { // performing a custom change object.getnotifier(pt).performchange('reposition', function() { var olddistance = pt.distance; pt.x = x; pt.y = y; pt.distance = math.sqrt(x * x + y * y); return {olddistance: olddistance}; }); } object.observe(point, function(changes) { console.log('distance change: ' + (point.distance - changes[0].olddistance)); }, [...
...'reposition']); setposition(point, 3, 4); // distance change: 5 specifications not part of any standard.
XForms Select Element - Archive of obsolete content
the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements.
...this attribute, when set to 'open', allows the user to provide free entry to the list.
...the data binding restriction to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from an xforms model.
... the relaxation happens when the itemset element specifies the item value using a copy (see spec) element.
XForms Select1 Element - Archive of obsolete content
the list of pre-defined items can be specified by either item (see the spec) or itemset (see the spec) elements.
... single-node binding special selection - this attribute, when set to 'open', allows the user to provide free entry to the list.
...the data binding restriction to simple content may be relaxed when an itemset element is used, which allows the available choices to be obtained from an xforms model.
... the relaxation happens when the itemset element specifies the item value using a copy (see spec) element.
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
if the author had set a font size on the body element, for example, the font size of text within a table would match the user's default, not the body style.
...in these browsers, a table's text would be the same size as the user's default settings, regardless of the css assigned to ancestor elements such as body.
...*/ table, caption { font-size: -moz-initial; font-weight: -moz-initial; font-style: -moz-initial; font-variant: -moz-initial; } this rule sets all aspects of a table's font, except for the font family, to match the user's preferences setting, thus emulating the behavior of old browsers.
... the value -moz-initial is a proprietary value used to apply the user's (or browser's) default setting for a given property to an element.
The Business Benefits of Web Standards - Archive of obsolete content
storing css in a separate document (aka style sheet) and applying it to a set of html documents permits a complete change of presentation for all these documents in a snap.
...all their documents are properly marked up at the outset.
... by ensuring that all of the digital content owned by the operator is marked up in a consistent and standards compliant way, the content base becomes a perennially reusable asset without any additional costs in the future.
... using xhtml is a way to enter a set of standards composed of xml-based technologies, such as xml, xslt (transforming data), svg (animated graphics), mathml (describing mathematic expressions)...
Move the ball - Game development
defining a drawing loop to keep constantly updating the canvas drawing on each frame, we need to define a drawing function that will run over and over again, with a different set of variable values each time to change sprite positions, etc.
... you can run a function over and over again using a javascript timing function such as setinterval() or requestanimationframe().
...the draw() function will be executed within setinterval every 10 miliseconds: function draw() { // drawing code } setinterval(draw, 10); thanks to the infinite nature of setinterval the draw() function will be called every 10 milliseconds forever, or until we stop it.
...let's define these small values as dx and dy and set their values to 2 and -2 respectively.
Gecko FAQ - Gecko Redirect 1
gecko provides the foundation needed to display content on the screen, including a layout engine and a complementary set of browser components.
... xml 1.0: full support, except for processing to manipulate default attributes rdf: full support, except for abouteach, abouteachprefix, and parsetype javascript 1.5, including ecma-262 edition 3 (ecmascript) compliance, except for date.todatestring and date.totimestring, which are not implemented transfer protocols: http 1.1 (including gzip compression), ftp ssl unicode oji (open java interface) image formats png gif jpeg, pjpeg does "full support" mean that gecko has zero bugs today or will have zero bugs at some p...
... gecko is reusable on all platforms thanks to xpcom, a subset of com that works across platforms.
... gecko includes the following components: document parser (handles html and xml) layout engine with content model style system (handles css, etc.) javascript runtime (spidermonkey) image library networking library (necko) platform-specific graphics rendering and widget sets for win32, x, and mac user preferences library mozilla plug-in api (npapi) to support the navigator plug-in interface open java interface (oji), with sun java 1.2 jvm rdf back end font library security library (nss) original document information author(s): angus other contributors: ekrock, vidur, hidday, drunclear copyright information: portions of this content are © 1998–2006 b...
CDN - MDN Web Docs Glossary: Definitions of Web-related terms
cdns are used widely for delivering stylesheets and javascript files (static assets) of libraries like bootstrap, jquery etc.
... using cdn for those library files is preferable for a number of reasons: serving libraries' static assets over cdn lowers the request burden on an organization's own servers.
... cdns are already configured with proper cache settings.
... using a cdn saves further configuration for static assets on your own servers.
What is accessibility? - Learn web development
it is a good idea to familiarise yourself with screen readers; you should also set up a screen reader and have a play around with it, to get an idea of how it works.
...importantly, though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems.
... accessibility guidelines and the law there are numerous checklists and sets of guidelines available for basing accessibility tests on, which might seem overwhelming at first glance.
... so while the wcag is a set of guidelines, your country will probably have laws governing web accessibility, or at least the accessibility of services available to the public (which could include websites, television, physical spaces, etc.) it is a good idea to find out what your laws are.
Normal Flow - Learn web development
you can't set width or height on inline elements — they just sit inside the content of block level elements.
... if you want to control the size of an inline element in this manner, you need to set it to behave like a block level element with display: block; (or even,display: inline-block; which mixes characteristics from both.) that explains individual elements, but what about how elements interact with one another?
...by default, block-level elements are laid out in the block flow direction, based on the parent's writing mode (initial: horizontal-tb) — each one will appear on a new line below the last one, and they will be separated by any margin that is set on them.
... if two adjacent elements both have the margin set on them and the two margins touch, the larger of the two remains, and the smaller one disappears — this is called margin collapsing, and we have met this before too.
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
it is generally recommended to use classes as much as possible, and to use ids only when absolutely necessary for specific uses (like to connect label and form elements or for styling elements that must be semantically unique): using classes makes your styling extensible — even if you only have one element to style with a particular ruleset now, you might want to add more later.
...it resets it to its default value, which is defined in the css specification of the given property.
...using shorthand with only some attributes is possible and correct, but it must be remembered that undeclared attributes are automatically reset to their default values.
... #stockticker { font-weight: bold; font: 12px verdana; /* font-weight is now set to normal */ } use of the * selector the * wildcard selector refers to any element, and it has to be used with particular care.
Web fonts - Learn web development
in the web-font-start.css file, you'll find some minimal css to deal with the basic layout and typesetting of the example.
...you can find an assessment to verify that you've retained this information at the end of the module — see typesetting a community school homepage.
... summary now that you have worked through our articles on text styling fundamentals, it is time to test your comprehension with our assessment for the module, typesetting a community school homepage.
... previous overview: styling text next in this module fundamental text and font styling styling lists styling links web fonts typesetting a community school homepage ...
What is a web server? - Learn web development
this setup makes it easier to maintain and deliver the content.
... hosting files first, a web server has to store the website's files, namely all html documents and their related assets, including images, css stylesheets, javascript files, fonts, and video.
... a protocol is a set of rules for communication between two computers.
...static websites are the easiest to set up, so we suggest you make your first site a static site.
Other form controls - Learn web development
<select id="simple" name="simple"> <option>banana</option> <option selected>cherry</option> <option>lemon</option> </select> if required, the default value for the select box can be set using the selected attribute on the desired <option> element — this option is then preselected when the page loads.
...the browser usually sets them visually apart from the options (i.e.
... if an <option> element has an explicit value attribute set on it, that value is sent when the form is submitted with that option selected.
...this value is visually rendered as a bar, and to know how this bar looks, we compare the value to some other set values: the low and high values divide the range in three parts: the lower part of the range is between the min and low values, inclusive.
Test your skills: Advanced styling - Learn web development
we've already provided you with a basic reset to build upon.
... advanced form styling 2 in our next task we provide you with a set of three radio buttons.
... we've already provided you with a basic reset to build upon.
...this can be anything you like, but you probably want to set a width and height (of somewhere between about 18 and 24 pixels), and a subtle border and/or background color.
Test your skills: Basic controls - Learn web development
basic controls 2 the next task requires you to create working sets of checkboxes and radio buttons, from the provided text labels.
... turn the first <fieldset>'s contents into a set of radio buttons — you should only be able to select one pony character at once.
... turn the second <fieldset>'s content into a set of checkboxes.
... basic controls 3 the final task in this set requires you to create a file picker.
Front-end web developer - Learn web development
subjects covered the subjects covered are: basic setup and learning how to learn web standards and best practices (such as accessibility and cross-browser compatibility) html, the language that gives web content structure and meaning css, the language used to style web pages javascript, the scripting language used to create dynamic functionality on the web tooling that is used to facilitate modern client-side web development.
...it is important to get you set up and ready to do work for exercises later on in the course.
... guides installing basic software — basic tool setup (15 min read) background on the web and web standards (45 min read) learning and getting help (45 min read) semantics and structure with html time to complete: 35–50 hours prerequisites nothing except basic computer literacy, and a basic web development environment.
... there are no specific assessment articles in this set of modules.
The web and web standards - Learn web development
in the next few years that followed, the web exploded, with multiple browsers being released, thousands of web servers being set up, and millions of web pages being created.
...recent published figures say that there are currently around 19 million web developers in the world, and that figure is set more than double in the next decade.
... cascading style sheets (css) is a rule-based language used to apply styles to your html, for example setting text and background colors, adding borders, animating things, or laying out a page in a certain way.
... so-called "linters", which take a set of rules, look at your code, and highlight places where you haven't followed the rules properly.
Tips for authoring fast-loading HTML pages - Learn web development
depending on a browser's cache settings, it may send a request with the if-modified-since header for each referenced file, asking whether the file has been modified since the last time it was downloaded.
... minify and compress svg assets svg produced by most drawing applications often contains unnecessary metadata which can be removed.
... configure your servers, apply gzip compression for svg assets.
...with this set, the image will only be loaded when it's needed.
Document and website structure - Learn web development
<!doctype html> <html> <head> <meta charset="utf-8"> <title>my page title</title> <link href="https://fonts.googleapis.com/css?family=open+sans+condensed:300|sonsie+one" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="style.css"> <!-- the below three lines are a fix to get html5 semantic elements working in old versions of internet explorer--> <!--[if lt ie 9]> <script src="https://cdnjs.cloudflar...
...set sit amet ipsum mauris.
... <section> is similar to <article>, but it is more for grouping together a single part of the page that constitutes one single piece of functionality (e.g., a mini map, or a set of article headlines and summaries).
...sometimes you might want to just group a set of elements together to affect them all as a single entity with some css or javascript.
Video and audio content - Learn web development
we won't be teaching you how to produce audio and video files — that requires a completely different skillset.
... things become slightly more complicated because not only does each browser support a different set of container file formats, they also each support a different selection of codecs.
...if the aspect ratio is not maintained by the sizes you set, the video will grow to fill the space horizontally, and the unfilled space will just be given a solid background color by default.
... restarting media playback at any time, you can reset the media to the beginning—including the process of selecting the best media source, if more than one is specified using <source> elements—by calling the element's load() method: const mediaelem = document.getelementbyid("my-media-element"); mediaelem.load(); detecting track addition and removal you can monitor the track lists within a media element to detect when tracks are added to or re...
Introducing asynchronous JavaScript - Learn web development
related to blocking), many web api features now use asynchronous code to run, especially those that access or fetch some kind of resource from an external device, such as fetching a file from the network, accessing a database and returning data from it, accessing a video stream from a web cam, or broadcasting the display to a vr headset.
...let's look at another example that loads a resource via the xmlhttprequest api (run it live, and see the source): function loadasset(url, type, callback) { let xhr = new xmlhttprequest(); xhr.open('get', url); xhr.responsetype = type; xhr.onload = function() { callback(xhr.response); }; xhr.send(); } function displayimage(blob) { let objecturl = url.createobjecturl(blob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } loadasset('coffee.jpg', 'b...
...however, we then create a loadasset() function that takes a callback as a parameter, along with a url to fetch and a content type.
... in a less trivial code example, this kind of setup could cause a problem — you can't include an async code block that returns a result, which you then rely on later in a sync code block.
Asynchronous JavaScript - Learn web development
cooperative asynchronous javascript: timeouts and intervals here we look at the traditional methods javascript has available for running code asychronously after a set time period has elapsed, or at a regular interval (e.g.
... a set number of times per second), talk about what they are useful for, and look at their inherent issues.
...this is really useful for setting up a sequence of operations to work correctly.
... making asynchronous programming easier with async and await promises can be somewhat complex to set up and understand, and so modern browsers have implemented async functions and the await operator.
Introduction to web APIs - Learn web development
it provides a special set of constructs you can use to query the twitter service and return specific information.
...— the <audio> element will be played from: const audioelement = document.queryselector('audio'); const playbtn = document.queryselector('button'); const volumeslider = document.queryselector('.volume'); const audiosource = audioctx.createmediaelementsource(audioelement); next up we include a couple of event handlers that serve to toggle between play and pause when the button is pressed and reset the display back to the beginning when the song has finished playing: // play/pause audio playbtn.addeventlistener('click', function() { // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } // if track is stopped, play it if (this.getattribute('class') === 'paused') { audioelement.play(); ...
... this.setattribute('class', 'playing'); this.textcontent = 'pause' // if track is playing, stop it } else if (this.getattribute('class') === 'playing') { audioelement.pause(); this.setattribute('class', 'paused'); this.textcontent = 'play'; } }); // if track ends audioelement.addeventlistener('ended', function() { playbtn.setattribute('class', 'paused'); playbtn.textcontent = 'play'; }); note: some of you may notice that the play() and pause() methods being used to play and pause the track are not part of the web audio api; they are part of the htmlmediaelement api, which is different but closely-related.
... the following code provides a simple example of how this would be used: let requesturl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new xmlhttprequest(); request.open('get', requesturl); request.responsetype = 'json'; request.send(); request.onload = function() { const superheroes = request.response; populateheader(superheroes); showheroes(superheroes); } note: you can see this code in action in our ajax.html example (see it live also).
Arrays - Learn web development
you can access an item inside an array that is itself inside another array by chaining two sets of square brackets together.
... 'trousers:31.99' 'shoes:23.99'; for (let i = 0; i <= 0; i++) { // number 2 // number 3 // number 4 // number 5 let itemtext = 0; const listitem = document.createelement('li'); listitem.textcontent = itemtext; list.appendchild(listitem); } totalbox.textcontent = 'total: $' + total.tofixed(2); </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', funct...
...item.textcontent = itemtext; list.appendchild(listitem); } // if the array length is 5 or more, remove the oldest search term if (myhistory.length >= 5) { // number 2 } // empty the search input and focus it, ready for the next term to be entered searchinput.value = ''; searchinput.focus(); } } </textarea> <div class="playable-buttons"> <input id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> html { font-family: sans-serif; } h2 { font-size: 16px; } .a11y-label { margin: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); cons...
...t solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solution'; } updatecode(); }); const jssolution = 'const list = document.queryselector(\'.output ul\');\nconst searchinput = document.queryselector(\'.output input\');\nconst searchbtn = document.queryselector(\'.ou...
Basic math in JavaScript — numbers and operators - Learn web development
this is especially true when we are learning to program javascript (or any other language for that matter) — so much of what we do relies on processing numerical data, calculating new values, and so on, that you won't be surprised to learn that javascript has a full-featured set of math functions available.
...you may have encountered these numbers before when setting colors in css.
...for example: let num1 = 10; let num2 = 50; 9 * num1; num1 ** 3; num2 / num1; last for this section, try entering some more complex expressions, such as: 5 + 10 * 3; num2 % 9 * num1; num2 + num1 / 8 + 2; some of this last set of calculations might not give you quite the result you were expecting; the section below might well give the answer as to why.
...you can always press the reset button to get things working again.
Aprender y obtener ayuda - Learn web development
it is great that you are putting some time into learning a new set of skills, but there are good practices to employ that will make your learning more effective.
... getting help web development requires you to learn a complex set of skills — you are bound to get stuck sometimes and need help.
... if you want to find out more about a specific technology feature, such as the html <video> element, or the css background-color or opacity properties, or the javascript date.settime() method, you should just search for the feature's name.
... if you are looking for some more specific information, you can add other keywords as modifiers, for example "<video> element autoplay attribute", or "date.settime parameters".
Multimedia: Images - Learn web development
beyond loading a subset of images, next you should look into the format of the images themselves: are you loading the most optimal file formats?
...a quality setting of 75% should yield decent results.
...for this reason, it's critical that you set width and height attributes so that the browser can reserve space for them in the layout.
... for any background images, it's important you set a background-color value so any content overlaid is still readable before the image has downloaded.
Properly configuring server MIME types - Learn web development
the http specification defines a superset of mime which is used to describe the media types used on the web.
... gecko 1.9.1.11 (firefox 3.5.11) and gecko 1.9.2.5 (firefox 3.6.5) also implement this security fix, but to improve compatibility, there was a temporary heuristic that allows the load if the first line in the style sheet appears to be a well-formed css construct; the heuristic has been removed in firefox 4, and you have to properly set the text/css mime types to have your css pages recognized.
... how to set up your server to send the correct mime types the fundamental idea is to configure your server to send the correct content-type http header for each document.
... for a java servlet, you should have the line response.setcontenttype("text/html"); at the top of your doget or dopost method, where response is a reference to the httpservletresponse.
Framework main features - Learn web development
given this handlebars template: <header> <h1>hello, {{subject}}!</h1> </header> and this data: { subject: "world" } handlebars will build html like this: <header> <h1>hello, world!</h1> </header> typescript typescript is a superset of javascript, meaning it extends javascript — all javascript code is valid typescript, but not the other way around.
...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...
...let’s update our counterbutton code from above to allow it to count clicks: function counterbutton() { const [count, setcount] = usestate(0); return ( <button onclick={() => setcount(count + 1)}>clicked {count} times</button> ); } in this version we are using additional usestate() functionality to create a special setcount() function, which we can invoke to update the value of count.
... we call this function on line 4, and set count to whatever its current value is, plus one.
Accessibility in React - Learn web development
including keyboard users at this point, we've accomplished all of the features we set out to implement.
...to do that, we'll add an attribute of ref to each element, and set their values to the appropriately named ref objects.
... the textbox <input> in your editing template should be updated like this: <input id={props.id} classname="todo-text" type="text" value={newname} onchange={handlechange} ref={editfieldref} /> the "edit" button in your view template should read like this: <button type="button" classname="btn" onclick={() => setediting(true)} ref={editbuttonref} > edit <span classname="visually-hidden">{props.name}</span> </button> focusing on our refs with useeffect to use our refs for their intended purpose, we need to import another react hook: useeffect().
... using useeffect() to control our heading focus now that we've stored how many tasks we previously had, we can set up a useeffect() hook to run when our number of tasks changes, which will focus the heading if the number of tasks we have now is less than with it previously was — i.e.
Componentizing our Svelte app - Learn web development
add the following set of functions below your previous function to handle these actions: function oncancel() { name = todo.name // restores name to its initial value and editing = false // and exit editing mode } function onsave() { update({ name: name }) // updates todo name editing = false // and exit editing mode } function...
... <button type="button" class="btn" on:click={onedit}> edit<span class="visually-hidden"> {todo.name}</span> </button> <button type="button" class="btn btn__danger" on:click={onremove}> delete<span class="visually-hidden"> {todo.name}</span> </button> </div> {/if} </div> it is worth noting that: when the user presses the edit button we execute onedit(), which just sets the editing variable to true.
...on:click={oncancel} type="button"> cancel<span class="visually-hidden">renaming {todo.name}</span> </button> <button class="btn btn__primary todo-edit" type="submit" disabled={!name}> save<span class="visually-hidden">new name for {todo.name}</span> </button> </div> </form> {:else} [...] when the user presses the edit button, the editing variable will be set to true, and svelte will remove the markup in the {:else} part of the dom and replace it with the markup in the {#if...} section.
... the <input>'s value property will be bound to the name variable, and the buttons to cancel and save the changes call oncancel() and onsave() respectively (we added those functions earlier): when oncancel() is invoked, name is restored to its original value (when passed in as a prop) and we exit editing mode (by setting editing to false).
Implementing feature detection - Learn web development
give it the following contents: const conditional = document.queryselector('.conditional'); const testelem = document.createelement('div'); if (testelem.style.flex !== undefined && testelem.style.flexflow !== undefined) { conditional.setattribute('href', 'flex-layout.css'); } else { conditional.setattribute('href', 'float-layout.css'); } here we are grabbing a reference to the second <link> element, and creating a <div> element as part of our test.
... property on element retains value create an element in memory using document.createelement(), set a property to a certain value, then check to see if the value is retained.
...so here we're applying the top set of rules only to browsers that do support flexbox, and the bottom set of rules only to browsers that don't (no-flexbox).
... previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Command line crash course - Learn web development
better programs exist for providing a terminal experience on windows, such as powershell (see here to find installers), and gitbash (which comes as part of the git for windows toolset) however, the best option for windows in the modern day is the windows subsystem for linux (wsl) — a compatibility layer for running linux operating systems directly from inside windows 10, allowing you to run a “true terminal” directly on windows, without needing a virtual machine.
...all the operating systems (assuming a default setup) will launch their terminal program in your "home" directory, and from there you’re likely to want to move to a different place.
...anted to go to a directory called src, located inside a directory called project, located on the desktop, you could type these three commands to get there from your home folder: cd desktop cd project cd src but this a waste of time — instead, you can type one command, with the different items in the path separated by forward slashes, just like you do when specifying paths to images or other assets in css, html, or javascript code: cd desktop/project/src note that including a leading slash on your path makes the path absolute, for example /users/your-user-name/desktop.
... uses less disk space related to the previous point, it makes project code harder to replicate (if you install your tools locally, they can be set up as dependencies and installed with npm install).
Deploying our app - Learn web development
however, we do have to set these steps up, and we'll look at that now.
... this is where our code, github, and netlify need to be set up to talk to one another, so that each time we update our github code repository, netlify will automatically pick up the changes, run the build tasks, and finally release a new update.
...this step isn't necessary, but it is a good best practice to get into the habit of setting up — across all our projects, we can then rely on npm run build to always do the complete build step, without needing to remember the specific build command arguments for each project.
... could you set up a notification to let you know when a new deploy succeeded or failed?
Accessibility API cross-reference
gridcell a type of mouse pointer used for resizing windows grip n/a n/a n/a probably a group box (titledbox in mozilla) grouping panel panel group <fieldset>, <div> a heading for a section of the page.
... menuitemcheckbox a checkable menuitem in a set of elements with the same role, only one of which can be checked at a time.
... sectionhead (abstract role) a form widget that allows the user to make selections from a set of choices.
... n/a n/a aria-controls indicates the element that represents the current item within a container or set of related elements.
Benchmarking
this setting reduces build times significantly but comes with a serious hit to runtime performance for any rust code (for example stylo and webrender).
...the poisoning can be disabled by setting the environment variable jsgc_disable_poisoning=1 before starting the browser.
...set it to false to match a release build.
...in about:addons > plugins, set shockwave flash to "never activate".
Browser chrome tests
gbrowser is set in browser.js and is a tabbrowser element (the tabbrowser with id="content" in browser.xul).
... function test() { waitforexplicitfinish(); settimeout(completetest, 1000); } function completetest() { ok(true, "timeout ran"); finish(); } if your test is randomly timing out and you think that's just due to it taking too long, you can extend the timeout.
... requestlongertimeout(2); waitforexplicitfinish(); settimeout(completetest, 40000); } function completetest() { ok(true, "timeout did not run"); finish(); } exceptions in tests any exceptions thrown under test() will be caught and reported in the test output as a failure.
...for instance, if you change a preference you want to make sure that the preference is always reset so that it doesn't impact other tests after yours.
Continuous Integration
hf - static rooting hazard analysis s - static analysis v - valgrind build and test jobs; these jobs create valgrind-compatible builds and run a small set of valgrind tests on them.
... each talos suite contains a set of tests or pages, some of these in turn have sub-tests.
... other performance systems autophone (android) autophone is a test harness which runs a set of performance tests on a variety of real android phones.
...you can view the current set of alerts on the perfherder alerts dashboard.
Debugging Frame Reflow
log file analysis the log file for a simple table like <!doctype html public "-//w3c//dtd html 4.01 transitional//en"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="100"> <tbody> <tr> <td>foo</td> </tr> </tbody> </table> </body> </html> will create the following log: vp 00b97c30 r=0 a=9180,4470 c=9180,4470 cnt=856 scroll 00b97ee0 r=0 a=9180,4470 c=9180,4470 cnt=857 scroll 00b97ee0 r=0 a=9180,4470 c=9180,4470 cnt=858 canvas 00b97c6c r=0 a=9180,uc c=9180,4470 cnt=859 area 02d7afe4 r=0 a=9180...
...frames with children that overflow the parent have the ns_frame_outside_children flag set.
...other reflow debug options gecko_display_reflow_flag_pixel_errors setting this option via set gecko_display_reflow_flag_pixel_errors = 1 enables a verification for each coordinate value that the coordinates are aligned at pixel boundaries.
...gecko_display_reflow_indent_undisplayed_frames setting this option via set gecko_display_reflow_indent_undisplayed_frames = 1 will cause an advance of the indent even for frames which are blocked via the reflow rules file.
Simple Sunbird build
(if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'.
... on windows, if you open the command prompt you are usually in your user profile folder which often contains spaces ( c:\documents and settings\...).
... # get the source hg clone http://hg.mozilla.org/comm-central/ cd comm-central python client.py checkout # setup a basic .mozconfig file echo 'ac_add_options --enable-application=calendar' > .mozconfig # let's build sunbird...
... building sunbird and lightning if you've set up you build environment as above, then all you need to do is: echo 'ac_add_options --enable-calendar' >> .mozconfig or just add the ac_add_options --enable-calendar line to your .mozconfig with your favourite editor.
Windows SDK versions
visual c++ 10 (vs2010) professional this comes with the windows 7 sdk, so you should be all set out of the box.
...windows 8 sdk (official) features that depend on this sdk include: metro firefox front end gamepad api support you can download the sdk from the microsoft download center [web setup].
... windows 7 sdk features that depend on this sdk include: windows 7 taskbar previews windows 7 download taskbar progress windows 7 jump lists you can download the sdk (v7.0 [web setup or iso image] or unsupported v7.1 [web setup or iso image]) from the microsoft download center.
...(this was certainly the case for 64 bit windows 7 on a late 2008 macbook pro.) warning: due to a bug in windows 7 sdk, if you get "sdksetup encountered an error: expecting path %systemroot% to represent a valid system volume" error you may require to set environmental variable %windir% to something like "c:\windows" instead of "%systemroot%".
Experimental features in Firefox
nightly 74 no developer edition 74 no beta 74 no release 74 no preference name dom.input_events.beforeinput.enabled htmlmediaelement method: setsinkid() htmlmediaelement.setsinkid() allows you to set the sink id of an audio output device on an htmlmediaelement, thereby changing where the audio is being output.
... nightly 64 no developer edition 64 no beta 64 no release 64 no preference name media.setsinkid.enabled htmlmediaelement properties: audiotracks and videotracks enabling this feature adds the htmlmediaelement.audiotracks and htmlmediaelement.videotracks properties to all html media elements.
...the network.ftp.enabled preference must be enabled (set to true) to allow ftp to be used.
...this feature lets you test your code without having to change settings in your browser (or operating system, if the browser follows a system-wide color scheme setting).
Storage access policy: Block cookies from trackers
the cookie policy can be enabled in other versions of firefox through the content blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate firefox version).
...specifically, firefox does this by imposing the following restrictions: cookies: block cookie request headers and ignore set-cookie response headers.
... return an empty string for calls to document.cookie and ignore requests to set cookies via document.cookie.
... http referrers the default referrer policy for third-party resources classified as trackers is set to strict-origin-when-cross-origin.
Firefox and the "about" protocol
the most useful is the url about:config, which displays preferences and settings that can be inspected and changed.
...-ons manager about:buildconfig displays the configuration and platform used to build firefox about:cache displays information about the memory, disk, and appcache about:checkerboard switches to the checkerboarding measurement page, which allows to detect checkerboarding issues about:config provides a way to inspect and change firefox preferences and settings about:compat lists overriding site compatability fixes, linked to specific bug issues.
...etworking displays networking information about:newtab start page when opening a new tab about:performance displays memory and performance information about firefox subprocesses/add-ons/tabs about:plugins displays information about installed plugins about:policies lists out the firefox for enterprise policies about:preferences firefox settings (also available through firefox menu > options) about:privatebrowsing start page when opening a private window about:profiles display and manage firefox profiles about:protections privacy protections report consisting of enhanced tracking protection, firefox monitor and firefox lockwise data about:restartrequired a page users are sent to when f...
...hile firefox is running (in case the user enabled telemetry) about:url-classifier displays the status of the url classifier services that firefox uses (for example for safe browsing) about:webrtc information about webrtc usage about:welcome page first displayed when firefox is installed about:welcomeback information page displayed after firefox is reset these urls are defined in docshell/base/nsaboutredirector.cpp within the kredirmap array.
Introduction to Layout in Mozilla
may not be directly manipulated detailed walk-through setting up content model construction frame construction style resolution reflow painting setting up assume basic knowledge of embedding and network apis (doc shell, streams) content dll auto-registers a document loader factory (dlf) @mozilla.org/content-viewer-factory/view;1?type=text/html all mime types mapped to the same class, nscontentdlf nsdocshell ...
...notifications passes these to the style set object, who in turn passes to the frame constructor frame constructor creates frames constructframeinternal recursively walks content tree, resolves style and creates frames either created by tag (<select>) or by display type (<p>) frame manager maintains mapping from content to frame style resolution compute stylistic information based on the style rules that ...
...reset style context object is a placeholder for partially computed stylistic data style data is computed lazily, as it is asked for reflow recursively compute geometry (x, y, w, h) for frames, views, and widgets given w & h constraints of “root frame” compute (x, y, w, h) for all children constraints propagated “down” via nshtmlreflowstate desired size returned “up” via nshtmlreflowmetrics basic pattern parent frame initializes child reflow state (available w, h); places child frame (x, y); invokes child’s reflow method child frame computes desire...
...shell method incremental reflows targeted at a specific frame dirty, content-changed, style-changed, user-defined nshtmlreflowcommand object encapsulates info queued and processed asynchronously, nsipressshell::appendreflowcommand, processreflowcommands incremental reflow recursively descend to target recovering reflow state child rs.reason set to incremental incremental reflow process reflow “normally” at target frame child rs.reason set based on rc’s type incremental reflow propagate damage to frames later “in the flow” incremental reflow multiple reflow commands are batched nsreflowpath maintains a tree of target frames amortize state recovery and damage propagation cost ...
Dict.jsm
method overview dict copy(); boolean del(string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array listvalues(); void set(string akey, object avalue); string tojson(); string tostring(); properties attribute type description count number the number of items in the dictionary.
... set() sets the value for a given key, adding a new key to the dictionary if necessary.
... void set( string akey, object avalue ); parameters akey the key whose value is to be set.
... var mydict = new dict(); mydict.set("name", "john smith"); mydict.set("email", "jsmith@example.com"); mydict.set("phone", "650-555-1234"); working with existing keys you can then check to see if a given key exists: if (mydict.has("email")) { /* an "email" key exists on the object */ } ...
Downloads.jsm
example (using task.jsm): try { yield downloads.fetch(sourceuri, targetfile); } catch (ex if ex instanceof downloads.error && ex.becausetargetfailed) { console.log("unable to write to the target file, ignoring the error."); } methods createdownload() creates a new download object.
...you may pass an object with a subset of the following fields: isprivate: optional indicates whether the download originated from a private window.
...you can use download objects as keys in a set or map to associate your own state to them for the session.
...to enable the new download manager : first you have to set the pref browser.download.usejstransfer to true.
PerfMeasurement.jsm
method overview static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data.
...note: these values are all zeroed (or set to -1, for events not being measured) when you initialize the perfmeasurement object, then they are not zeroed again unless you explicitly call the reset() method.
...reset() resets all the enabled counters to zero.
... void reset(); parameters none.
PopupNotifications.jsm
for most use cases, the value of this parameter should be date.now() plus an offset indicating the amount of time the notification should be kept open (for example, date.now() + 30000 for 30 seconds).
... nevershow notifications with this parameter set to true will be removed when they would have otherwise been dismissed (i.e.
... removeondismissal notifications with this parameter set to true will be removed when they would have otherwise been dismissed (that is, any time the popup is closed due to user interaction).
...setting this property will make the prompt display a "learn more" link that, when clicked, opens the url in a new tab.
PromiseWorker.jsm
here's the simplified diagram of how promiseworker works (svg version of the promiseworker diagram) setup and usage this section explains how to set up and use a promiseworker.
...but you can instantiate abstractworker itself and set its properties later, instead of creating derived class.
...this is seen in a simple demo github :: promiseworker custom errors demo - main thread setup.
...myworker.exceptionhandlers['customerror'] = customerror.frommsg; this is seen in a simple demo at github :: promiseworker custom errors demo - worker side setup.
openLocationLastURL.jsm
(bug 953124) the openlocationlasturl.jsm javascript code module lets you set and retrieve the url most recently opened using the "open location" option in the file menu.
...using the openlocationlasturl object to get or set the value of the open location edit box, simply read the value of, or set the value of, the openlocationlasturl.value field: var url = openlocationlasturl.value; openlocationlasturl.value = "http://www.mozilla.org/"; to reset the value of the edit box to the default (which is an empty string), you can call the reset() method: method overview reset() methods reset the reset() met...
...hod resets the saved url to the default, which is an empty string.
... reset(); parameters none.
Application Translation with Mercurial
launch the installed mozillabuild toolset by launching it with its path, e.g.
... configuring your mercurial user settings still in the command prompt, go to your home directory in the file system, e.g.
... for a windows user, it looks like c:\users\myname , depending on your windows version: cd /c/users/myname now list all the files here: ls -a if there is no file called .hgrc , create it with > .hgrc this file stores your general mercurial settings (mercurial is the tool which manages the source code and its history of changes).
...aboutprivatebrowsing.dtd, patch, v1 go to the review 'flags' category and set the one for review to ?, meaning that you request review for the patch.
Uplifting a localization from Central to Aurora
let's pretend it's at releases/l10n-mozilla-aurora/ab-cd here's how we do it: # set up a new local clone of your central repo hg clone l10n-central/ab-cd workrepo cd workrepo # pull in the changesets you have on aurora hg pull -r default ../releases/l10n/mozilla-aurora/ab-cd now, there are two routes forward: 1) things are pretty silent.
...this looks something like searching for changes adding changesets adding manifests adding file changes added 22 changesets with 23 changes to 46 files (+1 heads) (run 'hg heads' to see heads, 'hg merge' to merge) ok, let's make sure we're not talking relbranches: hg heads --template '{node} {branches}\n' this is printing something like 5131e147fa50c28ec858c7d9fd1ba201ea2a433b 4da525ed77699794c56081791bd46cc85983f6f8 9bc7e6c58fc091c8cd0e8d9e1dbc7e6f592772a7 gecko20b12_2011022218_relbranch 230e99fada602842d9630e673077ef9f1ab34247 gecko20b12pre_20110216_relbranch 41a4357884d7bcc50e69c71014124d3af2482a...
...fe comm20b11_20110203_relbranch 2ec6ad14e7168ebeb999b1e8ae10632ae4c9df23 gecko20b11_2011020209_relbranch d68e647ac3c0fee709c13abb0f03fac24a1a5d29 gecko20b11pre_20110126_relbranch 7ff37dc6837669363a51ad3fd2874ac845d312d5 gecko20b10_2011012115_relbranch 6c31fe9bc065a86aea2223ba48698f18ae7563ad gecko20b9_2011011018_relbranch here you can see that there are two changesets without a branch.
...in the workrepo directory, do #verify that we didn't forget changesets hg inc ../l10n-central/ab-cd comparing with ../l10n-central/ab-cd searching for changes no changes found hg inc -r default ../releases/l10n/mozilla-aurora/ab-cd comparing with ../releases/l10n/mozilla-aurora/ab-cd searching for changes no changes found # push to central hg push ../l10n-central/ab-cd # push to aurora hg push ../releases/l10n/mozilla-aurora/ab-cd # push l...
Basics
with mathml, one can build sets such as (go on, right-click any of these equations to experiment the zoom) { 0 , 1 , 2 , 3 , 4 } or { ⌊ a b ⌋ | a 2 + b 2 ≤ 3 } , write calculus d y d x = 1 y 2 , form rather complicated expressions lim n → n ( 1 + 1 n ) n − e n , k = ∂ 2 z ∂ x 2 ∂ 2 z ∂ y 2 - ( ∂ 2 z ∂ x ∂ y ) 2 ...
... f ( 4 ) ( η ) , a ≤ η ≤ b | x | = { - x if x < 0 x otherwise you can also typeset 2d mathematical constructs such as matrices.
...mi>x</mi> <mo>&invisibletimes;</mo> <msup> <mi>y</mi> <mn>4</mn> </msup> </mrow> <mo>+</mo> <msup> <mi>y</mi> <mn>5</mn> </msup> </mrow> </maction> </mtd> </mtr> </mtable> </mtd> </mtr> </mtable> </math> </div> css content .control { text-decoration: none; font-weight: bold; font-size: 200%; } input { color: red; } [class="inputmath"] { border: 1px dotted; } javascript content function setselection(id,value) { document.getelementbyid(id).setattribute("selection",value); } function expand() { setselection("a11","2"); setselection("a12","2"); setselection("a13","2"); setselection("a21","2"); setselection("a22","2"); setselection("a23","2"); setselection("a31","2"); setselection("a32","2"); setselection("a33","2"); setselection("a41","2"); setselection("a42","2"); sets...
...election("a43","2"); } function unexpand() { setselection("a11","1"); setselection("a12","1"); setselection("a13","1"); setselection("a21","1"); setselection("a22","1"); setselection("a23","1"); setselection("a31","1"); setselection("a32","1"); setselection("a33","1"); setselection("a41","1"); setselection("a42","1"); setselection("a43","1"); } function incrementinput(inputid, increment) { var inputelement = document.getelementbyid(inputid); var size = parseint(inputelement.size) + increment; if (size <= 0) size = 1 inputelement.size = size; } and there could be more...
MathML Accessibility in Mozilla
abcd e __________ the set a ; b ; c ; d ; e end set __________ not supported.
... abcde __________ the set a ; b ; c comma d comma e end set __________ not supported.
..., b ⏞ ℓ b 's ⏟ k + ℓ elements } __________ the set modified modified a comma ...
... comma b with modified over brace with script l b apostraphes above above with modified under brace with k plus script l elements below below end set __________ { a , ...
MathML Demo: <mspace> - space
mathml demo: <mspace> - space the background color of <mspace> elements has been set to yellow for easier viewing.
... you can set the width ∑ x y height ∫ x y and depth [ x y ] of mspace elements (click the math text to view the numeric values that are set).
... title="decrease depth">-</a> <math display="block"> <mstyle displaystyle="true"> <msqrt> <mrow> <mn>3</mn> <mspace style="background-color: yellow" id="thespace" height="0.1ex" depth="0.1ex" width="0.1em" /> <mi>x</mi> </mrow> </msqrt> </mstyle> </math> </p> javascript content var height=0; var width=0; var depth=0; function upheight() { height++; document.getelementbyid("thespace").setattribute("height",height+".1ex"); } function downheight() { height--; document.getelementbyid("thespace").setattribute("height",height+".1ex"); } function upwidth() { width++; document.getelementbyid("thespace").setattribute("width",width+".1em"); } function downwidth() { width--; document.getelementbyid("thespace").setattribute("width",width+".1em"); } function updepth() { depth++;...
... document.getelementbyid("thespace").setattribute("depth",depth+".1ex"); } function downdepth() { depth--; document.getelementbyid("thespace").setattribute("depth",depth+".1ex"); } ...
Using the viewport meta tag to control layout on mobile browsers
it can be set to a specific number of pixels like width=600 or to the special value device-width, which is the width of the screen in css pixels at a scale of 100%.
... viewport width and screen width sites can set their viewport to a specific size.
...(allen pike's choosing a viewport for ipad sites has a good explanation for web developers.) for pages that set an initial or maximum scale, this means the width property actually translates into a minimum viewport width.
...if web developers want their scale settings to remain consistent when switching orientations on the iphone, they must add a maximum-scale value to prevent this zooming, which has the sometimes-unwanted side effect of preventing users from zooming in: <meta name="viewport" content="initial-scale=1, maximum-scale=1"> suppress the small zoom applied by many smartphones by setting the initial scale and minimum-scale values to 0.86.
Mozilla Quirks Mode Behavior
(bug 915053) an empty string for the background attribute sets the background url to empty only in quirks mode.
... in quirks mode, when tables have a border style of inset or outset, the border color is based on the background color of the table or of the nearest ancestor with non-transparent background.
...i don't follow the code in nscssrenderingborders well enough to tell, though.] in quirks mode a fixed width specified on a table cell resets the nowrap attribute.
... in a frameset cols/rows specification 0* is treated as 1* (see bug 40383).
Gecko Profiler FAQ
the current setup requires each thread that you want to profile to notify the profiler about its existence.
... [ehsan] try clicking the toolbar icon for the extension, expanding the settings section, and enter the secret cheat code “,” in the threads field and click on “apply (restart profiler)”.
... i there an equivalent to itimer_prof vs itimer_real settings?
...start the browser with the environment variable moz_profiler_startup=1 set.
Leak-hunting strategies and tips
if you really need to debug leaks that involve js objects closely, you can get detailed printouts of the paths js uses to mark objects when it is determining the set of live objects by using the functions added in bug 378261 and bug 378255.
...it may just involve setting the xpc_shutdown_heap_dump environment variable to a file name, but i haven't tested that.) post-processing of stack traces on mac and linux, the stack traces generated by our internal debugging tools don't have very good symbol information (since they just show the results of dladdr).
... getting symbol information for system libraries windows setting the environment variable _nt_symbol_path to something like symsrv*symsrv.dll*f:\localsymbols*http://msdl.microsoft.com/download/symbols as described in microsoft's article.
...some places you can do this are: layout engine define debug_tracemalloc_framearena where it is commented out in layout/base/nspresshell.cpp glib set the environment variable g_slice=always-malloc other references performance tools leak debugging screencasts (dbaron) leakingpages - a list of pages known to leak mdc:performance - contains documentation for all of our memory profiling and leak detection tools ...
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.
... set it to true to enable it, or false to disable it.browser.dom.window.dump.filebrowser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true.
...if set to true, the data is stored as content preference.browser.pagethumbnails.capturing_disabledthe preference browser.pagethumbnails.capturing_disabled controls whether the application creates screenshots of visited pages which will be shown if the web page is shown in the grid of the "new tab page" (about:newtab) which offers the most often visited pages for fast navigation.browser.search.context.loadinbackgroundbrowser.search.context.loadinbackground controls whether a search from the context menu with "search <search engine> for <selected ...
...the old behavior can be restored by setting the preference mail.tabs.drawintitlebar to false.nglayout.debug.disable xul fastloadthe preference nglayout.debug.disable_xul_fastload controls whether or not xul fastload is used.nglayout.debug.disable_xul_cacheto improve performance, mozilla caches chrome xul documents the first time they load for faster loading later.
Research and prep
local search a good test is if you were to run a set of comparative queries; the secondary engine should produce the best local language results and the primary/default position should produce the best global results.
... e-commerce search amazon broad set of products, simple search interface with no/limited advertising, popular shopping engine.
... e-commerce search amazon broad set of products, simple search interface with no/limited advertising, popular shopping engine.
... e-commerce search amazon broad set of products, simple search interface with no/limited advertising, popular shopping engine.
Nonblocking IO In NSPR
typically, this central thread invokes <tt>pr_poll()</tt> on a set of nonblocking file descriptors.
...one can make the new socket nonblocking by using <tt>pr_setsockopt()</tt> as in the example below (error checking is omitted for clarity): <tt>prfiledesc *sock;</tt> <tt>printn optval = 1;</tt> <tt>sock = pr_newtcpsocket();</tt> /* * make the socket nonblocking */ pr_setsockopt(sock, pr_sockopt_nonblocking, &optval, sizeof(optval)); programming constraints there are some constraints due to the use of nt asynchronous i/o in the nspr.
...also, native file descriptors (socket handles) cannot be added to <tt>pr_fd_set</tt>, i.e., the functions <tt>pr_fd_nset</tt>, <tt>pr_fd_nclr</tt>, <tt>pr_fd_nisset</tt> do not work.
...if <tt>pr_poll()</tt> reports that the socket is readable (i.e., <tt>pr_poll_read</tt> is set in <tt>out_flags</tt>), and <tt>pr_available()</tt> returns 0, this means that the socket connection is closed.
Logging
nspr provides a set of logging functions that conditionally write printf() style strings to the console or to a log file.
...set one of the compile-time defines when you build your application.
... log types and variables two types supporting nspr logging are exposed in the api: prlogmoduleinfo prlogmodulelevel two environment variables control the behavior of logging at execution time: nspr_log_modules nspr_log_file logging functions and macros the functions and macros for logging are: pr_newlogmodule pr_setlogfile pr_setlogbuffering pr_logprint pr_logflush pr_log_test pr_log pr_assert pr_assert pr_static_assert (new in nspr 4.6.6xxx this hasn't been released yet; the number is a logical guess) pr_not_reached use example the following sample code fragment demonstrates use of the logging and debugging aids.
... before running the compiled program, set the environment variable nspr_log_modules to userstuff:5 static void userlogstuff( void ) { prlogmoduleinfo *mylm; printn i; pr_static_assert(5 > 4); /* nspr 4.6.6 or newer */ mylm = pr_newlogmodule( "userstuff" ); pr_assert( mylm ); pr_log( mylm, pr_log_notice, ("log a notice %d\n", 999 )); for (i = 0; i < 10 ; i++ ) { pr_log( mylm, pr_log_debug, ("log debug number: %d\n", i)); pr_sleep( 500 ); } pr_log( mylm, pr_log_notice, "that's all folks\n"); } /* end userlogstuff() */ see also nspr logging reference ...
NSPR LOG MODULES
these controls should be set in the nspr_log_modules environment variable at execution time to affect nspr's log service for your application.
...to enable all log module calls to pr_log, set the variable as follows: set nspr_log_modules=all:5 timestamp including timestamp results in a timestamp of the form "2015-01-15 21:24:26.049906 utc - " prefixing every logged line.
... bufsize:size the name bufsize:size sets the log buffer to size.
... set nspr_log_modules=timestamp,mozstorage:5 set nspr_log_file=/tmp/foo.log logging with try server for mochitest, edit variable nspr_log_modules in testing/mochitest/runtests.py before pushing to try.
PRLinger
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.
...the pr_sockopt_linger socket option, with a value represented by a structure of type prlinger, makes it possible to change this default as follows: if polarity is set to pr_false, pr_close returns immediately, but if there are any data remaining in the socket send buffer, the runtime attempts to deliver the data to the peer.
... if polarity is set to pr_true and linger is set to 0 (pr_interval_no_wait), the runtime aborts the connection when it is closed and discards any data remaining in the socket send buffer.
... if polarity is set to pr_true and linger is nonzero, the runtime lingers when the socket is closed.
PRSeekWhence
specifies how to interpret the offset parameter in setting the file pointer associated with the fd parameter for the pr_seek and pr_seek64 functions.
... syntax #include <prio.h> typedef prseekwhence { pr_seek_set = 0, pr_seek_cur = 1, pr_seek_end = 2 } prseekwhence; enumerators the enumeration has the following enumerators: pr_seek_set sets the file pointer to the value of the offset parameter.
... pr_seek_cur sets the file pointer to its current location plus the value of the offset parameter.
... pr_seek_end sets the file pointer to the size of the file plus the value of the offset parameter.
PR_GMTParameters
returns the time zone offset information that maps the specified prexplodedtime to gmt.
... syntax #include <prtime.h> prtimeparameters pr_gmtparameters ( const prexplodedtime *gmt); parameter gmt a pointer to the clock/calendar time whose offsets are to be determined.
... returns a time parameters structure that expresses the time zone offsets at the specified time.
... this is a trivial function; for any input, it returns a prtimeparameters structure with both fields set to zero.
PR_MemMap
syntax #include <prio.h> void* pr_memmap( prfilemap *fmap, print64 offset, pruint32 len); parameters the function has the following parameters: fmap a pointer to the file-mapping object representing the file to be memory-mapped.
... offset the starting offset of the section of file to be mapped.
... the offset must be aligned to whole pages.
...the section of the file starts at offset and has the length len.
PR_NewThreadPrivateIndex
you use this index with pr_setthreadprivate and pr_getthreadprivate.
...until the data for an index is actually set, the value of the private data at that index is null.
... you pass this index to pr_setthreadprivate and pr_getthreadprivate to set and retrieve data associated with the index.
...if a destructor function is registered with a new index, it will be called at one of two times, as long as the private data is not null: when replacement private data is set with pr_setthreadprivate when a thread exits the index maintains independent data values for each binding thread.
PR_dtoa
decpt a pointer to a memory location where the runtime will store the offset, relative to the beginning of the output string, of the conversion's decimal point.
... *rve if not null this location is set to the address of the end of the result.
...if rve is not null, *rve is set to point to the end of the returned value.
... if the input parameter d is+infinity,-infinity ornan, *decpt is set to 9999.
NSS FAQ
MozillaProjectsNSSFAQ
general questions what is network security services (nss) nss is set of libraries, apis, utilities, and documentation designed to support cross-platform development of security-enabled client and server applications.
... the integration effort depends on an number of factors, such as developer skill set, application complexity, and the level of security required for your application.
... nss includes detailed documentation of the ssl api and sample code that demonstrates basic ssl functionality (setting up an encrypted session, server authentication, and client authentication) to help jump start the integration process.
...exports (including those (a) on the bureau of industry and security denied parties list or entity list, (b) on the office of foreign assets control list of specially designated nationals and blocked persons, and (c) involved with missile technology or nuclear, chemical or biological weapons).
NSS 3.12.4 release notes
d from ascii string bug 405297: problems building nss/lib/ckfw/capi/ with mingw gcc bug 420991: libpkix returns wrong nss error code bug 427135: add super-h (sh3,4) architecture support bug 431958: improve des and sha512 for x86_64 platform bug 433791: win16 support should be deleted from nss bug 449332: secu_parsecommandline does not validate its inputs bug 453735: when using cert9 (sqlite3) db, set or change master password fails bug 463544: warning: passing enum* for an int* argument in pkix_validate.c bug 469588: coverity errors reported for softoken bug 470055: pkix_httpcertstore_findsocketconnection reuses closed socket bug 470070: multiple object leaks reported by tinderbox bug 470479: io timeout during cert fetching makes libpkix abort validation.
...bug 485745: modify fipstest.c to support cavs 7.1 drbg testing bug 486304: cert7.db/cert8.db corruption when importing a large certificate (>64k) bug 486405: allocator mismatches in pk12util.c bug 486537: disable execstack in freebl x86_64 builds on linux bug 486698: facilitate the building of major components independently and in a chain manner by downstream distributions bug 486999: calling ssl_setsockpeerid a second time leaks the previous value bug 487007: make lib/jar conform to nss coding style bug 487162: ckfw/capi build failure on windows bug 487239: nssutil.rc doesn't compile on wince bug 487254: sftkmod.c uses posix file io functions on wince bug 487255: sdb.c uses posix file io functions on wince bug 487487: cert_nametoascii reports !invalid ava!
...mize for msvc++ bug 490154: cryptokey framework requires module to implement generatekey when they support keypairgeneration bug 491044: remove support for vms (a.k.a., openvms) from nss bug 491174: cert_pkixverifycert reports wrong error code when ee cert is expired bug 491919: cert.h doesn't have valid functions prototypes bug 492131: a failure to import a cert from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdown bug 493135: bltest crashes if it can't open the input file bug 493364: can't build with --disable-dbm option when not cross-compiling bug 493693: sse2 instructions for bignum are not implemented on os/2 bug 493912: sqlite3_reset should be invoked in sdb_findobjectsinit when error occurs bug 494073: update rsa/dsa powerupself tests to b...
...e compliant for 2011 bug 494087: passing null as the value of cert_pi_trustanchors causes a crash in cert_pkixsetparam bug 494107: during nss_nodb_init(), softoken tries but fails to load libsqlite3.so crash [@ @0x0 ] bug 495097: sdb_mapsqlerror returns signed int bug 495103: nss_initreadwrite(sql:<dbdir>) causes nss to look for sql:<dbdir>/libnssckbi.so bug 495365: add const to the 'nickname' parameter of sec_certnicknameconflict bug 495656: nss_initreadwrite(sql:<configdir>) leaves behind a pkcs11.txu file if libnssckbi.so is in <configdir>.
NSS 3.16 release notes
(this requires nspr 4.10.4.) to build for the linux x32 target, set the environment variable use_x32=1 when building nss.
...it is no longer necessary to set the environment variable nss_enable_ecc=1 when building nss.
... to disable ecc, set the environment variable nss_disable_ecc=1 when building nss.
... bug 956082: if the nss_sdb_use_cache environment variable is set, skip the runtime test sdb_measureaccess.
NSS 3.27.2 Release Notes
this is a patch release to address a memory leak in the ssl_settrustanchors() function.
... notable changes in nss 3.27.2 the ssl_settrustanchors() function is used to set the distinguished names that an nss server includes in its tls certificaterequest message.
... previous versions of nss leaked the memory used to store distinguished names when ssl_settrustanchors() was used.
... bugs fixed in nss 3.27.2 the following bug has been fixed in nss 3.27.2: bug 1318561 - ssl_settrustanchors leaks compatibility nss 3.27.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.31 release notes
in pkcs11uri.h pk11uri_createuri - create a new pk11uri object from a set of attributes.
... notable changes in nss 3.31 the apis that set a tls version range have been changed to trim the requested range to the overlap with a systemwide crypto policy, if configured.
... previously, ssl_versionrangeset and ssl_versionrangesetdefault returned a failure if the requested version range wasn't fully allowed by the systemwide crypto policy.
...this is used only when seed_only_dev_urandom is set at compile time.
NSS 3.46 release notes
bugs fixed in nss 3.46 bug 1572164 - don't unnecessarily free session in nsc_wrapkey bug 1574220 - improve controls after errors in tstcln, selfserv and vfyserv cmds bug 1550636 - upgrade sqlite in nss to a 2019 version bug 1572593 - reset advertised extensions in ssl_constructextensions bug 1415118 - nss build with ./build.sh --enable-libpkix fails bug 1539788 - add length checks for cryptographic primitives (cve-2019-17006) bug 1542077 - mp_set_ulong and mp_set_int should return errors on bad values bug 1572791 - read out-of-bounds in der_decodetimechoice_util from sslexp_delegatecredential bug 1560593 - cleanup.sh script do...
...es not set error exit code for tests that "failed with core" bug 1566601 - add wycheproof test vectors for aes-kw bug 1571316 - curve25519_32.c:280: undefined reference to `pr_assert' when building nss 3.45 on armhf-linux bug 1516593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-uninitialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 - output paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki when possible for delegated credentials bug 1493916 - fix ppc64 inline assembler for clang bug 1561588 - remove -wmaybe-uninitialized...
...hangs on windows x64 when building nss since changeset 9162c654d06915f0f15948fbf67d4103a229226f bug 1564875 - improve rebuilding with build.sh bug 1565243 - support tc_owner without email address in nss taskgraph bug 1563778 - increase maxruntime on mac taskcluster tools, ssl tests bug 1561591 - remove -wmaybe-uninitialized warning in tstclnt.c bug 1561587 - remove -wmaybe-uninitialized warning in lgattr.c bug 1561558 - remove -wmaybe-uninitialized warning...
... in httpserv.c bug 1561556 - remove -wmaybe-uninitialized warning in tls13esni.c bug 1561332 - ec.c:28 warning: comparison of integers of different signs: 'int' and 'unsigned long' bug 1564714 - print certutil commands during setup bug 1565013 - hacl image builder times out while fetching gpg key bug 1563786 - update hacl-star docker image to pull specific commit bug 1559012 - improve gcm perfomance using pmull2 bug 1528666 - correct resumption validation checks bug 1568803 - more tests for client certificate authentication bug 1564284 - support profile mobility across windows and linux bug 1573942 - gtest for pkcs11.txt with different breaking line formats bug 1575968 - add strsclnt option to enforce the use of either ipv4 or ipv6 bug 1549847 - fix nss builds on ios bug 1485533 ...
NSS Sample Code Sample1
as an alternative, new keys may be sent to the // current set of secondary hosts when they are generated by the // primary.
... // // server - an instance of a server that is part of a // cluster of servers that are sharing a common set // of encryption and macing keys.
... if (rv == 0 && prvkey) goto done; rv = 0; // these could be parameters to the init function rsaparams.keysizeinbits = 1024; rsaparams.pe = 65537; slot = pk11_getinternalkeyslot(); if (!slot) { rv = 1; goto done; } prvkey = pk11_generatekeypair(slot, ckm_rsa_pkcs_key_pair_gen, &rsaparams, &pubkey, pr_true, pr_true, 0); if (!prvkey) { rv = 1; goto done; } // set the nickname on the private key so that it // can be found later.
... s = pk11_setprivatekeynickname(prvkey, mservername); if (s != secsuccess) { rv = 1; goto done; } done: if (slot) pk11_freeslot(slot); if (pubkey) seckey_destroypublickey(pubkey); if (prvkey) seckey_destroyprivatekey(prvkey); return rv; } int server::generatekeys() { int rv = 0; seckeypublickey *pubkey = 0; pk11slotinfo *slot = 0; // choose a slot to use slot = pk11_getinternalkeyslot(); if (!slot) { rv = 1; goto done; } // get our own public key to use for wrapping rv = getpublickey(&pubkey); if (rv) goto done; // do the encryption (aes) key if (!mwrappedenckey) { pk11symkey *key = 0; // the key size is 128 bits (16 bytes) key = pk11_keygen(slot, ckm_aes_key_gen, 0, 128/8, 0); if (!key) { rv = 1; goto aes_done; } rv = wrapkey(ke...
NSPR functions
call pr_seterror to set the error code, which can be retrieved with pr_geterror later.
... the nss functions port_geterror and port_seterror are simply wrappers of pr_geterror and pr_seterror.
... pr_geterror pr_seterror calendar time nss certificate verification functions take a prtime parameter that specifies the time instant at which the validity of the certificate should verified.
... pr_read pr_write pr_recv pr_send pr_getsocketoption pr_setsocketoption pr_shutdown pr_close ...
sslerr.html
ssl_error_bad_mac_read -12273 "ssl received a record with an incorrect message authentication code." this usually indicates that the client and server have failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity.
...this usually indicates that the client and server have failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity.
...are listed in other blocks.) ssl_error_handshake_unexpected_alert -12229 "ssl peer was not expecting a handshake message it received." ssl_error_decompression_failure_alert -12228 "ssl peer was unable to successfully decompress an ssl record it received." ssl_error_handshake_failure_alert -12227 "ssl peer was unable to negotiate an acceptable set of security parameters." ssl_error_illegal_parameter_alert -12226 "ssl peer rejected a handshake message for unacceptable content." ssl_error_unsupported_cert_alert -12225 "ssl peer does not support certificates of the type it received." ssl_error_certificate_unknown_alert -12224 "ssl peer had some unspecified issue with the certificate it received." ...
...authorized." sec_error_ocsp_unknown_response_status -8067 "the ocsp server returned an unrecognizable status." sec_error_ocsp_unknown_cert -8066 "the ocsp server has no status for the certificate." sec_error_ocsp_not_enabled -8065 "you must enable ocsp before performing this operation." sec_error_ocsp_no_default_responder -8064 "you must set the ocsp default responder before performing this operation." sec_error_ocsp_malformed_response -8063 "the response from the ocsp server was corrupted or improperly formed." sec_error_ocsp_unauthorized_response -8062 "the signer of the ocsp response is not authorized to give status for this certificate." sec_error_ocsp_future_response -8061 "the ocsp r...
SSL functions
function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mxr 3.2 and later nssssl_versioncheck mxr 3.2.1 and later ssl_authcertificate mxr 3.2 and later ssl_authcertificatehook mxr 3.2 and later ssl_badcerthook mxr 3.2 and later ssl_certdbhandleset mxr 3.
...2 and later ssl_canbypass mxr 3.11.7 and later ssl_cipherpolicyget mxr 3.2 and later ssl_cipherpolicyset mxr 3.2 and later ssl_cipherprefget mxr 3.2 and later ssl_cipherprefgetdefault mxr 3.2 and later ssl_cipherprefset mxr 3.2 and later ssl_cipherprefsetdefault mxr 3.2 and later ssl_clearsessioncache mxr 3.2 and later ssl_configmpserversidcache mxr 3.2 and later ssl_configsecureserver mxr 3.2 and later ssl_configserversessionidcache mxr 3.2 and later ssl_datapending mxr 3.2 and later ssl_forcehandshake mxr 3.2 and later ssl_forcehandshakewithtimeout mxr 3.11.4 and later ssl_ge...
...nd later ssl_handshakecallback mxr 3.2 and later ssl_importfd mxr 3.2 and later ssl_inheritmpserversidcache mxr 3.2 and later ssl_invalidatesession mxr 3.2 and later ssl_localcertificate mxr 3.4 and later ssl_optionget mxr 3.2 and later ssl_optiongetdefault mxr 3.2 and later ssl_optionset mxr 3.2 and later ssl_optionsetdefault mxr 3.2 and later ssl_peercertificate mxr 3.2 and later ssl_preencryptedfiletostream mxr 3.2 and later ssl_preencryptedstreamtofile mxr 3.2 and later ssl_rehandshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake m...
...xr 3.2 and later ssl_restarthandshakeaftercertreq mxr 3.2 and later ssl_restarthandshakeafterservercert mxr 3.2 and later ssl_revealcert mxr 3.2 and later ssl_revealpinarg mxr 3.2 and later ssl_revealurl mxr 3.2 and later ssl_securitystatus mxr 3.2 and later ssl_setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg mxr 3.2 and later ssl_setsockpeerid mxr 3.2 and later ssl_seturl mxr 3.2 and later ssl_shutdownserversessionidcache mxr 3.7.4 and later ...
Utility functions
3.2 and later port_arenazalloc mxr 3.2 and later port_free mxr 3.2 and later port_freearena mxr 3.2 and later port_geterror mxr 3.2 and later port_newarena mxr 3.2 and later port_realloc mxr 3.2 and later port_seterror mxr 3.2 and later port_setucs2_asciiconversionfunction mxr 3.2 and later port_setucs2_utf8conversionfunction mxr 3.2 and later port_setucs4_utf8conversionfunction mxr 3.2 and later port_strdup mxr 3.5 and later port_ucs2_asciiconversion mxr 3...
... 3.2 and later sec_asn1decodeitem mxr 3.2 and later sec_asn1decoderabort mxr 3.9 and later sec_asn1decoderclearfilterproc mxr 3.2 and later sec_asn1decoderclearnotifyproc mxr 3.2 and later sec_asn1decoderfinish mxr 3.2 and later sec_asn1decodersetfilterproc mxr 3.2 and later sec_asn1decodersetnotifyproc mxr 3.2 and later sec_asn1decoderstart mxr 3.2 and later sec_asn1decoderupdate mxr 3.2 and later sec_asn1encode mxr 3.2 and later sec_asn1encodeinteger mxr 3.2 and later sec_...
...er sec_asn1encoderabort mxr 3.9 and later sec_asn1encoderclearnotifyproc mxr 3.2 and later sec_asn1encoderclearstreaming mxr 3.2 and later sec_asn1encodercleartakefrombuf mxr 3.2 and later sec_asn1encoderfinish mxr 3.2 and later sec_asn1encodersetnotifyproc mxr 3.2 and later sec_asn1encodersetstreaming mxr 3.2 and later sec_asn1encodersettakefrombuf mxr 3.2 and later sec_asn1encoderstart mxr 3.2 and later sec_asn1encoderupdate mxr 3.2 and later sec_asn1encodeunsignedinteger mxr 3.11.1 and l...
...algorithmid mxr 3.2 and later secoid_findoid mxr 3.2 and later secoid_findoidbytag mxr 3.2 and later secoid_findoidtag mxr 3.2 and later secoid_findoidtagdescription mxr 3.2 and later secoid_getalgorithmtag mxr 3.2 and later secoid_setalgorithmid mxr 3.2 and later sgn_begin mxr 3.2 and later sgn_comparedigestinfo mxr 3.2 and later sgn_copydigestinfo mxr 3.2 and later sgn_createdigestinfo mxr 3.2 and later sgn_destroycontext mxr 3.2 and later sgn_destroydigestinfo...
NSS tools : signver
MozillaProjectsNSStoolssignver
-a sets that the given signature file is in ascii format.
... in 2009, nss introduced a new set of databases that are sqlite databases rather than berkleydb.
...for example: # signver -a -s signature -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
... o setting up the shared nss database https://wiki.mozilla.org/nss_shared_db_howto o engineering and technical information about the shared nss database https://wiki.mozilla.org/nss_shared_db additional resources for information about nss and other tools related to nss (like jss), check out the nss project wiki at [1]http://www.mozilla.org/projects/security/pki/nss/.
Tutorial: Embedding Rhino
(note that because the java -jar option preempts the rest of the classpath, we can't use that and access the counter class.) $ java -cp "js.jar;examples" org.mozilla.javascript.tools.shell.main js> defineclass("counter") js> c = new counter(7) [object counter] js> c.count 7 js> c.count 8 js> c.count 9 js> c.resetcount() js> c.count 0 counter's constructors the zero-argument constructor is used by rhino runtime to create instances.
... public string getclassname() { return "counter"; } dynamic properties dynamic properties are defined by methods beginning with jsget_ or jsset_.
...here we define resetcount for javascript.
... public void jsfunction_resetcount() { count = 0; } the call c.resetcount() above calls this method.
GCIntegration - SpiderMonkey Redirect 1
never store gc things in a jsobject's private pointer (i.e., via js_setprivate()).
...the goal is to keep a list, called the remembered set, of all pointers from the tenured generation into the nursery.
...if so, the pointer is added to the remembered set.
... the remembered set allows us to collect the nursery without needing to look at the tenured generation at all, aside from the remembered set entries.
Functions
when the function object is created, its parent is set to the first object on the scope chain.
...if a name definitely refers to an argument or local variable of the immediately enclosing function, it can be accessed using jsop_{get,set,call}{arg,local} instructions.
...outside all functions, if a name definitely refers to a global for which we have seen a var, const, or function declaration, then we emit a js_defvar instruction in the script prelude and access the global using jsop_{get,set,call}gvar.
...in the worst case we emit jsop_{,set,call}name.
Garbage collection
the engine can also gc a set of compartments without gcing the rest.
...the pauses can be set to be 10ms or less.
...js::nativeobject::privatewritebarrierpre takes care of this by invoking the jsobject's class trace hook before the private field is set.
...in spidermonkey, an object is black if its black mark bit is set.
JS::CallArgs
mutablehandlevalue rval() const returns the currently-set return value.
...(if you're compiling against a debug build of spidermonkey, these methods will assert to aid debugging.) if the method you're implementing succeeds by returning true, you *must* set this.
... if (args.length() == 0 || !args[0].isnumber()) { args.rval().setint32(0); return true; } // access to the callee must occur before accessing/setting // the return value.
... handlevalue thisv = rec.thisv(); args.rval().set(js::numbervalue(args.length() * args[0].tonumber())); // callee() and calleev() will now assert.
JSNewEnumerateOp
the properties each op adds to the properties vector are added to the set of values the for-in loop will iterate over.
... to use a jsnewenumerateop in a jsclass, set the jsclass_new_enumerate bit in the jsclass.flags field and set the jsclass.enumerate field to your jsnewenumerateop, casting it to jsenumerateop.
...if idp is non-null and the number of enumerable properties can't be computed in advance, *idp should be set to jsval_zero.
...the opaque iterator state pointed at by statep is destroyed and *statep is set to jsval_null if there are no properties left to enumerate.
JS_GetContextPrivate
syntax void * js_getcontextprivate(jscontext *cx); void js_setcontextprivate(jscontext *cx, void *data); void * js_getsecondcontextprivate(jscontext *cx); // added in spidermonkey 17 void js_setsecondcontextprivate(jscontext *cx, void *data); // added in spidermonkey 17 name type description cx jscontext * any context.
... data void * (in js_setcontextprivate or js_setsecondcontextprivate) pointer to application-defined data to be associated with the context cx.
...js_getcontextprivate and js_getsecondcontextprivate get this field and js_setcontextprivate and js_setsecondcontextprivate set it.
...see also mxr id search for js_getcontextprivate mxr id search for js_setcontextprivate mxr id search for js_getsecondcontextprivate mxr id search for js_setsecondcontextprivate js_getruntimeprivate js_setruntimeprivate js_getcompartmentprivate js_setcompartmentprivate js_getprivate js_setprivate js_getinstanceprivate bug 714458 ...
JS_GetLocaleCallbacks
get and set locale specific string conversion and error message callbacks.
... syntax jslocalecallbacks * js_getlocalecallbacks(jsruntime *rt); void js_setlocalecallbacks(jsruntime *rt, jslocalecallbacks *callbacks); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... description js_setlocalecallbacks establishes locale callbacks.
...see also mxr id search for js_getlocalecallbacks mxr id search for js_setlocalecallbacks mxr id search for jslocalecallbacks mxr id search for jslocaletouppercase mxr id search for jslocaletolowercase mxr id search for jslocalecompare mxr id search for jslocaletounicode ...
JS_GetProperty
if the lookup proceeds without error, exactly one of the following cases applies: if the property is not found, then *vp is set to undefined.
...otherwise *vp is set to the property's stored value, or undefined if the property does not have a stored value, and then the property's getter is called with the arguments (cx, obj, id, vp).
... on success, these functions set *vp to the current value of the property, or undefined if obj has no such property, and return true.
... see also mxr id search for js_getproperty mxr id search for js_getucproperty mxr id search for js_getpropertybyid example in the jsapi phrasebook js_defineproperty js_definepropertywithtinyid js_deleteproperty js_deleteproperty2 js_lookupproperty js_propertystub js_setproperty bug 461163 ...
JS_GetReservedSlot
syntax // added in spidermonkey 42 js::value js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, js::value v); // obsolete since spidermonkey 42 jsval js_getreservedslot(jsobject *obj, uint32_t index); void js_setreservedslot(jsobject *obj, uint32_t index, jsval v); name type description obj jsobject * an object that has reserved slots.
... v js::value (in js_setreservedslot) the value to store.
...they cannot be returned from functions, set as properties on objects, embedded in javascript arrays, and so on.) new objects' reserved slots are initialized to undefined.
... see also mxr id search for js_getreservedslot mxr id search for js_setreservedslot bug 1184564 -- changed jsval to js::value ...
JS_GetRuntimePrivate
syntax void * js_getruntimeprivate(jsruntime *rt); void js_setruntimeprivate(jsruntime *rt, void *data); name type description rt jsruntime * any js runtime.
... data void * (in js_setruntimeprivate) pointer to application-defined data to be associated with the runtime rt.
...js_getruntimeprivate gets the value of this field and js_setruntimeprivate sets it.
...see also mxr id search for js_getruntimeprivate js_getcontextprivate js_setcontextprivate js_getsecondcontextprivate js_setsecondcontextprivate js_getcompartmentprivate js_setcompartmentprivate js_getprivate js_setprivate js_getinstanceprivate ...
JS_ToggleOptions
options uint32 the set of options to toggle.
... this is the logical or of zero or more flags described at js_setoptions.
...it is equivalent to js_setoptions(cx, js_getoptions(cx) ^ options).
... see also mxr id search for js_toggleoptions js_setoptions js_getoptions bug 880330 ...
SpiderMonkey 45
js_setcurrentembeddertimefunction (bug 1159507) js_getcurrentembeddertime (bug 1159507) js_mayresolvestandardclass (bug 1155946) js_getiteratorprototype (bug 1225392) js_globallexicalscope (bug 1202902) js_hasextensiblelexicalscope (bug 1202902) js_extensiblelexicalscope (bug 1202902) js_initreflectparse (bug 987514) js::toprimitive (bug 1206168) js::getfirstargumentastypehint (bug 1054756) js...
...::objecttocompletepropertydescriptor (bug 1144366) js_setimmutableprototype (bug 1211607) js_getownucpropertydescriptor (bug 1211607) js_hasownpropertybyid (bug 1211607) js_hasownproperty (bug 1211607) js_deleteucproperty (bug 1211607) js::newfunctionfromspec (bug 1054756) js::compilefornonsyntacticscope (bug 1165486) js_checkforinterrupt (bug 1058695) js::mapdelete (bug 1159469) js::mapforeach (bug 1159469) js::newsetobject (bug 1159469) js::setsize (bug 1159469) js::sethas (bug 1159469) js::setdelete (bug 1159469) js::setadd (bug 1159469) js::setclear (bug 1159469) js::setkeys (bug 1159469) js::setvalues (bug 1159469) js::setentries (bug 1159469) js::setforeach (bug 1159469) js::exceptionstackornull (bug 814497) js::copyasyncstack (bug 1160307) js::getsavedframesource...
... (bug 1216819) js::getsavedframeline (bug 1216819) js::getsavedframecolumn (bug 1216819) js::getsavedframefunctiondisplayname (bug 1216819) js::getsavedframeasynccause (bug 1216819) js::getsavedframeasyncparent (bug 1216819) js::getsavedframeparent (bug 1216819) js::buildstackstring (bug 1133191) js::flushperformancemonitoring (bug 1181175) js::resetperformancemonitoring (bug 1181175) js::disposeperformancemonitoring (bug 1208747) js::setstopwatchismonitoringcpow (bug 1156264) js::getstopwatchismonitoringcpow (bug 1156264) js::setstopwatchismonitoringjank (bug 1156264) js::getstopwatchismonitoringjank (bug 1156264) js::isstopwatchactive (bug 674779) js::getperfmonitoringtestcpurescheduling (bug 1181175) js::addcpowperformancedelta (bug 1181175) js::setstopwatchstartcallback ...
...(bug 1208747) js::setstopwatchcommitcallback (bug 1208747) js::setgetperformancegroupscallback (bug 1208747) js_stringhasbeeninterned renamed to js_stringhasbeenpinned (bug 1178581) js_internjsstring renamed to js_atomizeandpinjsstring (bug 1178581) js_internstringn renamed to js_atomizeandpinstringn (bug 1178581) js_internstring renamed to js_atomizeandpinstring (bug 1178581) js_internucstringn renamed to js_atomizeandpinucstringn (bug 1178581) js_internucstring renamed to js_atomizeandpinucstring (bug 1178581) deleted apis js_getcompartmentstats js_seticumemoryfunctions js_isgcmarkingtracer js_ismarkinggray js_idarraylength js_idarrayget js_destroyidarray js_defaultvalue js_getparent js_setparent js::parsepropertydescriptorobject js_deleteproperty2 js_deleteproperty...
Thread Sanitizer
is flag causes clang to automatically link the tsan runtime :) export ldflags="-fsanitize=thread -fpic -pie" # these three are required by tsan ac_add_options --disable-jemalloc ac_add_options --disable-crashreporter ac_add_options --disable-elf-hack # keep symbols to symbolize tsan traces export moz_debug_symbols=1 ac_add_options --enable-debug-symbols ac_add_options --disable-install-strip # settings for an opt build ac_add_options --enable-optimize="-o2 -gline-tables-only" ac_add_options --disable-debug starting the build process now you start the build process using the regular make -f client.mk command.
...before using it, you must of course adjust the path name for llvm_root to match your setup.
...to use it, either make sure the llvm-symbolizer binary is in your path or set the environment variable tsan_options="external_symbolizer_path=/path/to/llvm-symbolizer" before running the process.
... if you've built tsan as described above, then you will want to set the variable to $llvm_home/build/bin/llvm-symbolizer.
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.
... we believe that both sets of concerns are valid, and that both are worth addressing as best we can.
...however, this is offset by the fact that the person reporting a bug has visibility into the activities (if any) being taken to address the bug, and has the power to open the bug report for public scrutiny.
... changing this policy this policy is not set in stone.
Querying Places
the defaults for these objects will result in a query that returns all of your browser history in a flat list: chromeutils.definemodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); // no query options set will get all history, sorted in database order, // which is nsinavhistoryqueryoptions.sort_by_none.
... the contents of bookmark folders can be retrieved by setting the "folders" member in the query object.
...you can set multiple folders and the result will be the intersection of all the folders.
... // |query| and |options| are objects created in the previous section query.setparents([placesutils.bookmarks.toolbarguid], 1); let result = placesutils.history.executequery(query, options); serializing queries query and options objects can be serialized into a string starting with "place:" using queriestoquerystring.
Using the Places keywords API
using the keywords api the keywords api is a promise-based api available through the placesutils module: components.utils.import("resource://gre/modules/xpcomutils.jsm"); xpcomutils.definelazymodulegetter(this, "placesutils", "resource://gre/modules/placesutils.jsm"); setting a keyword for an url the insert() method accepts a keyword entry object describing the keyword to insert.
... it has the following properties: keyword: string representing the keyword url: either a url or spec represeting the url to associate to postdata: optional post data string.
... placesutils.keywords.insert({ keyword: "my_keyword", url: "http://www.example.com/" postdata: "post+data=1&test=2" }).then(() => { /* success */ }, e => { /* failure */ }); note that setting an already existing keyword to a different url, will silently update the existing keyword to the new url.
... fetching an entry by keyword the fetch() method acceps a keyword string (or an object having a keywords property) and might resolve to a keyword entry with the following properties: keyword: string representing the keyword url: the url represeted by the keyword postdata: optional post data string.
Using the Places livemark service
nsilivemarkservice.setsiteuri() sets the uri of the website associated with a livemark container.
... livemarkservice.setsiteuri(newlvmkid, uri("http://newuri.com/"); //newlvmkid = see "create a new livemark" for more detail.
... nsilivemarkservice.setfeeduri() sets the uri of feed associated with a livemark container.
... livemarkservice.setfeeduri(newlvmkid, uri("http://foo.example.com/rss.xml")); //newlvmkid = see "create a new livemark" for more detail.
Using the Places tagging service
initiating the tagging service before using the tagging service, you need to obtain a reference to an instance of it: var taggingsvc = components.classes["@mozilla.org/browser/tagging-service;1"] .getservice(components.interfaces.nsitaggingservice); tagging a uri the nsitaggingservice.taguri() method tags a url with the given set of tags.
... current tags set for the url persist, and tags which are already set for the given url are ignored.
...from the given set of tags, a tag is ignored if it isn't set for the given url.
... var tag1uris = taggingsvc.geturisfortag("tag 1"); //"tag 1" = given tag getting all tags associated with a url the nsitaggingservice.gettagsforuri() method returns an array of all tags set for the given url.
Accessing the Windows Registry Using XPCOM
you can read the interface documentation for a full explanation, but we will show only the three most commonly used modes here: access_read — for reading values, enumerating keys, and receiving notifications access_write — for setting values and creating sub keys access_all — access for all operations in addition to open() and create(), there are the openchild() and createchild() methods.
...calling haschanged() automatically resets the watch, so you can be sure that if it returns true there are changes.
...it consists of only one method, getregistryentry(), and a set of named constants to specify the root key.
... you can use it as shown in the following example: var wss = components.classes["@mozilla.org/browser/shell-service;1"] .getservice(components.interfaces.nsiwindowsshellservice); var id = wss.getregistryentry(wss.hklm, "software\\microsoft\\windows\\currentversion", "productid"); note: there's no way to set a registry value using this interface.
Using XPCOM Components
cookie manager cookie management is one of the many sets of functionality that is made available to the browser in the form of an xpcom component and that can be reused by developers who want similar functionality in their applications.
... in addition to the cookiemanager component, for example, the webbrowserfind component is another part of a large set of web browsing interfaces you can use.
... xpcom component viewer the left column shows the components - in this case a subset returned from a search on "gfx" as part of the contract id and the right column a list of the interfaces.
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
How to build a binary XPCOM component using Visual Studio
development setup the simplest way to get an xpcom component built is to use the gecko sdk.
.....\gecko-sdk\include" to additional include directories add "..\gecko-sdk\lib" to additional library directories add "nspr4.lib xpcom.lib xpcomglue_s.lib" to additional dependencies add "xp_win;xp_win32″ to preprocessor definitions turn off precompiled headers (just to keep it simple) use a custom build step for the xpcom idl file (spawns xpidl-build.bat to process the idl with mozilla toolset, not midl) vc++ express project: xpcom-test.zip note: the project uses xpcom_glue.
...de "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 module implementation.
...ound on the mdc site: #include "nsigenericfactory.h" #include "comp-impl.h" ns_generic_factory_constructor(cspecialthing) static nsmodulecomponentinfo components[] = { { specialthing_classname, specialthing_cid, specialthing_contractid, cspecialthingconstructor, } }; ns_impl_nsgetmodule("specialthingsmodule", components) assuming you have the right sdk and setup the include and lib folders correctly, the project should build your xpcom component.
Components.Constructor
for example: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1"); var bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsisupports]" try { // someinputstream is an existing nsiinputstream // throws because bis hasn't been qi'd to nsibinaryinputstream bis.setinputstream(someinputstream); } catch (e) { bis.queryinterface(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // succeeds now } if two arguments are given, the created instance will be nsisupports.queryinterface()'d to the xpcom interface whose name is the second argument: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1", ...
... "nsibinaryinputstream"); var bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsibinaryinputstream]" // someinputstream is an existing nsiinputstream bis.setinputstream(someinputstream); // succeeds if three arguments are given, then in addition to being nsisupports.queryinterface()'d, the instance will also have had an initialization method called on it.
... the arguments used with the initialization method are the arguments passed to the components.constructor()-created function when called: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1", "nsibinaryinputstream", "setinputstream"); try { // throws, because number of arguments isn't equal to the number of // arguments nsibinaryinputstream.setinputstream takes var bis = new binaryinputstream(); } catch (e) { // someinputstream is an existing nsiinputstream bis = new binaryinputstream(someinputstream); // succeeds var bytes = bis.readbytearray(somenumberofbytes); // succeeds } compare instance creation from base principles with instance creation using compo...
...nents.constructor(); the latter is much easier to read than the former (particularly if you're creating instances of a component in many different places): var bis = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // assumes binaryinputstream was initialized previously var bis = new binaryinputstream(someinputstream); components.constructor() is purely syntactic sugar (albeit speedy and pretty syntactic sugar) for actions that can be accomplished using other common methods.
XPCShell Reference
(setting this option disables the "interactive" mode) -f this option specifies a script file to execute.
... -v version this allows you to specify a specific version of js to use, and should be set to an integral value specified by the jsversion enumerated type.
... for instance, specifying -v 180 will set the interpreter to use javascript version 1.8.
...if you pass a number to it, it will set the version number (and return the old version number).
IAccessibleValue
method overview [propget] hresult currentvalue([out] variant currentvalue ); [propget] hresult maximumvalue([out] variant maximumvalue ); [propget] hresult minimumvalue([out] variant minimumvalue ); hresult setcurrentvalue([in] variant value ); methods currentvalue() returns the value of this object as a number.
...setcurrentvalue() sets the value of this object to the given number.
...hresult setcurrentvalue( [in] variant value ); parameters value the new value represented by this object.
... the set of admissible types for this argument is implementation dependent.
mozIStorageStatementWrapper
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void initialize(in mozistoragestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type description statement mozistoragestatement the statement that is wrapped.
... params mozistoragestatementparams the parameters; these can be set in lieu of using the call notation on this.
... reset() this method resets the wrapped statement.
... void reset(); parameters none.
nsIAbCard
inherits from: nsisupports method overview astring getcardvalue(in string name) void setcardvalue(in string attrname, in astring value) void copy(in nsiabcard srccard) boolean equals(in nsiabcard card) string converttobase64encodedxml() astring converttoxmlprintdata() string converttoescapedvcard() astring generatename(in long agenerateformat,[optional] in nsistringbundle abundle) astring generatephoneticname(in boolean a...
... setcardvalue() void setcardvalue(in string attrname, in astring value) parameters attrname the attribute you want to set.
... value the value to set the attribute to.
... astring generatephoneticname(in boolean alastnamefirst) parameters alastnamefirst set to true to put the last name before the first.
nsIAccessibleHyperLink
endindex long the end offset of the hyperlink accessible within the parent accessible.
... note: aria links can only be focused if they have the tabindex attribute set.
... also, state_focused should then be set on the accessible for this link.
... startindex long the offset of the hyperlink accessible within the parent accessible.
nsIClipboard
widget/nsiclipboard.idlscriptable this interface supports basic clipboard operations such as: setting, retrieving, emptying, matching and supporting clipboard data.
...7) method overview void emptyclipboard(in long awhichclipboard); void forcedatatoclipboard(in long awhichclipboard); obsolete since gecko 1.8 void getdata(in nsitransferable atransferable, in long awhichclipboard); boolean hasdatamatchingflavors([array, size_is(alength)] in string aflavorlist, in unsigned long alength, in long awhichclipboard); void setdata(in nsitransferable atransferable, in nsiclipboardowner anowner, in long awhichclipboard); boolean supportsselectionclipboard(); boolean supportsfindclipboard(); constants most clipboard operations in firefox use kglobalclipboard, which is the one also used by the typical control-c/control-v keyboard shortcuts.
... setdata() this method sets the data from a transferable on the native clipboard.
... void setdata( in nsitransferable atransferable, in nsiclipboardowner anowner, in long awhichclipboard ); parameters atransferable the transferable containing the data to put on the clipboard.
nsIClipboardDragDropHooks
inherits from: nsisupports last changed in gecko 1.7 embedders who want to have these hooks made available should implement nsiclipboarddragdrophooks and use the command manager to send the appropriate commands with these parameters/settings: command: cmd_clipboarddragdrophook params value type possible values "addhook" isupports nsiclipboarddragdrophooks as nsisupports "removehook" isupports nsiclipboarddragdrophooks as nsisupports note: overrides/hooks need to be added to each window (as appropriate).
...if more than one implementation is set for a window, the hooks will be called in the order they are added.
...if there are multiple hooks set for a window, any of them has an opportunity to cancel the action so no further processing will occur.
... if any errors occur (without setting the boolean result) the default action will occur.
nsIConverterInputStream
to create an instance, use: var converterinputstream = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); method overview void init(in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar); constants constant value description default_replacement_character 0xfffd default replacement character value.
...void init( in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar ); parameters astream the source stream which is read and converted.
... acharset the character encoding to use for converting the bytes of the stream.
...this is currently set to 8192 bytes.
nsIConverterOutputStream
to create an instance, use: var converteroutputstream = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); method overview void init(in nsioutputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter); methods init() initialize this stream.
...void init( in nsioutputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter ); parameters aoutstream the underlying output stream to which the converted strings will be written.
... acharset the character set to use for encoding the characters.
... a null charset will be interpreted as utf-8.
nsICrashReporter
minidumppath nsilocalfile get or set the path on the local system to which minidumps will be written when a crash happens.
... serverurl nsiurl get or set the url to which crash reports will be submitted.
... exceptions thrown ns_error_failure on get if no url is set.
... ns_error_invalid_arg on set if a non-http(s) url is assigned.
nsICryptoHMAC
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring finish(in prbool aascii); void init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms.
...this call resets the object to its pre-init state.
... reset() reinitialize hmac context to be reused with the same settings (the key and hash algorithm) but on different set of data.
... void reset(); parameters none.
nsIDOMSerializer
to create an instance, use: var domserializer = components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified.
... void serializetostream( in nsidomnode root, in nsioutputstream stream, in autf8string charset ); parameters root the root of the subtree to be serialized.
...charset the name of the character set to use for the encoding to a byte stream.
... if this string is empty and root is a document, the document's character set will be used.
nsIDOMStorage
a storage object stores an arbitrary set of key-value pairs, which may be retrieved, modified and removed as needed.
...method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store.
... setitem() sets the value corresponding to a given key.
...void setitem( in domstring key, in domstring data ); parameters key the key for which data should be set.
nsIDOMWindowInternal
status domstring sets the text in the status bar at the bottom of the browser or returns the previously set text.
... defaultstatus domstring gets/sets the status bar text for the given window.
... pagexoffset long returns the number of pixels that the document has already been scrolled horizontally.
... pageyoffset long returns the number of pixels that the document has already been scrolled vertically.
nsIDOMXPathResult
the nodes in the result set are in the same order that they appear in the document.
... unordered_node_snapshot_type 6 type is a node-set containing snapshots of all the nodes matching the expression used in the evaluator.
... ordered_node_snapshot_type 7 type is a node-set containing snapshots of all the nodes matching the expression used in the evaluator.
... the nodes in the result set are in the same order that they appear in the document.
nsIDownloadManager
the path is dependent on two user configurable prefs set in preferences: browser.download.folderlist defines the default download location for files: 0: files are downloaded to the desktop by default.
... download_blocked_policy 9 windows specific: request was blocked by zone policy settings.
...if you want to both add and start a download, you need to create an nsiwebbrowserpersist object, call this method, set the progresslistener to the returned nsidownload object, and then call the nsiwebbrowserpersist.saveuri() method.
...should always be set to nsidownloadmanager.download_type_download (that is, zero).
nsIDragSession
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitemindex ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current state of the drag, whether it can be dropped or not.
... usually the target "frame" sets this so the native system can render the correct feedback.
... dragaction unsigned long sets the action (copy, move, link and so on) for the current drag.
... targetsize nssize sets the current width and height of the drag target area.
nsIEditorIMESupport
obsolete since gecko 2.0 void setcompositionstring(in domstring acompositionstring, in nsiprivatetextrangelistptr atextrange, in nstexteventreplyptr areply); native code only!
...void querycomposition( in nstexteventreplyptr areply ); parameters areply native code only!setcompositionstring obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete.
...sets the inline input composition string.
...void setcompositionstring( in domstring acompositionstring, in nsiprivatetextrangelistptr atextrange, in nstexteventreplyptr areply ); parameters acompositionstring atextrange areply ...
nsIEnvironment
getservice(components.interfaces.nsienvironment); method overview void set(in astring aname, in astring avalue); astring get(in astring aname); boolean exists(in astring aname); methods set() set the value of an environment variable.
... void set( in astring aname, in astring avalue ); parameters aname the variable name to set.
... avalue the value to set.
... return value if the variable has been set, the value returned is pr_true.
nsIFilePicker
this should be set before calling open() or show().
...this should be set this before calling open() or show() to specify a starting point.
...set this to choose a particular filter to be selected by default.
... void appendfilters( in long filtermask ); parameters note: if appendfilters is the first (or only) call to set the file filters the filter with the smallest code will be used as default filter when displaying the nsifilepicker dialog.
nsILoginManagerStorage
avingenabled(in astring ahost); void init(); void initwithfile(in nsifile ainputfile, in nsifile aoutputfile); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); attributes attribute type description uibusy boolean true when a master password prompt is being shown.
... setloginsavingenabled() implement this method to enable or disable login saving for the specified host.
...existing logins for the host should not be affected when setting this.
... void setloginsavingenabled( in astring ahost, in boolean isenabled ); parameters ahost the host for which to enable or disable login saving.
nsIMIMEInputStream
to create an instance, use: var mimeinputstream = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); method overview void addheader(in string name, in string value); void setdata(in nsiinputstream stream); attributes attribute type description addcontentlength boolean when true a "content-length" header is automatically added to the stream.
... setdata() sets data-stream.
...void setdata( in nsiinputstream stream ); parameters stream stream containing the data for the stream.
... example var postdata = components.classes["@mozilla.org/network/mime-input-stream;1"] .createinstance(components.interfaces.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); ...
nsIMacDockSupport
this can be done like this: var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); console.log('docksupport:', docksupport); var win = services.wm.getmostrecentwindow('navigator:browser'); var macmenu = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menupopup'); macmenu.setattribute('id', 'mymacmenu'); var macmenuitem = win.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem'); macmenuitem.setattribute('label', 'show most recent window'); macmenuitem.setattribute('id', 'mymacmenuitem'); macmenuitem.addeventlistener('command', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsima...
...cdocksupport); docksupport.activateapplication(true); services.wm.getmostrecentwindow(null).focus() }) macmenu.appendchild(macmenuitem); var mainpopupset = win.document.getelementbyid('mainpopupset'); mainpopupset.appendchild(macmenu); let dockmenuelement = macmenu; //document.getelementbyid("menu_mac_dockmenu");66 let nativemenu = cc["@mozilla.org/widget/standalonenativemenu;1"].createinstance(ci.nsistandalonenativemenu); console.log('dockmenuelement:', dockmenuelement); nativemenu.init(dockmenuelement); docksupport.dockmenu = nativemenu; this replaces the default menu with this one menuitem that says "show most recent window".
...var macmenuitem = services.appshell.hiddendomwindow.document.createelementns('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'menuitem'); macmenuitem.setattribute('label', 'show most recent window'); macmenuitem.setattribute('id', 'mymacmenuitem'); macmenuitem.addeventlistener('command', function(){ var docksupport = cc['@mozilla.org/widget/macdocksupport;1'].getservice(ci.nsimacdocksupport); docksupport.activateapplication(true); services.wm.getmostrecentwindow(null).focus() }) services.appshell.hiddendomwindow.document.getelementbyid('menu...
...two types of elements: menu (if you would like to have sub menu items, make sure to set a label on the "menu" element) menuitem (like in example above) elements can be hidden by adding the hidden attribute to the menu or menuitem and setting it to true .
nsIMsgSearchSession
to create an instance, use: var searchsession = components.classes["@mozilla.org/messenger/searchsession;1"] .createinstance(components.interfaces.nsimsgsearchsession); to use the instance append search terms, set the scope, and then call search().
...escustomheaders(in nsmsgsearchscopevalue scope, in voidptr selection, in boolean forfilters); boolean isstringattribute(in nsmsgsearchattribvalue attrib); void addallscopes(in nsmsgsearchscopevalue attrib); void search(in nsimsgwindow awindow); void interruptsearch(); void pausesearch(); void resumesearch(); [noscript] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); [noscript] void addresultelement(in nsmsgresultelement element); boolean matchhdr(in nsimsgdbhdr amsghdr, in nsimsgdatabase adatabase); void addsearchhit(in nsimsgdbhdr header, in nsimsgfolder folder); attributes attribute type description searchterms nsisupportsarray readonly: ...
..."dogbert" booleanand set to true if associated boolean operator is and.
... void pausesearch(); resumesearch() void resumesearch(); setsearchparam() [noscript] nsmsgsearchtype setsearchparam(in nsmsgsearchtype type, in voidptr param); parameters type param addresultelement() [noscript] void addresultelement(in nsmsgresultelement element); parameters element matchhdr() boolean matchhdr(in nsimsgdbhdr amsghdr, in nsimsgdatabase adatabase); ...
nsINavHistoryObserver
an empty string means the title was specifically set to be nothing.
... null means the title was not set at all.
... from c++ code, use the isvoid() and setisvoid() methods to see whether an empty string is "null" or not; in either case it will always be an empty string.
...normally, transition types of transition_embed (corresponding to images in a page, for example) are not displayed in history results (unless includehidden is set).
nsISocketProvider
constants constant value description proxy_resolves_host 1 << 0 this flag is set if the proxy is to perform hostname resolution instead of the client.
... when set, the hostname parameter passed in this interface will be used instead of the address structure passed for a later request.
... anonymous_connect 1 << 1 when setting this flag, the socket will not apply any credentials when establishing a connection.
... for example, an ssl connection would not send any client-certificates if this flag is set.
nsIThreadPool
method overview void shutdown(); attributes attribute type description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive.
... idlethreadtimeout unsigned long get/set the amount of time in milliseconds that a thread must be idle before it becomes eligible to be destroyed.
... a listener will only receive notifications about threads created after the listener is set so it is recommended that the consumer set the listener before dispatching the first event.
...threads created after the listener is set will also take ownership of the listener so that the listener will be kept alive long enough to receive the guaranteed nsithreadpoollistener.onthreadshuttingdown() notification.
nsITreeColumn
if the cycler attribute is not set, the column cells are regular text cells.
...if the editable attribute is not set, the column cells are not editable.
...if the primary attribute is not set, the column is not the primary column.
...if the selectable attribute is not set, the column cells are not selectable.
nsIUploadChannel
the upload stream may only be set prior to the invocation of asyncopen on the channel.
... inherits from: nsisupports last changed in gecko 1.7 method overview void setuploadstream(in nsiinputstream astream, in acstring acontenttype, in long acontentlength); attributes attribute type description uploadstream nsiinputstream get the stream (to be) uploaded by this channel.
... methods setuploadstream() sets a stream to be uploaded by this channel.
...void setuploadstream( in nsiinputstream astream, in acstring acontenttype, in long acontentlength ); parameters astream the stream to be uploaded by this channel.
nsIWebBrowserChrome2
1.0 66 introduced gecko 1.9 inherits from: nsiwebbrowserchrome last changed in gecko 1.9 (firefox 3) method overview void setstatuswithcontext(in unsigned long statustype, in astring statustext, in nsisupports statuscontext); methods setstatuswithcontext() called when the status text in the chrome needs to be updated.
... this method may be called instead of nsiwebbrowserchrome.setstatus().
... an implementor of this method, should still implement nsiwebbrowserchrome.setstatus().
... void setstatuswithcontext( in unsigned long statustype, in astring statustext, in nsisupports statuscontext ); parameters statustype indicates what is setting the text.
nsIWebBrowserFindInFrames
once the search is done, this will be set to be the last frame searched, whether or not a result was found.
...set this to only search a subtree of the frame hierarchy.
...setting nsiwebbrowserfind.searchframes to true sets this to true.
...setting nsiwebbrowserfind.searchframes to true sets this to true.
nsIWebNavigation
load_flags_charset_change 1024 this flag specifies that a reload was triggered as a result of detecting an incorrect character encoding while parsing a previously loaded document.
... load_flags_stop_content 2048 if this flag is set, stop() will be called before the load starts and will stop both content and network activity (the default is to only stop network activity).
...set with care, since setting incorrectly can cause us to assume that nothing was actually loaded in this object if the load ends up being handled by an external application.
... headers if the uri corresponds to a http request, then any http headers contained in this stream are set on the http request.
nsIWinTaskbar
taskbar;1"] .getservice(components.interfaces.nsiwintaskbar); method overview nsijumplistbuilder createjumplistbuilder(); nsitaskbartabpreview createtaskbartabpreview(in nsidocshell shell, in nsitaskbarpreviewcontroller controller); nsitaskbarprogress gettaskbarprogress(in nsidocshell shell); nsitaskbarwindowpreview gettaskbarwindowpreview(in nsidocshell shell); void setgroupidforwindow(in nsidomwindow aparent, in astring aidentifier); attributes attribute type description available boolean returns true if the operating system supports windows 7 or later taskbar features; you can use this instead of in-place operating system version checking.
... for xulrunner applications, the defaultgroupid attribute is configured using application.ini settings, and is of the format "vendor.application.version".
...setgroupidforwindow() set the grouping id for a window.
...void setgroupidforwindow( in nsidomwindow aparent, in astring aidentifier ); parameters aparent the parent nsidomwindow.
nsIWritablePropertyBag
1.0 66 introduced gecko 1.8 inherits from: nsipropertybag last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void deleteproperty(in astring name); void setproperty(in astring name, in nsivariant value); methods deleteproperty() delete a property with the given name.
... setproperty() set a property with the given name to the given value.
...void setproperty( in astring name, in nsivariant value ); parameters name property to set the value of.
... value value to set the property to.
nsIXULTemplateQueryProcessor
for instance, a datasource that holds a table that can only produce one set of results.
... the reference variable may be specified in a template by setting the "container" attribute on the <template> element to the variable to use.
...a binding allows an additional variable to be set for a result, outside of those defined within the query.
...if the query processor needs to load the datasource asynchronously, it may set the ashoulddelaybuilding returned parameter to true to delay building the template content, and call the builder's rebuild method when the data is available.
nsIXULTemplateResult
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) each result is identified by an id, which must be unique within the set of results produced from a query.
...each result also contains a set of variable bindings.
...the dom element created for this result, if any, will have its id attribute set to this value.
...if set, the resource uri must be the same as the id property.
XPCOM string functions
this is a low-level api.ns_cstringsetdatathe ns_cstringsetdata function copies data into the string's internal buffer.
... this is a low-level api.ns_cstringsetdatarangethe ns_cstringsetdatarange function copies data into a section of the string's internal buffer.
...this is a low-level api.ns_stringsetdatathe ns_stringsetdata function copies data into the string's internal buffer.
... this is a low-level api.ns_stringsetdatarangethe ns_stringsetdatarange function copies data into a section of the string's internal buffer.
nsMsgNavigationType
will wrap around if the wrap flag is set to true.
...will wrap around if the wrap flag is set to true.
...will wrap around if the wrap flag is set to true.
...will wrap around if the wrap flag is set to true.
Account Provisioner
if the user already has an email account, the user can switch to the original account setup wizard.
... to have logs dumped to the terminal, create a string preference called mail.provider.logging.dump and set its value to all.
... to have logs dumped to the error console, create a string preference called mail.provider.logging.console and set its value to all.
... a mozillazine article on how to set preferences in thunderbird.
LDAP Support
it assumes you are already familiar with configuring preferences for deployed builds in addition to setting up thunderbird to use an ldap directory.
...this can be accomplished by setting the following preferences: user_pref("mail.autocomplete.commentcolumn", 2); user_pref("ldap_2.servers.directoryname.autocomplete.commentformat", "[ou]"); the first preference tells us to use a comment column in the type down (the default value is 0 for no comment), and that the value for the comment is a custom string unique to each directory.
... the commentformat preference is set on each directory.
...in this example, we are setting the organization unit as the ldap attribute.
Mailnews and Mail code review requirements
to obtained a ui-review on an attachment, set ui-review to '?' and enter :bwinton (for blake winton) as the requestee.
...once unit tests are committed, the in-testsuite+ flag should be set on the bug.
...flag should be set on the bug until the framework has been completed and the test code is running automatically.
...these bugs should have the in-testsuite- flag set.
Using the Multiple Accounts API
it holds all the information necessary to retrieve mail from the remote server, such as hostname, user login name, and biff settings.
... here's an example of a common setup.
...a user's smtp servers are not actually dependant on any of the account settings.
...currently, you can set the default smtp server to something else by setting the defaultserver property on the smtpservice, but that will not be saved to disk.
Accessibility Inspector - Firefox Developer Tools
this is a bit like the dom tree, except that it contains a more limited set of elements and slightly different information about them.
... if you don't wish to allow the accessibility features to be automatically enabled, you can use the configuration editor (also known as about:config) to define the preference devtools.accessibility.auto-init.enabled, and set it to false.
... if you don't wish to use the accessibility features at all, you can use the configuration editor to set the preference devtools.accessibility.enabled to false.
... it is also very handy for verifying semantics — you can use the inspect accessibility properties context menu option to quickly see whether an item has the correct role set on it (e.g., whether a button is really a button, or a link is really a link).
Browser Console - Firefox Developer Tools
to enable it set the devtools.chrome.enabled preference to true in about:config, or set the "enable browser chrome and add-on debugging toolboxes" (firefox 40 and later) option in the developer tool settings.
...the messages from scripts in all the opened pages) by setting or clearing the checkbox labeled show content messages.
...to enable it set the devtools.chrome.enabled preference to true in about:config, or set the "enable chrome debugging" option in the developer tool settings.
...on windows, the following code will add a new item to the browser's main menu: var parent = window.document.getelementbyid("appmenuprimarypane"); var makethetea = gbrowser.ownerdocument.defaultview.document.createelementns("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); makethetea.setattribute("label", "a nice cup of tea?"); parent.appendchild(makethetea); on macos, this similar code will add a new item to the "tools" menu: var parent = window.document.getelementbyid("menu_toolspopup"); var makethetea = gbrowser.ownerdocument.defaultview.document.createelementns("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "menuitem"); makethetea.setattribute("label", "a ...
Browser Toolbox - Firefox Developer Tools
to enable it you need to check the settings "enable chrome and addon debugging" and "enable remote debugging".
... to do this, open the developer tools settings, go to the section "advanced settings", and check the settings "enable browser chrome and add-on debugging toolboxes" and "enable remote debugging".
... you will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection property to false): click ok, and the browser toolbox will open in its own window: you'll be able to inspect the browser's chrome windows and see, and be able to debug, all the javascript files loaded by the browser itself and by any add-ons that are running.
...when you close the browser toolbox, the setting will be cleared.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
grid display settings: display line numbers: turn the line numbers shown for each grid overlay on and off (on by default).
... extend lines infinitely: by default, grid lines/tracks are only shown inside the element with display: grid set on it; when toggling this option on, the grid lines extend to the edge of the viewport along each axis.
... note: your grid preferences such as overlay color and display settings choices are persisted across page loads for each separate page.
... extend lines infinitely by default, the grid lines/tracks are only shown inside the element with display: grid set on it.
Debugging Firefox Desktop - Firefox Developer Tools
enable remote debugging first, you'll need to ensure that both debugger and debuggee have the "enable browser chrome and add-on debugging toolboxes" and "enable remote debugging" settings checked in the developer tools settings.
... you only need to do this once: the setting values persist across restarts.
...to use a different port, pass the desired port number: /path/to/firefox --start-debugger-server 1234 note: in windows, the start-debugger-server call will only have one dash: firefox.exe -start-debugger-server 1234 note: by default, and for security reasons, the devtools.debugger.force-local option is set.
... if you want to debug a firefox instance from an external machine, you can change this option, but only do this on a trusted network or set a strong firewall rule to lock down which machines can access it.
AnalyserNode.smoothingTimeConstant - Web APIs
it's basically an average between the current buffer and the last buffer the analysernode processed, and results in a much smoother set of value changes over time.
... if 0 is set, there is no averaging done, whereas a value of 1 means "overlap the previous and current buffer quite a lot while computing the value", which essentially smoothes the changes across analysernode.getfloatfrequencydata/analysernode.getbytefrequencydata calls.
... note: if a value outside the range 0–1 is set, an index_size_err exception is thrown.
... if you are curious about the effect the smoothingtimeconstant() has, try cloning the above example and setting analyser.smoothingtimeconstant = 0; instead.
Animation.startTime - Web APIs
syntax var animationstartedwhen = animation.starttime; animation.starttime = newstarttime; value a floating-point number representing the current time in milliseconds, or null if no time is set.
... you can read this value to determine what the start time is currently set at, and you can change this value to make the animation start at a different time.
...*/ function addcat(){ var newcat = document.createelement("div"); newcat.classlist.add("cat"); return newcat; } /* this is the function that adds a cat to the waapi column */ function animatenewcatwithwaapi() { // make a new cat var newcat = addcat(); // animate said cat with the waapi's "animate" function var newanimationplayer = newcat.animate(keyframes, timing); // set the animation's start time to be the same as the original .cat#withwaapi newanimationplayer.starttime = catrunning.starttime; // add the cat to the pile.
... waapicats.appendchild(newcat); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animation.starttime might get rounded depending on browser settings.
Attr - Web APIs
WebAPIAttr
createattribute() use element.setattribute() instead.
... createattributens() use element.setattributens() instead.
... setattributenode() use element.setattribute() instead.
... setattributenodens() use element.setattributens() instead.
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
it's sensible to set this to a value between 0 and the duration of the buffer.
...this attribute is converted to an exact sample frame offset within the buffer, by multiplying by the buffer's sample rate and rounding to the nearest integer value.
...it's sensible to set this to a value between 0 and the duration of the buffer.
...this attribute is converted to an exact sample frame offset within the buffer, by multiplying by the buffer's sample rate and rounding to the nearest integer value.
AudioBufferSourceNode.playbackRate - Web APIs
the playbackrate property of the audiobuffersourcenode interface is a k-rate audioparam that defines the speed at which the audio asset will be played.
...when set to another value, the audiobuffersourcenode resamples the audio before sending it to the output.
... <input class="playback-rate-control" type="range" min="0.25" max="3" step="0.05" value="1"> <span class="playback-rate-value">1.0</span> function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio...
... data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); playbackcontrol.setattribute('disabled', 'disabled'); } playbackcontrol.oninput = function() { source.playbackrate.value = playbackcontrol.value; playbackvalue.innerhtml = playbackcontrol.value; } specification specification status comment web audio apithe definition of 'playbackrate' in that specification.
AuthenticatorAssertionResponse.authenticatorData - Web APIs
the bits are as follows, where "bit 0" is the least significant bit and all bits not specifically mentioned below are "reserved for future use": bit 0, user presence (up) - if set, authenticator validated that the user was present through some test of user presence (tup), such as touching a button on the authenticator.
... bit 2, user verification (uv) - if set, authenticator verified the actual user, through a biometric, pin, or other authentication method.
... bit 6, attested credential data (at) - if set, attestedcredentialdata will immediately follow the first 37 bytes of this authenticatordata.
... bit 7, extension data (ed) - if set, extension data is present.
BaseAudioContext.createPeriodicWave() - Web APIs
constraints optional an dictionary object that specifies whether normalization should be disabled (if not specified, normalization is enabled by default.) it takes one property: disablenormalization: if set to true, normalization is disabled for the periodic wave.
... var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag, {disablenormalization: true}); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values.
... the first value is the dc offset, which is the value at which the oscillator starts.
...here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave.
BaseAudioContext.decodeAudioData() - Web APIs
older callback syntax in this example, the getdata() function uses xhr to load an audio track, setting the responsetype of the request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable .
... we then pass this buffer into a decodeaudiodata() function; the success callback takes the successfully decoded pcm data, puts it into an audiobuffersourcenode created using audiocontext.createbuffersource(), connects the source to the audiocontext.destination and sets it to loop.
...// then we put the buffer into the source function getdata() { source = audioctx.createbuffersource(); var request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { source.buffer = buffer; source.connect(audioctx.destination); source.loop = true; }, function(e){ console.log("error with decoding audio data" + e.err); }); } request.send(); } // wire up buttons to sto...
...p and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; new promise-based syntax ctx.decodeaudiodata(audiodata).then(function(decodeddata) { // use the decoded data here }); specifications specification status comment web audio apithe definition of 'decodeaudiodata()' in that specification.
Blob.slice() - Web APIs
WebAPIBlobslice
the blob interface's slice() method creates and returns a new blob object which contains data from a subset of the blob on which it's called.
...if you specify a negative value, it's treated as an offset from the end of the blob toward the beginning.
...if you specify a negative value, it's treated as an offset from the end of the blob toward the beginning.
... return value a new blob object containing the specified subset of the data contained within the blob on which this method was called.
Determining the dimensions of elements - Web APIs
if you want to set the width and height of an element, use width and height or the overriding min-width and max-width, and min-height and max-height properties.
... if you need to know the total amount of space an element occupies, including the width of the visible content, scrollbars (if any), padding, and border, you want to use the htmlelement.offsetwidth and htmlelement.offsetheight properties.
...in case of transforms, the offsetwidth and offsetheight returns the element's layout width and height, while getboundingclientrect() returns the rendering width and height.
... as an example, if the element has width: 100px; and transform: scale(0.5); the getboundingclientrect() will return 50 as the width, while offsetwidth will return 100.
CSS Typed Object Model API - Web APIs
it sets a specific css property to the specified values and returns the first value as a cssstylevalue object.
... cssstylevalue.parseall() the parseall() method of the cssstylevalue interface sets all occurences of a specific css property to the specified valueand returns an array of cssstylevalue objects, each containing one of the supplied values.
... stylepropertymap.set() method of stylepropertymap interface that changes the css declaration with the given property to the value given.
... csskeywordvalue.value() property of the csskeywordvalue interface returning or setting the value of the csskeywordvalue.
Cache.keys() - Web APIs
WebAPICachekeys
note: requests with duplicate urls but different headers can be returned if their responses have the vary header set on them.
... if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
Cache.match() - Web APIs
WebAPICachematch
options optional an object that sets options for the match operation.
... for example, if set to true the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e.
Cache.matchAll() - Web APIs
WebAPICachematchAll
options optional an options object allowing you to set specific control options for the matching performed.
... if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that when set to true tells the matching operation not to perform vary header matching — i.e.
Compositing example - Web APIs
the output looks like this: compositing example this code sets up the global values used by the rest of the program.
...urce-atop', 'destination-over','destination-in','destination-out','destination-atop', 'lighter', 'copy','xor', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity' ].reverse(); var gcotext = [ 'this is the default setting and draws new shapes on top of the existing canvas content.', 'the new shape is drawn only where both the new shape and the destination canvas overlap.
...', 'preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.', 'preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.', 'preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.' ].reverse(); var width = 320; var height = 340; main program when the page loads, this code runs to set up and run the example: window.onload = function() { // lum in srgb var lum = { r: 0.33, g: 0.33, b: 0.33 }; // resize canvas canvas1.width = width; canvas1.height = height; canvas2.width = width; canvas2.height = height; lightmix() colorsphere(); runcomposite(); return; }; and this code, runcomposite(), handles the bulk o...
...= "rgba(0,255,0,1)"; ctx.arc(160, 100, 100, math.pi*2, 0, false); ctx.fill(); ctx.restore(); ctx.beginpath(); ctx.fillstyle = "#f00"; ctx.fillrect(0,0,30,30) ctx.fill(); }; var colorsphere = function(element) { var ctx = canvas1.getcontext("2d"); var width = 360; var halfwidth = width / 2; var rotate = (1 / 360) * math.pi * 2; // per degree var offset = 0; // scrollbar offset var oleft = -20; var otop = -20; for (var n = 0; n <= 359; n ++) { var gradient = ctx.createlineargradient(oleft + halfwidth, otop, oleft + halfwidth, otop + halfwidth); var color = color.hsv_rgb({ h: (n + 300) % 360, s: 100, v: 100 }); gradient.addcolorstop(0, "rgba(0,0,0,0)"); gradient.addcolorstop(0.7, "rgba("+color.r+","+col...
Compositing and clipping - Web APIs
we can, however, change this behaviour by setting the globalcompositeoperation property.
... globalcompositeoperation = type this sets the type of compositing operation to apply when drawing new shapes, where type is a string identifying which of the twelve compositing operations to use.
... a clip example in this example, we'll use a circular clipping path to restrict the drawing of a set of random stars to a particular region.
...after this a set of 50 randomly positioned and scaled stars is drawn, using the custom drawstar() function.
Drawing text - Web APIs
textalign = value text alignment setting.
... textbaseline = value baseline alignment setting.
... a textbaseline example edit the code below and see your changes update live in the canvas: ctx.font = '48px serif'; ctx.textbaseline = 'hanging'; ctx.stroketext('hello world', 0, 100); playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.font = "48px serif"; ctx.textbaseline = "hanging"; ctx.stroketext("hello world", 0, 100);</textarea> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyi...
...d('edit'); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); advanced text measurements in the case you need to obtain more details about the text, the following method allows you to measure it.
Using images - Web APIs
to do this, you can use the convenient image() constructor: var img = new image(); // create new img element img.src = 'myimage.png'; // set source path when this script gets executed, the image starts loading.
...so you need to be sure to use the load event so you don't try this before the image has loaded: var img = new image(); // create new img element img.addeventlistener('load', function() { // execute drawimage statements here }, false); img.src = 'myimage.png'; // set source path if you're only using one external image this can be a good approach, but once you need to track more than one we need to resort to something more clever.
...the images are hidden from output by setting the css property display to none for those images.
... } td { padding: 15px; } tying it all together is the javascript to draw our framed images: function draw() { // loop through all images for (var i = 0; i < document.images.length; i++) { // don't add a canvas for the frame image if (document.images[i].getattribute('id') != 'frame') { // create canvas element canvas = document.createelement('canvas'); canvas.setattribute('width', 132); canvas.setattribute('height', 150); // insert before the image document.images[i].parentnode.insertbefore(canvas,document.images[i]); ctx = canvas.getcontext('2d'); // draw image to canvas ctx.drawimage(document.images[i], 15, 20); // add frame ctx.drawimage(document.getelementbyid('frame'), 0, 0); } } } controll...
Using channel messaging - Web APIs
secondly, have a look at our multimessaging demo (run this live), which shows a slightly more complex setup that can send multiple messages between the main page and an iframe.
...for this initial port transfering this message could be an empty string but in this example it is set to 'init'.
... receiving the port and message in the iframe over in the iframe, we have the following javascript: var list = document.queryselector('ul'); var port2; // listen for the initial port transfer message window.addeventlistener('message', initport); // setup the transferred port function initport(e) { port2 = e.ports[0]; port2.onmessage = onmessage; } // handle messages received on port2 function onmessage(e) { var listitem = document.createelement('li'); listitem.textcontent = e.data; list.appendchild(listitem); port2.postmessage('message received by iframe: "' + e.data + '"'); } when the initial message is received from the main pa...
... when a message is received from the main page we create a list item and insert it in the unordered list, setting the textcontent of the list item equal to the event's data attribute (this contains the actual message).
CharacterData - Web APIs
characterdata.deletedata() removes the specified amount of characters, starting at the specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring.
... characterdata.insertdata() inserts the specified characters, at the specified offset, in the characterdata.data string; when this method returns, data contains the modified domstring.
... characterdata.replacedata() replaces the specified amount of characters, starting at the specified offset, with the specified domstring; when this method returns, data contains the modified domstring.
... characterdata.substringdata() returns a domstring containing the part of characterdata.data of the specified length and starting at the specified offset.
CloseEvent.initCloseEvent() - Web APIs
this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
... syntax event.initmouseevent(type, canbubble, cancelable, wasclean, reasoncode, reason); parameters type the string to set the event's type to.
...sets the value of event.bubbles.
...sets the value of event.cancelable.
Document.popupNode - Web APIs
when a popup attached via the popup or context attributes is opened, the xul document's popupnode property is set to the node that was clicked on.
...if the popup was opened via the keyboard, the popup node may be set to null.
... this property is only set for popups attached via the popup or context attributes.
...in these other cases, for example when calling the popup's showpopup method, you may wish to set the popupnode property directly beforehand.
Document.requestStorageAccess() - Web APIs
examples: allow lists, block lists, on-device classification, user settings, anti-clickjacking heuristics, or prompting the user for explicit permission.
... reset after 24 hours in the case of a long-running browser session.
... reset after 30 days.
...to make testing easier, we have added two preferences in about:config that control prompting upon requeststorageaccess() calls: dom.storage_access.auto_grants can be set to false to disable the automatic granting of ephemeral storage access grants.
Examples of web and XML development using the DOM - Web APIs
width="500"> </p> <p>image 3: no height, width, but style="height: 50px; width: 500px;" <img id="image3" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" style="height: 50px; width: 500px;"> </p> <div id="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="ma...
...ke 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 element and that object's css style properties, which can be retrieved and set from the dom.
...ventlistener("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.getcomputedstyle method can be used to get the styles of an element that are not set using the style attribute or with javascript (e.g., elt.style.backgroundcolor="rgb(173, 216, 230)").
... <!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <title>show event properties</title> <style> table { border-collapse: collapse; } thead { font-weight: bold; } td { padding: 2px 10px 2px 10px; } .odd { background-color: #efdfef; } .even { background-color: #ffffff; } </style> <script> function showeventproperties(e) { function addcell(row, text) { var cell = row.insertcell(-1); cell.appendchild(document.createtextnode(te...
Element.classList - Web APIs
WebAPIElementclassList
if the class attribute is not set or empty, it returns an empty domtokenlist, i.e.
... examples const div = document.createelement('div'); div.classname = 'foo'; // our starting state: <div class="foo"></div> console.log(div.outerhtml); // use the classlist api to remove and add classes div.classlist.remove("foo"); div.classlist.add("anotherclass"); // <div class="anotherclass"></div> console.log(div.outerhtml); // if visible is set remove it, otherwise add it div.classlist.toggle("visible"); // add/remove visible, depending on test conditional, i less than 10 div.classlist.toggle("visible", i < 10 ); console.log(div.classlist.contains("foo")); // add or remove multiple classes div.classlist.add("foo", "bar", "baz"); div.classlist.remove("foo", "bar", "baz"); // add or remove multiple classes using spread syntax const cl...
...i] === toks[ci]) { sub++; continue a; } this[ci-sub] = toks[ci]; } protoobjproto.length = clen-sub, protoobjproto.value = ele.classname, protoobjproto[" ucl"] = ele; if (defineproperty) { defineproperty(ele, "classlist", { // ie8 & ie9 allow defineproperty on the dom enumerable: 1, get: function(){return restokenlist}, configurable: 0, set: function(newval){ skippropchange = 1, ele.classname = protoobjproto.value = (newval += ""), skippropchange = 0; var toks = newval.trim().split(wsre), oldlen = protoobjproto.length; a: for(var ci = 0, clen = protoobjproto.length = toks.length, sub = 0; ci !== clen; ++ci){ for(var inneri=0; inneri!==ci; ++inneri) if(toks[inneri]==...
...prototype instanceof node is true according to the specs window.object.defineproperty(window.element.prototype, "classlist", { enumerable: 1, get: function(val){ if (!hasownprop.call(this, "classlist")) polyfillclasslist(this); return this.classlist; }, configurable: 0, set: function(val){this.classname = val} }); } catch(e) { // less performant fallback for older browsers (ie 6-8): window[" ucl"] = polyfillclasslist; // the below code ensures polyfillclasslist is applied to all current and future elements in the doc.
Element: mousewheel event - Web APIs
on linux, 2 or -2 is set per native wheel event.
...the value isn't changed even if the scroll amount of system settings is page scroll.
...and also, the value isn't changed even if the scroll amount of system settings is page scroll, i.e., the value is the same as ie on windows.
... on windows, since the detail attribute value is computed from actual scroll amount, the value is different from other browsers except the scroll amount per notch is 3 lines in system settings or a page.
Element.releasePointerCapture() - Web APIs
the releasepointercapture() method of the element interface releases (stops) pointer capture that was previously set for a specific (pointerevent) pointer.
... see the element.setpointercapture() method for a description of pointer capture and how to set it for a particular element.
... example this example sets pointer capture on a <div> when you press down on it.
... html <div id="slider">slide me</div> css div { width: 140px; height: 50px; display: flex; align-items: center; justify-content: center; background: #fbe; } javascript function beginsliding(e) { slider.onpointermove = slide; slider.setpointercapture(e.pointerid); } function stopsliding(e) { slider.onpointermove = null; slider.releasepointercapture(e.pointerid); } function slide(e) { slider.style.transform = `translate(${e.clientx - 70}px)`; } const slider = document.getelementbyid('slider'); slider.onpointerdown = beginsliding; slider.onpointerup = stopsliding; result specifications specification status comment pointer events – le...
Fetch API - Web APIs
WebAPIFetch API
it will seem familiar to anyone who has used xmlhttprequest, but the new api provides a more powerful and flexible feature set.
...instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the request from completing.
...set-cookie headers from other sites are silently ignored.
... fetch() won’t send cookies, unless you set credentials: 'same-origin'.
GlobalEventHandlers.onanimationend - Web APIs
we set its size, position, color, and layout.
...first, the "slideanimation" class, which establishes the animation that will cause the box to move over the course of five seconds, one time, using the "slidebox" keyframe set.
... function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationname + "</code> at time " + event.elapsedtime.tofixed(2) + " seconds."; } logbox.innerhtml += "\n"; }; then we set up the event handlers for the animationstart and animationend events: let box = document.getelementbyid("box"); box.onanimationstart = function(event) { log("animation started", event); } box.onanimationend = function(event) { log("animation stopped", event); }; finally, we set up a handler for a click on the button that runs the animation: document.getelementbyid("play").addeventlisten...
...er("click", function(event) { document.getelementbyid("box").classname = "slideanimation"; event.target.style.display = "none"; }, false); this sets the class of the box we want to animate to the class that contains the animation description, then hides the play button because this example will only run the animation once.
GlobalEventHandlers.onanimationstart - Web APIs
we set its size, position, color, and layout.
...first, the "slideanimation" class, which establishes the animation that will cause the box to move over the course of five seconds, one time, using the "slidebox" keyframe set.
... function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationname + "</code> at time " + event.elapsedtime.tofixed(2) + " seconds."; } logbox.innerhtml += "\n"; }; then we set up the event handlers for the animationstart and animationend events: let box = document.getelementbyid("box"); box.onanimationstart = function(event) { log("animation started", event); } box.onanimationend = function(event) { log("animation stopped", event); }; finally, we set up a handler for a click on the button that runs the animation: document.getelementbyid("play").addeventlisten...
...er("click", function(event) { document.getelementbyid("box").classname = "slideanimation"; event.target.style.display = "none"; }, false); this sets the class of the box we want to animate to the class that contains the animation description, then hides the play button because this example will only run the animation once.
msAudioCategory - Web APIs
note that you must set the msaudiocategory before setting the src property in code.
...*note that if msaudiocategory is set to communications, msrealtime is automatically set to true.
... no if msaudiodevicetype is not explicitly set, msaudiodevicetype will be set to communications.
... for hardware audio offload to be automatically applied, the audio category must be set to foregroundonlymedia or backgroundcapablemedia.
HTMLDialogElement.open - Web APIs
true means it is set, and therefore the dialog is shown.
... false means it not set, and therefore the dialog is not shown.
... the property is now read only — it is possible to set the value to programmatically show or hide the dialog.
...d="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); di...
HTMLElement.dir - Web APIs
WebAPIHTMLElementdir
the htmlelement.dir property gets or sets the text writing directionality of the content of the current element.
... 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".
... when a table has its dir set to "rtl", the column order is arranged from right to left.
... when an element has its dir set to "auto", the direction of the element is determined based on its first strong directionality character, or default to the directionality of its parent element.
HTMLImageElement.alt - Web APIs
decorative images images with no semantic meaning—such as those which are solely decorative—or of limited informational value, should have their alt attributes set to the empty string ("").
...ut nunc neque, porta eu auctor at, tempor et arcu.</p> </div> </div> css the css for this example simply sets up the styles for the layout as shown in the result below.
...the alt attribute is set to new page!
...a photo of a yellow teapot might literally have its alt attribute set to "a yellow teapot".
HTMLMediaElement.srcObject - Web APIs
the srcobject property of the htmlmediaelement interface sets or returns the object which serves as the source of the media associated with the htmlmediaelement.
... note: as of march 2020, only safari supports setting objects other than mediastream.
... usage notes older versions of the media source specification required using createobjecturl() to create an object url then setting src to that url.
... now you can just set srcobject to the mediastream directly.
HTMLMetaElement - Web APIs
name type description content domstring gets or sets the value of meta-data property.
... httpequiv domstring gets or sets the name of an http response header to define for a document.
... name domstring gets or sets the name of a meta-data property to define for a document.
... scheme domstring gets or sets the name of a scheme used to interpret the value of a meta-data property.
HTMLOutputElement - Web APIs
htmloutputelement.setcustomvalidity() sets a custom validity message for the element.
... if the element is in default mode when the descendants of the element are changed in any way, the defaultvalue property is set to the value of the textcontent property.
... resetting the form puts the element into default mode, and sets the textcontent property to the value of the defaultvalue property.
... value mode the element goes into value mode when the contents of the value property are set.
HTMLScriptElement - Web APIs
htmlscriptelement.charset is a domstring representing the character encoding of an external script.
... it reflects the charset attribute.
... htmlscriptelement.crossorigin is a domstring reflecting the cors setting for the script element.
...on setting, it acts the same way as the textcontent idl attribute.
HTMLSelectElement.autofocus - Web APIs
if there are several, the first element with the attribute set inserted, usually the first such element on the page, get the initial focus.
... setting this property doesn't set the focus to the associated <select> element: it merely tells the browser to focus to it when the element is inserted in the document.
... setting it after the insertion, that is most of the time after the document load, has no visible effect.
... syntaxedit abool = aselectelement.autofocus; // get the value of autofocus aselectelement.autofocus = abool; // set the value of autofocus example html <select id="myselect" autofocus> <option>option 1</option> <option>option 2</option> </select> javascript // check if the autofocus attribute on the <select> var hasautofocus = document.getelementbyid('myselect').autofocus; specifications specification status comment html living standardthe definition of 'autofocus' in that specification.
The HTML DOM API - Web APIs
html element interfaces these interfaces represent specific html elements (or sets of related elements which have the same properties and methods associated with them).
... htmlanchorelement htmlareaelement htmlaudioelement htmlbrelement htmlbaseelement htmlbodyelement htmlbuttonelement htmlcanvaselement htmldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldirectoryelement htmldivelement htmlelement htmlembedelement htmlfieldsetelement htmlformelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmliframeelement htmlimageelement htmlinputelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmediaelement htmlmenuelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloutputelement htmlparagraphelement htmlparamelement htmlpictureelement html...
...colelement htmltableelement htmltablerowelement htmltablesectionelement htmltemplateelement htmltextareaelement htmltimeelement htmltitleelement htmltrackelement htmlulistelement htmlunknownelement htmlvideoelement deprecated html element interfaces htmlmarqueeelement obsolete html element interfaces htmlbasefontelement htmlfontelement htmlframeelement htmlframesetelement htmlisindexelement htmlmenuitemelement web app and browser integration interfaces these interfaces offer access to the browser window and document that contain the html, as well as to the browser's state, available plugins (if any), and various configuration options.
... the htmlinputelement object for the "send" button's disabled property is set to true, which disables the "send" button so it can't be clicked.
Headers - Web APIs
WebAPIHeaders
these actions include retrieving, setting, adding to, and removing headers from the list of the request's headers.
...this affects whether the set(), delete(), and append() methods will mutate the header.
... headers.set() sets a new value for an existing header inside a headers object, or adds the header if it does not already exist.
... note: to be clear, the difference between headers.set() and headers.append() is that if the specified header does already exist and does accept multiple values, headers.set() will overwrite the existing value with the new one, whereas headers.append() will append the new value onto the end of the set of values.
IDBCursor - Web APIs
WebAPIIDBCursor
if the cursor is outside its range, this is set to undefined.
...if the cursor is currently being iterated or has iterated outside its range, this is set to undefined.
... methods idbcursor.advance() sets the number of times a cursor should move its position forward.
... idbcursor.continueprimarykey() sets the cursor to the given index key and primary key given as arguments.
IDBVersionChangeRequest - Web APIs
warning: the latest specification does not include this interface anymore as the idbdatabase.setversion() method has been removed.
...it is used only by the setversion() method of idbdatabase.
... methods inherits from: idbrequest idbversionchangerequest.setversion updates the version of the database.
... nochrome android no support nofirefox android no support noopera android no support nosafari ios no support nosamsung internet android no support nosetversion deprecatednon-standardchrome no support noedge no support nofirefox no support noie no support noopera no support nosafari no support ...
IndexedDB API - Web APIs
combine indexeddb for storing data offline with service workers for storing assets offline, as outlined in making pwas work offline with service workers.
... idbobjectstore represents an object store that allows access to a set of data in an indexeddb database, looked up via primary key.
... idbindex also allows access to a subset of data in an indexeddb database, but uses an index to retrieve the record(s) rather than the primary key.
...the way to change the version of the database has since changed (by calling idbfactory.open without also calling idbdatabase.setversion), and the interface idbopendbrequest now has the functionality of the removed idbversionchangerequest.
KeyboardEvent.code - Web APIs
if the input device isn't a physical keyboard, but is instead a virtual keyboard or accessibility device, the returned value will be set by the browser to match as closely as possible to what would happen with a physical keyboard, to maximize compatibility between physical and virtual input devices.
...finally, spaceship is set to refer to the element with the id "spaceship", which is the svg polygon representing the ship the player controls.
... function updateposition(offset) { let rad = angle * (math.pi/180); position.x += (math.sin(rad) * offset); position.y -= (math.cos(rad) * offset); if (position.x < 0) { position.x = 399; } else if (position.x > 399) { position.x = 0; } if (position.y < 0) { position.y = 399; } else if (position.y > 399) { position.y = 0; } } the refresh() function handles applying the rotation and position...
... function refresh() { let x = position.x - (shipsize.width/2); let y = position.y - (shipsize.height/2); let transform = "translate(" + x + " " + y + ") rotate(" + angle + " 15 15) "; spaceship.setattribute("transform", transform); } finally, the addeventlistener() method is used to start listening for keydown events, acting on each key by updating the ship position and rotation angle, then calling refresh() to draw the ship at its new position and angle.
KeyframeEffect.KeyframeEffect() - Web APIs
syntax var keyframes = new keyframeeffect(element, keyframeset, keyframeoptions); var keyframes = new keyframeeffect(sourcekeyframes); parameters the first type of constructor (see above) creates a completely new keyframeeffect object instance.
... keyframeset an keyframe object or null.
...0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
... examples in the follow the white rabbit example, the keyframeeffect constructor is used to create a set of keyframes that dictate how the white rabbit should animate down the hole: var rabbitdownkeyframes = new keyframeeffect( whiterabbit, // element to animate [ { transform: 'translatey(0%)' }, // keyframe { transform: 'translatey(100%)' } // keyframe ], { duration: 3000, fill: 'forwards' } // keyframe options ); specifications specification status ...
KeyframeEffect.getKeyframes() - Web APIs
the getkeyframes() method of a keyframeeffect returns an array of the computed keyframes that make up this animation along with their computed offsets.
... offset the offset of the keyframe specified as a number between 0.0 and 1.0 inclusive or null.
... computedoffset the computed offset for this keyframe, calculated when the list of computed keyframes was produced according to keyframeeffect.spacing.
... unlike offset, above, the computedoffset is never null.
MediaConfiguration - Web APIs
if you plan on querying encoding information, set the media type to record or transmission.
... for decoding, set the type to file or media-source.
... a valid media decoding configuration, to be submitted as the parameter for mediacapabilities.decodinginfo() method, has it's `type` set as: file: for plain playback file.
... a valid media encoding configuration, to be submitted as the parameter for mediacapabilities.encodinginfo() method, has it's `type` set as: record: for recording media.
MediaDevices.getUserMedia() - Web APIs
here's a full example: { audio: true, video: { width: { min: 1024, ideal: 1280, max: 1920 }, height: { min: 576, ideal: 720, max: 1080 } } } an ideal value, when used, has gravity, which means that the browser will try to find the setting (and camera, if you have more than one), with the smallest fitness distance from the ideal values given.
... typeerror the list of constraints specified is empty, or has all constraints set to false.
...the following are examples of situations in which getusermedia() is not permitted to be called: a document loaded into a sandboxed <iframe> element cannot call getusermedia() unless the <iframe> has its sandbox attribute set to allow-same-origin.
... // older browsers might not implement mediadevices at all, so we set an empty object first if (navigator.mediadevices === undefined) { navigator.mediadevices = {}; } // some browsers partially implement mediadevices.
MediaList.mediaText - Web APIs
the mediatext property of the medialist interface is a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist.
... if you wish to set new media queries on the document, the string value must have the different queries separated by commas, e.g.
... also note that is you try to set mediatext to null, it will be treated as an empty string, i.e.
... the value will be set to "".
MediaMetadata - Web APIs
properties mediametadata.title returns or sets the title of the media to be played.
... mediametadata.artist returns or sets the name of the artist, group, creator, etc.
... mediametadata.album returns or sets the name of the album or collection containing the media to be played.
... mediametadata.artwork returns or sets an array of images associated with playing media.
MediaPositionState.position - Web APIs
the mediapositionstate dictionary's position property is used when calling the mediasession method setpositionstate() to provide the user agent with the current playback position, in seconds, of the currently-playing media.
... example in this example, a player for a non-standard media file format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position information by calling setpositionstate().
... if the media is still playing when the interval is fired, setpositionstate() is called with an object that specifies the duration, playback rate, and position as reported by a mymedia object that describes the track being played.
... let positioninterval = window.setinterval(() => { if (mymedia.isplaying) { navigator.mediasession.setpositionstate({ duration: mymedia.trackdurationinseconds, playbackrate: mymedia.playbackrate, position: mymedia.trackplaypositioninseconds }); } else { window.clearinterval(positioninterval); } }, 1000); specifications specification status comment media session standardthe definition of 'mediapositionstate.position' in that specification.
MediaSession - Web APIs
methods setactionhandler() sets an event handler for a media session action, such as play or pause.
... setpositionstate() sets the current playback position and speed of the media currently being presented.
... examples the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } the following example sets up event handlers for pau...
...sing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; navigator.mediasession.setactionhandler('play', play); navigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); navigator.mediasession.playbackstate = "playing"; } function pause() { audio.pause(); navigator.mediasession.playbackstate = "paused"; } specifications specification status comment media session standardthe definition of 'mediasession' in that specification.
MediaSource.duration - Web APIs
the duration property of the mediasource interface gets and sets the duration of the current media being presented.
... exceptions the following exceptions may be thrown when setting a new value for this property.
... exception explanation invalidaccesserror an attempt was made to set a duration value that was negative, or nan.
...their sourcebuffer.updating property is true.) example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); mediasource.duration = 120; video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ...
MediaStreamTrack.enabled - Web APIs
when enabled is set to false, the track only generates empty frames.
... empty audio frames have every sample's value set to 0.
... empty video frames have every pixel set to black.
... usage notes if the mediastreamtrack represents the video input from a camera, disabling the track by setting enabled to false also updates device activity indicators to show that the camera is not currently recording or streaming.
MediaTrackConstraints.displaySurface - Web APIs
see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints.
... usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's video mediastreamtrack, then checking the value of the returned mediatracksettings object's displaysurface object.
... for example, if your app needs to know that the surface being shared is a monitor or application—meaning that there's possibly a non-content backdrop—it can use code similar to this: let mayhavebackdropflag = false; let displaysurface = displaystream.getvideotracks()[0].getsettings().displaysurface; if (displaysurface === "monitor" || displaysurface ==="application") { mayhavebackdropflag = true; } following this code, mayhavebackdrop is true if the display surface contained in the stream is of type monitor or application; either of these may have non-content backdrop areas.
...in addition, see example: constraint exerciser in capabilities, constraints, and settings for a complete example showing how constraints are used.
Microdata DOM API - Web APIs
these elements have their element.itemscope idl attribute set to true.
... the document.getitems(typenames) method takes a string that contains an unordered set of unique space-separated tokens that are case-sensitive, representing types.
... can be set, to change the element's value.
... setting the value when the element has no itemprop attribute or when the element's value is an item throws an invalidaccesserror exception.
MouseEvent() - Web APIs
mouseeventinit optional is a mouseeventinit dictionary, having the following fields: "screenx", optional and defaulting to 0, of type long, that is the horizontal position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer.
... "screeny", optional and defaulting to 0, of type long, that is the vertical position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer.
... "clientx", optional and defaulting to 0, of type long, that is the horizontal position of the mouse event on the client window of user's screen; setting this value doesn't move the mouse pointer.
... "clienty", optional and defaulting to 0, of type long, that is the vertical position of the mouse event on the client window of the user's screen; setting this value doesn't move the mouse pointer.
Node.getUserData() - Web APIs
WebAPINodegetUserData
the node.getuserdata() method returns any user domuserdata set previously on the given node by node.setuserdata().
... the node.setuserdata and node.getuserdata methods are no longer available from web content.
... element.dataset or weakmap can be used instead.
... example var d = document.setuserdata('key', 15, null); console.log(document.getuserdata('key')); // 15 specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.getuserdata()' in that specification.
OscillatorNode - Web APIs
event handlers oscillatornode.onended sets the event handler for the ended event, which fires when the tone has stopped playing.
... methods inherits methods from its parent, audioscheduledsourcenode, and adds the following: oscillatornode.setperiodicwave() sets a periodicwave which describes a periodic waveform to be used instead of one of the standard waveforms; calling this sets the type to custom.
... this replaces the now-obsolete oscillatornode.setwavetable() method.
... // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'oscillatornode' in that specification.
Page Visibility API - Web APIs
timers such as settimeout() are throttled in background/inactive tabs to help improve performance.
... the example, which pauses the video when you switch to another tab and plays again when you return to its tab, was created with the following code: // set the name of the hidden property and the change event for visibility var hidden, visibilitychange; if (typeof document.hidden !== "undefined") { // opera 12.10 and firefox 18 and later support hidden = "hidden"; visibilitychange = "visibilitychange"; } else if (typeof document.mshidden !== "undefined") { hidden = "mshidden"; visibilitychange = "msvisibilitychange"; } else if (typeof docume...
...ort addeventlistener or the page visibility api if (typeof document.addeventlistener === "undefined" || hidden === undefined) { console.log("this demo requires a browser, such as google chrome or firefox, that supports the page visibility api."); } else { // handle page visibility change document.addeventlistener(visibilitychange, handlevisibilitychange, false); // when the video pauses, set the title.
... // this shows the paused videoelement.addeventlistener("pause", function(){ document.title = 'paused'; }, false); // when the video plays, set the title.
PaymentAddress.toJSON() - Web APIs
esktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettojson()chrome full support 61disabled full support 61disabled disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled).
...requires the comma-delineated list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nosafari full support yeswebview android no support nochrome android full support 61disabled full support 61disabled disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled).
...requires the comma-delineated list in dom.payments.request.supportedregions to contain one or more of the supported 2-character iso locales, currently us and ca.disabled from version 62: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.abort() - Web APIs
parameters none examples the following example sets up a timeout to clear the payment request that might have been abandoned or neglected.
... var request = new paymentrequest(supportedinstruments, details, options); var paymenttimeout = window.settimeout(() => { window.cleartimeout(paymenttimeout); request.abort().then(() => { print('payment timed out after 20 minutes.'); }).catch(() => { print('unable to abort, because the user is currently in the process ' + 'of paying.'); }); }, 20 * 60 * 1000); /* 20 minutes */ specifications specification status comment payment request apithe definition of 'abort()' in that specification.
... 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.shippingOption - Web APIs
the shippingoption read-only attribute of the paymentrequest interface returns either the id of a selected shipping option, null (if no shipping option was set to be selected) or a shipping option selected by the user.
... this attribute is only populated if the constructor is called with the requestshipping flag set to true.
... 61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest - Web APIs
properties paymentrequest.id read only secure context an unique identifier for a particular paymentrequest, which can be set via details.id.
... when none is set, it defaults to a uuid.
...this property is only populated if the constructor is called with the requestshipping flag set to true.
...this property is only populated if the constructor is called with the requestshipping flag set to true.
PaymentResponse.payerEmail - Web APIs
this option is only present when the requestpayeremail option is set to true in the paymentoptions object passed to the paymentrequest constructor.
... 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... yeswebview android no support nochrome android full support 56 full support 56 no support 53 — 56disabled disabled from version 53 until version 56 (exclusive): this feature is behind the #web-payments preference (needs to be set to enabled).
... to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.shippingOption - Web APIs
this option is only present when the requestshipping option is set to true in the paymentoptions object passed to the paymentrequest constructor.
... 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... yeswebview android no support nochrome android full support 56 full support 56 no support 53 — 56disabled disabled from version 53 until version 56 (exclusive): this feature is behind the #web-payments preference (needs to be set to enabled).
... to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
Permissions - Web APIs
permissions.requestall() requests permission to use a given set of apis.
... permissions.revoke() revokes the permission currently set on a given api.
...alnon-standardchrome full support 46edge full support 79firefox full support 51disabled full support 51disabled disabled from version 51: this feature is behind the dom.permissions.revoke.enable preference (needs to be set to true).
...id full support 46chrome android full support 46firefox android full support 51disabled full support 51disabled disabled from version 51: this feature is behind the dom.permissions.revoke.enable preference (needs to be set to true).
Using Pointer Events - Web APIs
create a canvas the touch-action property is set to none to prevent the browser from applying its default touch behavior to the application.
...</canvas> <br> <button onclick="startup()">initialize</button> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below should be called by our <body> element's onload attribute (but in the example we use a button to trigger it, due to limitations of the mdn live example system).
... function startup() { var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("pointerdown", handlestart, false); el.addeventlistener("pointerup", handleend, false); el.addeventlistener("pointercancel", handlecancel, false); el.addeventlistener("pointermove", handlemove, false); log("initialized."); } this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
... b = math.floor(touch.pointerid / 7) % 16; r = r.tostring(16); // make it a hex digit g = g.tostring(16); // make it a hex digit b = b.tostring(16); // make it a hex digit var color = "#" + r + g + b; log("color for touch with identifier " + touch.pointerid + " = " + color); return color; } the result from this function is a string that can be used when calling <canvas> functions to set drawing colors.
RTCPeerConnection() - Web APIs
if this property isn't specified, a set of certificates is generated automatically for each rtcpeerconnection instance.
... this configuration option cannot be changed after it is first specified; once the certificates have been set, this property is ignored in future calls to rtcpeerconnection.setconfiguration().
...you may find in some cases that connections can be established more quickly by allowing the ice agent to start fetching ice candidates before you start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocaldescription() is called.
...if this value is set (it defaults to null), the rtcpeerconnection will not connect to a remote peer unless it can successfully authenticate with the given name.
RTCPeerConnection: negotiationneeded event - Web APIs
this occurs both during the initial setup of the connection as well as any time a change to the communication environment requires reconfiguring the connection.
... pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer...
...the other peer should recognize this message and follow up by creating its own rtcpeerconnection, setting the remote description with setremotedescription(), and then creating an answer to send back to the offering peer.
... you can also set an event handler for the negotiationneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling.
RTCPeerConnection.onsignalingstatechange - Web APIs
the function receives as input the event object of type event; this event is sent when the peer connection's signalingstate changes, which may happen either because of a call to setlocaldescription() or to setremotedescription().
... syntax rtcpeerconnection.onsignalingstatechange = errorhandler; value set this to a function which you provide that receives an event object as input; this contains the signalingstatechange event.
... you may also, as always, set up a handler for the signalingstatechange event using addeventlistener(): myrtcpeerconnection.addeventlistener("signalingstatechange", mysignalingstatechangehandler); or, using an anonymous (inline) handler: myrtcpeerconnection.addeventlistener("signalingstatechange", event => { /* handle the event here */ }); example this snippet shows a handler for signalingstatechange that looks for the "have-local-pranswer" signaling state—indicating that a remote offer has been received and a local description of type "pranswer" has been applied in response.
... pc.onsignalingstatechange = function(event) { if (pc.signalingstate === "have-local-pranswer") { // setlocaldescription() has been called with an answer } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onsignalingstatechange' in that specification.
RTCPeerConnection.peerIdentity - Web APIs
if there isn't already a target peer identity, peeridentity is set to a newly created promise and the process begins again, until the process succeeds or no further attempts to authenticate occur.
... note: the promise returned by setremotedescription() cannot resolve until any target peer identity that's been set is validated.
... if the identity hasn't been validated yet, the promise returned by setremotedescription() will be rejected.
... if there's no target peer identity, setremotedescription() doesn't need to wait for validation to occur before it resolves.
RTCRtpEncodingParameters - Web APIs
this value can only be set when creating the transceiver; after that, this value is read only.
... rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension.
... this parameter cannot be modified using setparameters().
... its value can only be set when the transceiver is first created.
RTCRtpParameters - Web APIs
to obtain the parameters of a sender or receiver, call its getparameters() method: getparameters() getparameters() properties codecs an array of rtcrtpcodecparameters objects describing the set of codecs from which the sender or receiver will choose.
... this parameter cannot be changed once initially set.
...this parameter cannot be changed once initially set.
...this parameter cannot be changed once initially set.
Range.comparePoint() - Web APIs
if the reference node is a node of type text, comment, or cdatasection, then offset is the number of characters from the start of reference node.
... for other node types, offset is the number of child nodes between the start of the reference node.
... syntax returnvalue = range.comparepoint(referencenode, offset) parameters referencenode the node to compare with the range.
... offset an integer greater than or equal to zero representing the offset inside the referencenode.
ReadableStream.pipeThrough() - Web APIs
available options are: preventclose: if this is set to true, the source readablestream closing will no longer cause the destination writablestream to be closed.
... preventabort: if this is set to true, errors in the source readablestream will no longer abort the destination writablestream.
... preventcancel: if this is set to true, errors in the destination writablestream will no longer cancel the source readablestream.
... signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller.
ReadableStream.pipeTo() - Web APIs
available options are: preventclose: if this is set to true, the source readablestream closing will no longer cause the destination writablestream to be closed.
... preventabort: if this is set to true, errors in the source readablestream will no longer abort the destination writablestream.
... preventcancel: if this is set to true, errors in the destination writablestream will no longer cancel the source readablestream.
... signal: if set to an abortsignal object, ongoing pipe operations can then be aborted via the corresponding abortcontroller.
SVGMarkerElement - Web APIs
interface overview also implement none methods void setorienttoangle(in svgangle angle) void setorienttoauto() properties svganimatedlength refx svganimatedlength refy svganimatedenumeration markerunits svganimatedlength markerwidth svganimatedlength markerheight svganimatedenumeration orienttype svganimatedangle orientangle constants ...
...if markerunits is svg_marker_orient_angle, the angle value for attribute orient; otherwise, it will be set to zero.
... setorienttoangle(in svgangle angle) void sets the value of attribute orient to the given angle.
... setorienttoauto() void sets the value of attribute orient to 'auto'.
Using server-sent events - Web APIs
sten for events with addeventlistener(): evtsource.addeventlistener("ping", function(event) { const newelement = document.createelement("li"); const time = json.parse(event.data).time; newelement.innerhtml = "ping at " + time; eventlist.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and outputs that information.
... when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be especially painful when opening multiple tabs, as the limit is per browser and is set to a very low number (6).
... the php code for the example we're using here follows: date_default_timezone_set("america/new_york"); header("cache-control: no-cache"); header("content-type: text/event-stream"); $counter = rand(1, 10); while (true) { // every second, send a "ping" event.
... id the event id to set the eventsource object's last event id value.
ServiceWorkerMessageEvent - Web APIs
this extends the default message event to allow setting a serviceworker object as the source of a message.
... serviceworkermessageevent.origin read only returns the origin of the service worker's environment settings object.
... examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
... // set up a message channel to communicate with the sw var channel = new messagechannel(); channel.port1.onmessage = function(e) { console.log(e); handlechannelmessage(e.data); } mysw = reg.active; mysw.postmessage('hello', [channel.port2]); }); ...
ServiceWorkerRegistration - Web APIs
this is initially set to null.
...this is initially set to null.
...this is initially set to null.
... an active worker will control a serviceworkerclient if the client's url falls within the scope of the registration (the scope option set when serviceworkercontainer.register is first called.) serviceworkerregistration.navigationpreload read only returns the instance of navigationpreloadmanager associated with the current service worker registration.
Service Worker API - Web APIs
they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
...if successful, your service worker will be downloaded to the client and attempt installation/activation (see below) for urls accessed by the user inside the whole origin, or inside a subset specified by you.
... you can listen for the installevent; a standard action is to prepare your service worker for usage when this fires, for example by creating a cache using the built in storage api, and placing assets inside it that you'll want for running your app offline.
... receiving centralized updates to expensive-to-calculate data such as geolocation or gyroscope, so multiple pages can make use of one set of data.
ShadowRoot - Web APIs
you can retrieve a reference to an element's shadow root using its element.shadowroot property, provided it was created using element.attachshadow() with the mode option set to open.
... properties shadowroot.delegatesfocus read only returns a boolean that indicates whether delegatesfocus was set when the shadow was attached (see element.attachshadow()).
... shadowroot.innerhtml sets or returns a reference to the dom tree inside the shadowroot.
... documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node.
SourceBuffer - Web APIs
sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer.
... sourcebuffer.abort() aborts the current segment and resets the segment parser.
...this example was written by nick desaulniers and can be viewed live here (you can also download the source for further investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource(); //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasour...
...ce.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); } function fetchab (url, cb) { console.log(url); var xhr = new xmlhttprequest; xhr.open('get', url); xhr.responsetype = 'arraybuffer'; xhr.onload = function () { cb(xhr.response); }; xhr.send(); } specifications specification status ...
SpeechGrammar - Web APIs
the speechgrammar interface of the web speech api represents a set of words or patterns of words that we want the recognition service to recognize.
... properties speechgrammar.src sets and returns a string containing the grammar from within in the speechgrammar object instance.
... speechgrammar.weight optional sets and returns the weight of the speechgrammar object.
...llow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
Storage - Web APIs
WebAPIStorage
storage.setitem() when passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
...if it does, we run a function called setstyles() that grabs the data items using storage.getitem() and uses those values to update page styles.
... if it doesn't, we run another function, populatestorage(), which uses storage.setitem() to set the item values, then runs setstyles().
... if(!localstorage.getitem('bgcolor')) { populatestorage(); } setstyles(); function populatestorage() { localstorage.setitem('bgcolor', document.getelementbyid('bgcolor').value); localstorage.setitem('font', document.getelementbyid('font').value); localstorage.setitem('image', document.getelementbyid('image').value); } function setstyles() { var currentcolor = localstorage.getitem('bgcolor'); var currentfont = localstorage.getitem('font'); var currentimage = localstorage.getitem('image'); document.getelementbyid('bgcolor').value = currentcolor; document.getelementbyid('font').value = currentfont; document.getelementbyid('image').value = currentimage; htmlelem.style.backgroundcolor = '#' + currentcolor; pelem.style.fontfamily = currentfont; imgelem.setattribute('s...
TextRange - Web APIs
WebAPITextRange
textrange.htmltext gets or sets the html content within the textrange.
... textrange.text gets or sets the plaintext content within the textrange.
... textrange.setendpoint() sets the end point of the current range based on the bounds of other textrange.
...the example gets the textrange through document.selection, and sets the specified element to be selected.
Touch() - Web APIs
WebAPITouchTouch
"clientx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, excluding any scroll offset.
... "clienty", optional and defaulting to 0, of type double, that is the vertical position of the touch on the client window of the user's screen, excluding any scroll offset.
... "pagex", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, including any scroll offset.
... "pagey", optional and defaulting to 0, of type double, that is the vertical position of the touch on the client window of the user's screen, including any scroll offset.
Touch.clientX - Web APIs
WebAPITouchclientX
the touch.clientx read-only property returns the x coordinate of the touch point relative to the viewport, not including any scroll offset.
... syntax touchitem.clientx; return value a long representing the x coordinate of the touch point relative to the viewport, not including any scroll offset.
...the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset.
... the touch.clienty property is the vertical coordinate of the touch point relative to the browser's viewport excluding any scroll offset .
Touch.clientY - Web APIs
WebAPITouchclientY
the touch.clienty read-only property returns the y coordinate of the touch point relative to the browser's viewport, not including any scroll offset.
... syntax touchitem.clienty; return value a long value representing the y coordinate of the touch point relative to the viewport, not including any scroll offset.
...the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset.
... the touch.clienty property is the vertical coordinate of the touch point relative to the browser's viewport excluding any scroll offset .
Touch.pageX - Web APIs
WebAPITouchpageX
the touch.pagex read-only property returns the x coordinate of the touch point relative to the viewport, including any scroll offset.
... syntax touchitem.pagex; return value a long representing the x coordinate of the touch point relative to the viewport, including any scroll offset.
...the touch.pagex property is the horizontal coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset.
... the touch.pagey property is the vertical coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset.
Touch.pageY - Web APIs
WebAPITouchpageY
the touch.pagey read-only property returns the y coordinate of the touch point relative to the viewport, including any scroll offset.
... syntax touchitem.pagey; return value a long value that representes the y coordinate of the touch point relative to the viewport, including any scroll offset.
...the touch.pagex property is the horizontal coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset.
... the touch.pagey property is the vertical coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset.
TransformStream - Web APIs
the transformstream interface of the streams api represents a set of transformable data.
... async transform(chunk, controller) { chunk = await chunk switch (typeof chunk) { case 'object': // just say the stream is done i guess if (chunk === null) controller.terminate() else if (arraybuffer.isview(chunk)) controller.enqueue(new uint8array(chunk.buffer, chunk.byteoffset, chunk.bytelength)) else if (array.isarray(chunk) && chunk.every(value => typeof value === 'number')) controller.enqueue(new uint8array(chunk)) else if ('function' === typeof chunk.valueof && chunk.valueof() !== chunk) this.transform(chunk.valueof(), controller) // hack else if ('tojson' in chunk) this.transform(json.stringify(chunk), controller) ...
... const tes = { start(){this.encoder = new textencoder()}, transform(chunk, controller) { controller.enqueue(this.encoder.encode(chunk)) } } let _jstes_wm = new weakmap(); /* info holder */ class jstextencoderstream extends transformstream { constructor() { let t = {...tes} super(t) _jstes_wm.set(this, t) } get encoding() {return _jstes_wm.get(this).encoder.encoding} } similarly, textdecoderstream can be written as such: const tes = { start(){ this.decoder = new textdecoder(this.encoding, this.options) }, transform(chunk, controller) { controller.enqueue(this.decoder.decode(chunk)) } } let _jstds_wm = new weakmap(); /* info holder */ class jstextdecoderstream extend...
...s transformstream { constructor(encoding = 'utf-8', {...options} = {}) { let t = {...tds, encoding, options} super(t) _jstes_wm.set(this, t) } get encoding() {return _jstds_wm.get(this).decoder.encoding} get fatal() {return _jstds_wm.get(this).decoder.fatal} get ignorebom() {return _jstds_wm.get(this).decoder.ignorebom} } chaining multiple readablestreams together this is a useful one, where multiple streams can be conjoined.
USBAlternateInterface - Web APIs
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.
... properties usbalternateinterface.alternatesettingread only returns the alternate setting number of this interface.
... this is equal to the balternatesetting field of the interface descriptor defining this interface.
VTTRegion - Web APIs
WebAPIVTTRegion
vttregion.regionanchorx a double representing the region anchor x offset, as a percentage of the region.
... vttregion.regionanchory a double representing the region anchor y offset, as a percentage of the region.
... vttregion.viewportanchorx a double representing the viewport anchor x offset, as a percentage of the video.
... vttregion.viewportanchory a double representing the viewport anchor y offset, as a percentage of the video.
WebGL2RenderingContext.copyTexSubImage3D() - Web APIs
syntax void gl.copytexsubimage3d(target, level, xoffset, yoffset, zoffset, x, y, width, height); parameters target a glenum specifying the binding point (target) of the active texture.
... xoffset a glint specifying the x offset within the texture image.
... yoffset a glint specifying the y offset within the texture image.
... zoffset a glint specifying the z offset within the texture image.
WebGL2RenderingContext.getBufferSubData() - Web APIs
syntax void gl.getbuffersubdata(target, srcbyteoffset, arraybufferview dstdata, optional dstoffset, optional length); parameters target a glenum specifying the binding point (target).
... srcbyteoffset a glintptr specifying the byte offset from which to start reading from the buffer.
... srcoffset optional a gluint specifying the element index offset where to start reading the buffer.
... exceptions an invalid_value error is generated if: offset + returneddata.bytelength would extend beyond the end of the buffer returneddata is null offset is less than zero.
WebGL2RenderingContext - Web APIs
webgl2renderingcontext.buffersubdata() updates a subset of a buffer object's data store.
...in addition, it can execute multiple instances of a set of elements.
... webgl2renderingcontext.samplerparameter[if]() sets sampler parameters.
... webgl2renderingcontext.pausetransformfeedback() pauses a transform feedback operation.
WebGLRenderingContext.bufferSubData() - Web APIs
the webglrenderingcontext.buffersubdata() method of the webgl api updates a subset of a buffer object's data store.
... syntax // webgl1: void gl.buffersubdata(target, offset, arraybuffer srcdata); void gl.buffersubdata(target, offset, arraybufferview srcdata); // webgl2: void gl.buffersubdata(target, dstbyteoffset, arraybufferview srcdata, srcoffset, length); parameters target a glenum specifying the binding point (target).
... dstbyteoffset a glintptr specifying an offset in bytes where the data replacement will start.
... srcoffset a gluint specifying the element index offset where to start reading the buffer.
WebGLRenderingContext.getParameter() - Web APIs
exture_image_units glint gl.max_texture_size glint gl.max_varying_vectors glint gl.max_vertex_attribs glint gl.max_vertex_texture_image_units glint gl.max_vertex_uniform_vectors glint gl.max_viewport_dims int32array (with 2 elements) gl.pack_alignment glint gl.polygon_offset_factor glfloat gl.polygon_offset_fill glboolean gl.polygon_offset_units glfloat gl.red_bits glint gl.renderbuffer_binding webglrenderbuffer or null see bindrenderbuffer.
...onents glint64 gl.max_draw_buffers glint gl.max_element_index glint64 gl.max_elements_indices glint gl.max_elements_vertices glint gl.max_fragment_input_components glint gl.max_fragment_uniform_blocks glint gl.max_fragment_uniform_components glint gl.max_program_texel_offset glint gl.max_samples glint gl.max_server_wait_timeout glint64 gl.max_texture_lod_bias glfloat gl.max_transform_feedback_interleaved_components glint gl.max_transform_feedback_separate_attribs glint gl.max_transform_feedback_separate_components glint gl.max_uniform_block_size glint64 ...
... gl.max_uniform_buffer_bindings glint gl.max_varying_components glint gl.max_vertex_output_components glint gl.max_vertex_uniform_blocks glint gl.max_vertex_uniform_components glint gl.min_program_texel_offset glint gl.pack_row_length glint see pixelstorei.
... gl.uniform_buffer_offset_alignment glint see pixelstorei.
WebGLRenderingContext.texImage2D() - Web APIs
pixels); // webgl2: void gl.teximage2d(target, level, internalformat, width, height, border, format, type, glintptr offset); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, htmlcanvaselement source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, htmlimageelement source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, htmlvideoelement source); void gl.teximage2d(target, level, internalformat, width, ...
...height, border, format, type, imagebitmap source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, imagedata source); void gl.teximage2d(target, level, internalformat, width, height, border, format, type, arraybufferview srcdata, srcoffset); parameters target a glenum specifying the binding point (target) of the active texture.
... 4 2 rgba unsigned_short_5_5_5_1 4 2 rgb unsigned_short_5_6_5 3 2 luminance_alpha unsigned_byte 2 2 luminance unsigned_byte 1 1 alpha unsigned_byte 1 1 other possible values in webgl2 for the versions of teximage2d that take an arraybufferview or a glintptr offset sized format base format r bits g bits b bits a bits shared bits color renderable texture filterable r8 red 8 ● ● r8_snorm red s8 ● rg8 rg 8 8 ● ● rg8_snorm rg s8 s8 ...
... offset (webgl 2 only) a glintptr byte offset into the webglbuffer's data store.
Clearing by clicking - Web APIs
ml5 canvas.</canvas> <button id="color-switcher">press here to switch color</button> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : inline-block; font-size : inherit; margin : auto; padding : 0.6em; } window.addeventlistener("load", function setupwebgl (evt) { "use strict" // cleaning after ourselves.
... window.removeeventlistener(evt.type, setupwebgl, false); // adding the same click event handler to both canvas and // button.
... var color = getrandomcolor(); // set the clear color to the random color.
... gl.clearcolor(color[0], color[1], color[2], 1.0); // clear the context with the newly set color.
Raining rectangles - Web APIs
vas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } ;(function(){ "use strict" window.addeventlistener("load", setupanimation, false); var gl, timer, rainingrect, scoredisplay, missesdisplay; function setupanimation (evt) { window.removeeventlistener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); rainingrect = new rectangle(); timer = settimeout(drawanimation, 17); document.queryselector("canvas") .addeventlistener("click...
...ar score = 0, misses = 0; function drawanimation () { gl.scissor(rainingrect.position[0], rainingrect.position[1], rainingrect.size[0] , rainingrect.size[1]); gl.clear(gl.color_buffer_bit); rainingrect.position[1] -= rainingrect.velocity; if (rainingrect.position[1] < 0) { misses += 1; missesdisplay.innerhtml = misses; rainingrect = new rectangle(); } // we are using settimeout for animation.
... timer = settimeout(drawanimation, 17); } function playerclick (evt) { // we need to transform the position of the click event from // window coordinates to relative position inside the canvas.
... var position = [ evt.pagex - evt.target.offsetleft, gl.drawingbufferheight - (evt.pagey - evt.target.offsettop), ]; // if the click falls inside the rectangle, we caught it.
Lifetime of a WebRTC session - Web APIs
information exchanged during signaling there are three basic types of information that need to be exchanged during signaling: control messages used to set up, open, and close the communication channel, and to handle errors.
... information needed in order to set up the connection: the ip addressing and port information needed for the peers to be able to talk to one another.
... note: different browsers support ice restart under different sets of conditions.
... if you need to change the configuration of the connection in some way (such as changing to a different set of ice servers), you can do so before restarting ice by calling rtcpeerconnection.setconfiguration() with an updated rtcconfiguration dictionary before restarting ice.
Basic concepts behind Web Audio API - Web APIs
a frame, or sample frame, is the set of all values for all channels that will play at a specific point in time: all the samples of all the channels that play at the same time (two for a stereo sound, six for 5.1, etc.) the sample rate is the number of those samples (or frames, since all samples of a frame play at the same time) that will play in one second, measured in hz.
... audio channels different audio buffers contain different numbers of channels: from the more basic mono (only one channel) and stereo (left and right channels), to more complex sets like quad and 5.1, which have different sound samples contained in each channel, leading to a richer sound experience.
...this can be somewhat controlled by setting the audionode.channelinterpretation property to speakers or discrete: interpretation input channels output channels mixing rules speakers 1 (mono) 2 (stereo) up-mix from mono to stereo.
... output.l = input.l + 0.7071 * input.c output.r = input.r + 0.7071 * input.c output.sl = input.sl output.sr = input.sr other, non-standard layouts non-standard channel layouts are handled as if channelinterpretation is set to discrete.
Web Audio API - Web APIs
it can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern.
... audiobuffer the audiobuffer interface represents a short audio asset residing in memory, created from an audio file using the audiocontext.decodeaudiodata() method, or created with raw data using audiocontext.createbuffer().
... channelsplitternode the channelsplitternode interface separates the different channels of an audio source out into a set of mono outputs.
...pithis article explains some of the audio theory behind how the features of the web audio api work, to help you make informed decisions while designing how audio is routed through your app.controlling multiple parameters with constantsourcenodethis article demonstrates how to use a constantsourcenode to link multiple parameters together so they share the same value, which can be changed by simply setting the value of the constantsourcenode.offset parameter.example and tutorial: simple synth keyboardthis article presents the code and working demo of a video keyboard you can play using the mouse.
Window.customElements - Web APIs
54edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true).
... full support 54firefox android full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.customelements.enabled preference (needs to be set to true).
...— 59disabled disabled until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true) and the dom.webcomponents.customelements.enabled preference (needs to be set to true).
Window.openDialog() - Web APIs
WebAPIWindowopenDialog
opendialog() treats the absence of the features parameter the same way window.open() does; that is, an empty string sets all features to off) except chrome and dialog, which default to on.
...you can then access this object from within the dialog code and set properties on it, containing the values you want to return or preserve past the window.close() operation.
... var retvals = { address: null, delivery: null }; opendialog("http://example.tld/zzz.xul", "dlg", "modal", "pizza", 6.98, retvals); if you set the properties of the retvals object in the dialog code as described below, you can now access them via the retvals array after the opendialog() call returns.
... inside the dialog code, you can set the properties as follows: var retvals = window.arguments[2]; retvals.address = enteredaddress; retvals.delivery = "immediate"; specification this is not part of any specification.
Window.scrollX - Web APIs
WebAPIWindowscrollX
if (window.scrollx > 400) { window.scroll(0,0); } notes the pagexoffset property is an alias for the scrollx property: window.pagexoffset == window.scrollx; // always true for cross-browser compatibility, use window.pagexoffset instead of window.scrollx.
...a fully compatible example: var x = (window.pagexoffset !== undefined) ?
... window.pagexoffset : (document.documentelement || document.body.parentnode || document.body).scrollleft; var y = (window.pageyoffset !== undefined) ?
... window.pageyoffset : (document.documentelement || document.body.parentnode || document.body).scrolltop; specification specification status comment css object model (cssom) view modulethe definition of 'window.scrollx' in that specification.
WindowOrWorkerGlobalScope.clearInterval() - Web APIs
the clearinterval() method of the windoworworkerglobalscope mixin cancels a timed, repeating action which was previously established by a call to setinterval().
...this id was returned by the corresponding call to setinterval().
... it's worth noting that the pool of ids used by setinterval() and settimeout() are shared, which means you can technically use clearinterval() and cleartimeout() interchangeably.
... return value undefined example see the setinterval() examples.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
the cleartimeout() method of the windoworworkerglobalscope mixin cancels a timeout previously established by calling settimeout().
...this id was returned by the corresponding call to settimeout().
... it's worth noting that the pool of ids used by settimeout() and setinterval() are shared, which means you can technically use cleartimeout() and clearinterval() interchangeably.
... var alarm = { remind: function(amessage) { alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.cancel(); } this.timeoutid = window.settimeout(function(msg) { this.remind(msg); }.bind(this), 1000, 'wake up!'); }, cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown.
XDomainRequest - Web APIs
properties xdomainrequest.timeout gets or sets the amount of time until a request times out.
... xdomainrequest.responsetext gets the response body as a string.
... example if(window.xdomainrequest){ var xdr = new xdomainrequest(); xdr.open("get", "http://example.com/api/method"); xdr.onprogress = function () { //progress }; xdr.ontimeout = function () { //timeout }; xdr.onerror = function () { //error occurred }; xdr.onload = function() { //success(xdr.responsetext); } settimeout(function () { xdr.send(); }, 0); } note: the xdr.send() call is wrapped in a timeout (see window.settimeout() to prevent an issue with the interface where some requests are lost if multiple xdomainrequests are being sent at the same time.
... the requested url's server must have the access-control-allow-origin header set to either all ("*") or to include the origin of the request.
XMLHttpRequest.withCredentials - Web APIs
setting withcredentials has no effect on same-site requests.
...xmlhttprequest from a different domain cannot set cookie values for their own domain unless withcredentials is set to true before making the request.
... the third-party cookies obtained by setting withcredentials to true will still honor same-origin policy and hence can not be accessed by the requesting script through document.cookie or from response headers.
... note: xmlhttprequest responses from a different domain cannot set cookie values for their own domain unless withcredentials is set to true before making the request, regardless of access-control- header values.
XRInputSourcesChangeEvent - Web APIs
the webxr device api interface xrinputsourceschangeevent is used to represent the inputsourceschange event sent to an xrsession when the set of available webxr input controllers changes.
... event types inputsourceschange delivered to the xrsession when the set of input devices available to it changes.
... examples the following example shows how to set up an event handler which uses inputsourceschange events to detect newly-available pointing devices and to load their models in preparation to display them in the next animation frame.
... xrsession.addeventlistener("inputsourceschange", oninputsourceschange); function oninputsourceschange(event) { for (let input of event.added) { if (input.targetraymode == "tracked-pointer") { loadcontrollermesh(input); } } } you can also add a handler for inputsourceschange events by setting the oninputsourceschange event handler: xrsession.oninputsourceschange = oninputsourceschange; specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeevent' in that specification.
XRReferenceSpaceEvent.transform - Web APIs
usage notes upon receiving a reset event, you can apply the transform to cached position or orientation information to shift them into the updated coordinate system.
... for details on what causes a reset event and how to respond, see the reset event's documentation.
... examples this example handles the reset event by walking through all the objects in a scene, updating each object's position by multiplying it with the event's given transform.
... xrreferencespace.addeventlistener("reset", event => { for (let obj of scene.objects) { mat4.multiply(obj.transform, obj.transform, event.transform); } }); specifications specification status comment webxr device apithe definition of 'xrreferencespaceevent.transform' in that specification.
XRReferenceSpaceEventInit - Web APIs
since the properties are read-only, this is the only opportunity available to set their values.
... usage notes all of this dictionary's properties must have valid values set on them before calling the xrreferencespaceevent() constructor.
... examples this simple snippet calls the constructor to create a new reference space event of type reset.
... let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr device apithe definition of 'xrreferencespaceeventinit' in that specification.
XRRigidTransform - Web APIs
xrrigidtransform is used to specify transforms throughout the webxr apis, including: the offset and orientation relative to the parent reference space to use when creating a new reference space with getoffsetreferencespace().
... the xrreferencespaceevent event's transform property, as found in the reset event received by an xrreferencespace.
... example this code snippet creates an xrrigidtransform to specify the offset and orientation in relation to the current reference space to use when creating a new reference space.
... xrsession.requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(viewerstartposition, cubeorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); specifications specification status comment webxr device apithe definition of 'xrrigidtransform' in that specification.
XRView - Web APIs
WebAPIXRView
usage notes positions and number of xrviews per frame while rendering a scene, the set of views that are used to render the scene for the viewer as of the current frame are obtained by calling the xrframe object's getviewerpose() method to get the xrviewerpose representing (in essence) the position of the viewer's head.
...the createteleporttransform() function returns the transform needed to move and rotate an object whose current situation is described by the reference space refspace to a new position and orientation which is computed using previously recorded mouse and keyboard input data which has generated offsets for yaw, pitch, and position along all three axes.
... return refspace.getoffsetreferencespace(newtransform); } this code is broken into four sections.
... the third section creates the new xrrigidtransform, specifying a point providing the offsets along the three axes as the first parameter, and the orientation quaternion as the second parameter.
XRViewport - Web APIs
x read only the offset from the origin of the destination graphics surface (typically a xrwebgllayer) to the left edge of the viewport, in pixels.
... y read only the offset from the origin of the viewport to the bottom edge of the viewport; webgl's coordinate system places (0, 0) at the bottom left corner of the surface.
... these values may be passed directly into the webglrenderingcontext.viewport() method: let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); example this example sets up an animation frame callback using requestanimationframe().
... after initial setup, it iterates over each of the views within the viewer's pose, configuring the viewport as dictated by the xrwebgllayer.
XRWebGLLayer.ignoreDepthValues - Web APIs
the value of ignoredepthvalues can only be set when the xrwebgllayer is instantiated, by setting the corresponding value in the xrwebgllayerinit object specified as the constructor's layerinit parameter.
... as a parameter you're likely to set yourself, it is unlikely you'll need to read it later, but it's available if the need arises.
...since the xr compositor uses the depth buffer by default, this value is false unless explicitly set otherwise when creating the xrwebgllayer using its constructor, xrwebgllayer().
... examples if the web application which is using wexr is rendering its content without using a depth buffer—or if the depth buffer's contents are invalid—you should disable the use of the depth buffer for webxr rendering by setting ignoredepthvalues to true when creating the xrwebgllayer.
ARIA: document role - Accessibility
because ats with reading mode default to that mode for all elements except for those with a widget or application role set, document role is only useful for focusable elements within a widget or application that should be read as static rich text.
... keyboard interactions the element should be made focusable by setting the tabindex="0" attribute / value pair on it.
...however, when the keyboard focus is set on the starting heading on a single conversation that contains the subject of the conversation, the screen reader user can use the reading mode commands to read through the messages, expand or collapse them, and manipulate them.
... best practices always make sure an item with the document role is focusable, by setting the tabindex attribute with a value of 0.
ARIA: row role - Accessibility
for example, in a table with 15 columns, and columns 4, 5, and 6 are in the dom, aria-colindex="4" could be set on every row.
... if the set of columns which is present in the dom is not contiguous, or if there are cells spanning more than one row or column, put the aria-colindex on all of the children of each row instead of on the row itself.
...for example, if a table has 1,500 rows, but only the header and rows 47 and 52 are in the dom, aria-rowindex="1" would be set on the header row, and aria-rowindex="47" and aria-rowindex="52" would be set on the 47th and 52nd row, respectively.
...the aria roles are only necessary if the native semantics of the table, and therefore the table rows, are obliterated, such as via setting the display property to flex or grid.
Basic form hints - Accessibility
note that on line 3, the <ul> element sets the aria-labelledby attribute to rg1_label, the id of the <h3> element on line 1, which is the label for the radio group.
...on lines 4 and 12, the aria-required attributes are set to true (in addition to the asterisks next to the labels), indicating that the name and email fields are required.
... the second part of the example, a snippet of javascript validates the email format, and sets the aria-invalid attribute of the email field (line 12 of the html) according to the result (in addition to changing the presentation of the element).
... <div> <label for="email">* e-mail:</label> <input type="text" value="email" id="email" aria-required="true"/> </div> </form> the script that validates the form entry would look something like this: var validate = function () { var emailelement = document.getelementbyid(emailfieldid); var valid = emailvalid(formdata.email); // returns true if valid, false otherwise emailelement.setattribute("aria-invalid", !valid); setelementbordercolour(emailelement, valid); // sets the border to red if second arg is false }; providing helpful error messages read how to use aria alerts to enhance forms.
ARIA - Accessibility
accessible rich internet applications (aria) is a set of attributes that define ways to make web content and web applications (especially those developed with javascript) more accessible to people with disabilities.
...var progressbar = document.getelementbyid("percent-loaded"); // set its aria roles and states, // so that assistive technologies know what kind of widget it is.
... progressbar.setattribute("role", "progressbar"); progressbar.setattribute("aria-valuemin", 0); progressbar.setattribute("aria-valuemax", 100); // create a function that can be called at any time to update // the value of the progress bar.
... function updateprogress(percentcomplete) { progressbar.setattribute("aria-valuenow", percentcomplete); } note that aria was invented after html4, so does not validate in html4 or its xhtml variants.
Cognitive accessibility - Accessibility
though there is a lot of diversity within clinical definitions of cognitive impairments, people with them experience a common set of functional problems.
...guideline 2.2 states "provide users enough time to read and use content." a time limit is any process that happens without user initiation after a set time or on a periodic basis, such as being logged out after 30 minutes or having 15 minutes to make a purchase.
... change setting based on an active request form control operation and data entry should result in predictable behavior.
...include labels or instructions when users need to input information, using the <label>, <fieldset>, and <legend> elements to do so.
Web accessibility for seizures and physical reactions - Accessibility
a <div> element set to change color and luminosity at high frequency, easily done via javascript, can cause real harm.
...the epilepsy foundation's article "take advantage of media queries with <style> in setting up media queries, you are enabling controls by the user; these controls are made available in the browser or in the os.
... developmental & experimental features mdn navigator​.donottrack from the documentation: "returns the user's do-not-track setting.
...s draft document, media queries level 5 section on light-level: "the light-level media feature is used to query about the ambient light-level in which the device is used, to allow the author to adjust style of the document in response." this will be a godsend to those who have motor-skills problems, or for some with cognitive difficulties, who cannot find the right "button" to change their screen settings.
-webkit-box-reflect - CSS: Cascading Style Sheets
/* direction values */ -webkit-box-reflect: above; -webkit-box-reflect: below; -webkit-box-reflect: left; -webkit-box-reflect: right; /* offset value */ -webkit-box-reflect: below 10px; /* mask value */ -webkit-box-reflect: below 0 linear-gradient(transparent, white); /* global values */ -webkit-box-reflect: inherit; -webkit-box-reflect: initial; -webkit-box-reflect: unset; note: this feature is not intended to be used by web sites.
...<image>?where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
-webkit-line-clamp - CSS: Cascading Style Sheets
it only works in combination with the display property set to -webkit-box or -webkit-inline-box and the -webkit-box-orient property set to vertical.
... in most cases you will also want to set overflow to hidden, otherwise the contents won't be clipped but an ellipsis will still be shown after the specified number of lines.
... syntax /* keyword value */ -webkit-line-clamp: none; /* <integer> values */ -webkit-line-clamp: 3; -webkit-line-clamp: 10; /* global values */ -webkit-line-clamp: inherit; -webkit-line-clamp: initial; -webkit-line-clamp: unset; none this value specifies that the content wonʼt be clamped.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax none | <integer> examples truncating a paragraph html <p> in this example the <code>-webkit-line-clamp</code> property is set to <code>3</code>, which means the text is clamped after three lines.
-webkit-mask-box-image - CSS: Cascading Style Sheets
-webkit-mask-box-image sets the mask image for an element's border box.
... <length> the size of the mask image's offset.
... <percentage> the mask image's offset has a percentage value relative to the border box's corresponding dimension (width or height).
... examples setting an image .exampleone { -webkit-mask-box-image: url('mask.png'); } offsetting and filling an image .exampletwo { -webkit-mask-box-image: url('logo.png') 100 100 0 0 round round; } specifications not part of any standard.
:scope - CSS: Cascading Style Sheets
WebCSS:scope
<style scoped> made it possible to explicitly set up element scopes, but ongoing discussions about the design of this feature as well as lack of other implementations resulted in the decision to remove it.
... no support 20 — 32disabled disabled from version 20 until version 32 (exclusive): this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true).
...<style scoped> made it possible to explicitly set up element scopes, but ongoing discussions about the design of this feature as well as lack of other implementations resulted in the decision to remove it.
... full support 20disabled disabled from version 20: this feature is behind the layout.css.scope-pseudo.enabled preference (needs to be set to true).
suffix - CSS: Cascading Style Sheets
" (full stop followed by a space)computed valueas specified formal syntax <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
... <number> | <angle><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples setting a suffix for a counter html <ul class="choices"> <li>one</li> <li>two</li> <li>three</li> <li>none of the above</li> </ul> css @counter-style options { system: fixed; symbols: a b c d; suffix: ") "; } .choices { list-style: options; } result specifications specification status comment css counter styles level 3the definition of 'suffix' in...
symbols - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial valuen/acomputed valueas specified formal syntax <symbol>+where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
... <number> | <angle><linear-color-stop> = <color> <color-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples setting counter symbols html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style symbols-example { system: fixed; symbols: a "1" "\24b7" d e; } .list { list-style: symbols-example; } result specifications specification status comment css counter styles level 3the definition of 'symbols' i...
font-weight - CSS: Cascading Style Sheets
the font-weight property can separately be used to set how thick or thin characters in text should be displayed.
... 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.
... accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio.
...understanding wcag 2.0 formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax <font-weight-absolute>{1,2}where <font-weight-absolute> = normal | bold | <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> examples setting normal font weight in a @font-face rule the following finds a local open sans font or import it, and allows using the font for normal font weights.
@supports - CSS: Cascading Style Sheets
WebCSS@supports
28edge full support 12firefox full support 22 full support 22 no support 17 — 22disabled disabled from version 17 until version 22 (exclusive): this feature is behind the layout.css.supports-rule.enabled preference (needs to be set to true).
...android full support 28firefox android full support 22 full support 22 no support 17 — 22disabled disabled from version 17 until version 22 (exclusive): this feature is behind the layout.css.supports-rule.enabled preference (needs to be set to true).
... 83edge full support 83firefox full support 69 full support 69 full support 64disabled disabled from version 64: this feature is behind the layout.css.supports-selector.enabled preference (needs to be set to true).
... full support 83chrome android full support 83firefox android full support 64disabled full support 64disabled disabled from version 64: this feature is behind the layout.css.supports-selector.enabled preference (needs to be set to true).
height - CSS: Cascading Style Sheets
WebCSS@viewportheight
the height css descriptor is a shorthand descriptor for setting both min-height and max-height of the viewport.
... by providing one viewport length value will set both, the minimum height and the maximum height, to the value provided.
... if two viewport values are provided, the first value will set the minimum height and the second value will set the maximum height.
...tely positioned, the percentage value is treated as none.computed valueas each of the properties of the shorthand:min-height: the percentage as specified or the absolute lengthmax-height: the percentage as specified or the absolute length or none formal syntax <viewport-length>{1,2}where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting minimum and maximum height @viewport { height: 500px; } specifications specification status comment css device adaptationthe definition of '"height" descriptor' in that specification.
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right.
... absolutely positioned elements the alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right.
... alignment of blocks horizontally prior to flexbox was typically achieved by way of setting auto margins on the block.
... a margin of auto will absorb all available space in that dimension, therefore setting a left and right margin of auto, you can push a block into the center: .container { width: 20em; margin-left: auto; margin-right: auto; } in table layout, you have access to the vertical-align property to align the contents of a cell inside that cell.
Spanning and Balancing Columns - CSS: Cascading Style Sheets
in the example below, the h2 element is set to column-span: all and spans all of the columns.
... when a spanner is introduced, it breaks the flow of columns and columns restart after the spanner, effectively creating a new set of column boxes.
... column filling and balancing a balanced set of columns is where all columns have approximately the same amount of content.
...this means that on the last page the final set of column boxes will be balanced.
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
the scroll-snap-align property must be used on child elements in order to set the position that scrolling will snap to.
... padding the scroll container if you do not want the content to snap right to the edge of the scroll container you can use the scroll-padding property or its equivalent longhand values to set some padding.
... in the below example i have set scroll-padding to 40 pixels.
... margins on scroll children the scroll-margin property can be set set on child elements, essentially defining an outset from the defined box.
Shapes From Images - CSS: Cascading Style Sheets
the shape-image-threshold property is used to set a threshold for this opacity.
... setting a threshold the shape-image-threshold property enables the creation of shapes from areas which are not fully transparent.
...values in between mean that you can set a semi-transparent area as the defining area.
...if i set shape-image-threshold to 0.3 then i see the shape, if i set it to something smaller than 0.2 i do not get the shape.
Animatable CSS properties - CSS: Cascading Style Sheets
border border-block-end border-block-end-color border-block-end-width border-block-start border-block-start-color border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-width border-color border-end-end-radius border-end-start-radius border-image-outset border-image-slice border-image-width border-inline-end border-inline-end-color border-inline-end-width border-inline-start border-inline-start-color border-inline-start-width border-left border-left-color border-left-width border-radius border-right border-right-color border-right-width border-start-end-radius b...
... border-top-width border-width bottom box-shadow caret-color clip clip-path color column-count column-gap column-rule column-rule-color column-rule-width column-width columns filter flex flex-basis flex-grow flex-shrink font font-size font-size-adjust font-stretch font-variation-settings font-weight gap grid-column-gap grid-gap grid-row-gap grid-template-columns grid-template-rows height inline-size inset inset-block inset-block-end inset-block-start inset-inline inset-inline-end inset-inline-start left letter-spacing line-clamp line-height margin margin-block-end ...
... margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top mask mask-border mask-position mask-size max-block-size max-height max-inline-size max-lines max-width min-block-size min-height min-inline-size min-width object-position offset offset-anchor offset-distance offset-path offset-position offset-rotate opacity order outline outline-color outline-offset outline-width padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top perspective perspective...
...-padding-left scroll-padding-right scroll-padding-top scroll-snap-coordinate scroll-snap-destination scrollbar-color shape-image-threshold shape-margin shape-outside tab-size text-decoration text-decoration-color text-decoration-thickness text-emphasis text-emphasis-color text-indent text-shadow text-underline-offset top transform transform-origin translate vertical-align visibility width word-spacing z-index zoom ...
Sticky footers - CSS: Cascading Style Sheets
the recipe download this example note: in this example and the following one we are using a wrapper set to min-height: 100% in order that our live example works.
... you could also achieve this for a full page by setting a min-height of 100vh on the <body> and then using it as your grid container.
... the flexbox example starts out in the same way, but we use display:flex rather than display:grid on the .wrapper; we also set flex-direction to column.
... then we set our main content to flex-grow: 1 and the other two elements to flex-shrink: 0 — this prevents them from shrinking smaller when content fills the main area.
Viewport concepts - CSS: Cascading Style Sheets
you can set any height and width on an iframe, but the whole document may not be visible.
... iframe { width: 50vw; } if the iframe is set to 50vw, it will be 50% of the width of the 1200px parent document in our example above, or 600px, with 1vw being 6px.
...you can set any height and width on an svg, but the whole image might not be visible.
...it should preferably be set to device-width, which is the width of the screen in css pixels at a scale of 100%.
align-content - CSS: Cascading Style Sheets
the css align-content property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis.
... items have equal space around them */ align-content: stretch; /* distribute items evenly stretch 'auto'-sized items to fit the container */ /* overflow alignment */ align-content: safe center; align-content: unsafe center; /* global values */ align-content: inherit; align-content: initial; align-content: unset; values start the items are packed flush to each other against the start edge of the alignment container in the cross axis.
... normal the items are packed in their default position as if no align-content value was set.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
animation-fill-mode - CSS: Cascading Style Sheets
the animation-fill-mode css property sets how a css animation applies styles to its target before and after its execution.
... it is often convenient to use the shorthand property animation to set all animation properties at once.
... forwards the target will retain the computed values set by the last keyframe encountered during execution.
...for more information, see setting multiple animation property values.
animation-name - CSS: Cascading Style Sheets
it is often convenient to use the shorthand property animation to set all animation properties at once.
... syntax /* single animation */ animation-name: none; animation-name: test_05; animation-name: -specific; animation-name: sliding-vertically; /* multiple animations */ animation-name: test1, animation4; animation-name: none, -moz-specific, sliding; /* global values */ animation-name: initial animation-name: inherit animation-name: unset values none a special keyword denoting no keyframes.
...furthermore, the identifier can't be none, unset, initial, or inherit.
...for more information, see setting multiple animation property values.
animation-timing-function - CSS: Cascading Style Sheets
the animation-timing-function css property sets how an animation progresses through the duration of each cycle.
... it is often convenient to use the shorthand property animation to set all animation properties at once.
...iming-function: steps(20, jump-none); animation-timing-function: steps(5, jump-both); animation-timing-function: steps(6, start); animation-timing-function: steps(8, end); /* multiple animations */ animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); /* global values */ animation-timing-function: inherit; animation-timing-function: initial; animation-timing-function: unset; timing functions may be specified on individual keyframes in a @keyframes rule.
...for more information, see setting multiple animation property values.
animation - CSS: Cascading Style Sheets
WebCSSanimation
iv> </div> </div> </div> </div> html,body { height: 100%; box-sizing: border-box; } pre { margin-bottom: 0; } svg { width: 1.5em; height: 1.5em; } button { width: 27px; height: 27px; background-size: 16px; background-position: center; background-repeat: no-repeat; border-radius: 3px; cursor: pointer; } button.play { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e...
...%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#play'); } button.pause { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2...
...c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#pause'); } button.restart { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#restart'); } .grid { width: 100%; height: 10...
...function playpause (i) { var btn = button[i]; var anim = animation[i]; if (btn.classlist.contains('play')) { anim.style.animationplaystate = 'running'; togglebutton(btn, 'pause'); } else if (btn.classlist.contains('pause')) { anim.style.animationplaystate = 'paused'; togglebutton(btn, 'play'); } else { anim.classlist.remove('a' + (i + 1)); settimeout(function () { togglebutton(btn, i === 0 ?
aspect-ratio - CSS: Cascading Style Sheets
the aspect-ratio css property sets a preferred aspect ratio for the box, which will be used in the calculation of auto sizes and some other layout functions.
... syntax aspect-ratio: 1 / 1; /* global values */ aspect-ratio: inherit; aspect-ratio: initial; aspect-ratio: unset; values <auto> replaced elements with an intrinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio.
...es partial support 71notes notes firefox 71 adds internal support only for mapped values no support 69 — 71notes disabled notes firefox 69 adds internal support only for mapped valuesdisabled from version 69 until version 71 (exclusive): this feature is behind the layout.css.width-and-height-map-to-aspect-ratio.enabled preference (needs to be set to true).
... full support 79firefox full support 71 full support 71 no support 69 — 71disabled disabled from version 69 until version 71 (exclusive): this feature is behind the layout.css.width-and-height-map-to-aspect-ratio.enabled preference (needs to be set to true).
background-image - CSS: Cascading Style Sheets
the background-image css property sets one or more background images on an element.
...it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax <bg-image>#where <bg-image> = none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
border-bottom-style - CSS: Cascading Style Sheets
the border-bottom-style css property sets the line style of an element's bottom border.
... syntax /* keyword values */ border-bottom-style: none; border-bottom-style: hidden; border-bottom-style: dotted; border-bottom-style: dashed; border-bottom-style: solid; border-bottom-style: double; border-bottom-style: groove; border-bottom-style: ridge; border-bottom-style: inset; border-bottom-style: outset; /* global values */ border-bottom-style: inherit; border-bottom-style: initial; border-bottom-style: unset; the border-bottom-style property is specified as a single keyword chosen from those available for the border-style property.
...it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples demonstrating all border styles html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 3px; background-color: #52e385; } ...
...tr, td { padding: 3px; } /* border-bottom-style example classes */ .b1 {border-bottom-style: none;} .b2 {border-bottom-style: hidden;} .b3 {border-bottom-style: dotted;} .b4 {border-bottom-style: dashed;} .b5 {border-bottom-style: solid;} .b6 {border-bottom-style: double;} .b7 {border-bottom-style: groove;} .b8 {border-bottom-style: ridge;} .b9 {border-bottom-style: inset;} .b10 {border-bottom-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-bottom-style' in that specification.
border-color - CSS: Cascading Style Sheets
the border-color shorthand css property sets the color of an element's border.
... each side can be set individually using border-top-color, border-right-color, border-bottom-color, and border-left-color; or using the writing mode-aware border-block-start-color, border-block-end-color, border-inline-start-color, and border-inline-end-color.
...m-color border-left-color border-right-color border-top-color syntax /* <color> values */ border-color: red; /* horizontal | vertical */ border-color: red #f015ca; /* top | vertical | bottom */ border-color: red rgb(240,30,50,.7) green; /* top | right | bottom | left */ border-color: red yellow green blue; /* global values */ border-color: inherit; border-color: initial; border-color: unset; the border-color property may be specified using one, two, three, or four values.
...<li><code>border-top-color: red;</code></li> <li><code>border-right-color: cyan;</code></li> <li><code>border-bottom-color: black;</code></li> <li><code>border-left-color: gold;</code></li> </ul> </div> css #justone { border-color: red; } #horzvert { border-color: gold red; } #topvertbott { border-color: red cyan gold; } #trbl { border-color: red cyan black gold; } /* set width and style for all divs */ div { border: solid 0.3em; width: auto; margin: 0.5em; padding: 0.5em; } ul { margin: 0; list-style: none; } result specifications specification status comment css logical properties and values level 1 editor's draft added the logical keyword.
border-image-width - CSS: Cascading Style Sheets
the border-image-width css property sets the width of an element's border image.
...: 1rem; /* <percentage> value */ border-image-width: 25%; /* <number> value */ border-image-width: 3; /* vertical | horizontal */ border-image-width: 2em 3em; /* top | horizontal | bottom */ border-image-width: 5% 15% 10%; /* top | right | bottom | left */ border-image-width: 5% 2em 10% auto; /* global values */ border-image-width: inherit; border-image-width: initial; border-image-width: unset; the border-image-width property may be specified using one, two, three, or four values chosen from the list of values below.
...percentages are relative to the width of the border image area for horizontal offsets and the height of the border image area for vertical offsets.
... html <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
border-left-style - CSS: Cascading Style Sheets
the border-left-style css property sets the line style of an element's left border.
... syntax /* keyword values */ border-left-style: none; border-left-style: hidden; border-left-style: dotted; border-left-style: dashed; border-left-style: solid; border-left-style: double; border-left-style: groove; border-left-style: ridge; border-left-style: inset; border-left-style: outset; /* global values */ border-left-style: inherit; border-left-style: initial; border-left-style: unset; the border-left-style property is specified as a single keyword chosen from those available for the border-style property.
...it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* bo...
...rder-left-style example classes */ .b1 {border-left-style: none;} .b2 {border-left-style: hidden;} .b3 {border-left-style: dotted;} .b4 {border-left-style: dashed;} .b5 {border-left-style: solid;} .b6 {border-left-style: double;} .b7 {border-left-style: groove;} .b8 {border-left-style: ridge;} .b9 {border-left-style: inset;} .b10 {border-left-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-left-style' in that specification.
border-left - CSS: Cascading Style Sheets
the border-left shorthand css property set an element's left border.
... as with all shorthand properties, border-left always sets the values of all of the properties that it can set, even if they are not specified.
... it sets those that are not specified to their default values.
... hiddenborder-left-style: as specifiedborder-left-color: computed coloranimation typeas each of the properties of the shorthand:border-left-color: a colorborder-left-style: discreteborder-left-width: a length formal syntax <line-width> | <line-style> | <color>where <line-width> = <length> | thin | medium | thick<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-right-style - CSS: Cascading Style Sheets
the border-right-style css property sets the line style of an element's right border.
... syntax /* keyword values */ border-right-style: none; border-right-style: hidden; border-right-style: dotted; border-right-style: dashed; border-right-style: solid; border-right-style: double; border-right-style: groove; border-right-style: ridge; border-right-style: inset; border-right-style: outset; /* global values */ border-right-style: inherit; border-right-style: initial; border-right-style: unset; the border-right-style property is specified as a single keyword chosen from those available for the border-style property.
...it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples border styles html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding...
...: 3px; } /* border-right-style example classes */ .b1 {border-right-style: none;} .b2 {border-right-style: hidden;} .b3 {border-right-style: dotted;} .b4 {border-right-style: dashed;} .b5 {border-right-style: solid;} .b6 {border-right-style: double;} .b7 {border-right-style: groove;} .b8 {border-right-style: ridge;} .b9 {border-right-style: inset;} .b10 {border-right-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-right-style' in that specification.
border-right - CSS: Cascading Style Sheets
the border-right shorthand css property sets the properties of an element's right border.
... as with all shorthand properties, border-right always sets the values of all of the properties that it can set, even if they are not specified.
... it sets those that are not specified to their default values.
...enborder-right-style: as specifiedborder-right-color: computed coloranimation typeas each of the properties of the shorthand:border-right-color: a colorborder-right-style: discreteborder-right-width: a length formal syntax <line-width> | <line-style> | <color>where <line-width> = <length> | thin | medium | thick<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
border-top-style - CSS: Cascading Style Sheets
the border-top-style css property sets the line style of an element's top border.
... syntax /* keyword values */ border-top-style: none; border-top-style: hidden; border-top-style: dotted; border-top-style: dashed; border-top-style: solid; border-top-style: double; border-top-style: groove; border-top-style: ridge; border-top-style: inset; border-top-style: outset; /* global values */ border-top-style: inherit; border-top-style: initial; border-top-style: unset; the border-top-style property is specified as a single keyword chosen from those available for the border-style property.
...it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples html <table> <tr> <td class="b1">none</td> <td class="b2">hidden</td> <td class="b3">dotted</td> <td class="b4">dashed</td> </tr> <tr> <td class="b5">solid</td> <td class="b6">double</td> <td class="b7">groove</td> <td class="b8">ridge</td> </tr> <tr> <td class="b9">inset</td> <td class="b10">outset</td> </tr> </table> css /* define look of the table */ table { border-width: 2px; background-color: #52e385; } tr, td { padding: 3px; } /* bo...
...rder-top-style example classes */ .b1 {border-top-style: none;} .b2 {border-top-style: hidden;} .b3 {border-top-style: dotted;} .b4 {border-top-style: dashed;} .b5 {border-top-style: solid;} .b6 {border-top-style: double;} .b7 {border-top-style: groove;} .b8 {border-top-style: ridge;} .b9 {border-top-style: inset;} .b10 {border-top-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the definition of 'border-top-style' in that specification.
border-top - CSS: Cascading Style Sheets
the border-top shorthand css property sets all the properties of an element's top border.
... as with all shorthand properties, border-top always sets the values of all of the properties that it can set, even if they are not specified.
... it sets those that are not specified to their default values.
...ne or hiddenborder-top-style: as specifiedborder-top-color: computed coloranimation typeas each of the properties of the shorthand:border-top-color: a colorborder-top-style: discreteborder-top-width: a length formal syntax <line-width> | <line-style> | <color>where <line-width> = <length> | thin | medium | thick<line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]?
box-flex - CSS: Cascading Style Sheets
WebCSSbox-flex
/* <number> values */ -moz-box-flex: 0; -moz-box-flex: 2; -moz-box-flex: 3.5; -webkit-box-flex: 0; -webkit-box-flex: 2; -webkit-box-flex: 3.5; /* global values */ -moz-box-flex: inherit; -moz-box-flex: initial; -moz-box-flex: unset; -webkit-box-flex: inherit; -webkit-box-flex: initial; -webkit-box-flex: unset; syntax the box-flex property is specified as a <number>.
... if the flex value is set using the element's flex attribute, then the style is ignored.
... to make xul elements in a containing box the same size, set the containing box's equalsize attribute to the value always.
... formal definition initial value0applies toelements that are direct children of an element with a css display value of -moz-box or -moz-inline-box or -webkit-box or -webkit-inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax <number> examples setting box-flex <!doctype html> <html> <head> <title>-moz-box-flex example</title> <style> div.example { display: -moz-box; display: -webkit-box; border: 1px solid black; width: 100%; } div.example > p:nth-child(1) { -moz-box-flex: 1; /* mozilla */ -webkit-box-flex: 1; /* webkit */ border: 1px solid black; ...
break-inside - CSS: Cascading Style Sheets
the break-inside css property sets how page, column, or region breaks should behave inside a generated box.
... /* keyword values */ break-inside: auto; break-inside: avoid; break-inside: avoid-page; break-inside: avoid-column; break-inside: avoid-region; /* global values */ break-inside: inherit; break-inside: initial; break-inside: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
...a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid | avoid-page | avoid-column | avoid-region examples avoiding breaking inside a figure in the followi...
...to avoid this, we have set break-inside: avoid on the <figure>, which causes them to always stay together.
content - CSS: Cascading Style Sheets
WebCSScontent
r() value linked to the html attribute value */ content: attr(value string); /* language- and position-dependent keywords */ content: open-quote; content: close-quote; content: no-open-quote; content: no-close-quote; /* except for normal and none, several values can be used simultaneously */ content: open-quote chapter_counter; /* global values */ content: inherit; content: initial; content: unset; syntax values none the pseudo-element is not generated.
...otherwise, for uri values, the absolute uri; for attr() values, the resulting string; for other keywords, as specified.animation typediscrete formal syntax normal | none | [ <content-replacement> | <content-list> ] [/ <string> ]?where <content-replacement> = <image><content-list> = [ <string> | contents | <image> | <quote> | <target> | <leader()> ]+where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient><quote> = open-quote | close-quote | no-open-quote | no-close-quote<target> = <target-counter()> | <target-counters()> | <target-text()><leader()> = leader( <leader-type> )where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<leader-type> = dotted | solid | space | <string>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
counters() - CSS: Cascading Style Sheets
WebCSScounters
syntax values <custom-ident> a name identifying the counters, which is the same case-sensitive name used for the counter-reset and counter-increment.
... the name cannot start with two dashes and can't be none, unset, initial, or inherit.
...-ident> examples default value compared to upper roman html <ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li></li> <li></li> <li> <ol> <li></li> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> </ol> </li> </ol> css ol { counter-reset: listcounter; } li { counter-increment: listcounter; } li::marker { content: counters(listcounter, '.', upper-roman) ') '; } li::before { content: counters(listcounter, ".") " == " counters(listcounter, ".", lower-roman) ; } result decimal-leading-zero compared to lower-alpha html <ol> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> <li>...
...</li> <li></li> <li> <ol> <li></li> <li> <ol> <li></li> <li></li> <li></li> </ol> </li> </ol> </li> </ol> css ol { counter-reset: count; } li { counter-increment: count; } li::marker { content: counters(count, '.', upper-alpha) ') '; } li::before { content: counters(count, ".", decimal-leading-zero) " == " counters(count, ".", lower-alpha); } result specifications specification status comment css lists module level 3the definition of 'css counters' in that specification.
flex-grow - CSS: Cascading Style Sheets
WebCSSflex-grow
the flex-grow css property sets the flex grow factor of a flex item main size.
... syntax /* <number> values */ flex-grow: 3; flex-grow: 0.6; /* global values */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; the flex-grow property is specified as a single <number>.
... flex-grow is used alongside the other flex properties flex-shrink and flex-basis, and normally defined using the flex shorthand to ensure all values are set.
... formal definition initial value0applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item grow factor html <h4>this is a flex-grow</h4> <h5>a,b,c and f are flex-grow:1 .
flex-shrink - CSS: Cascading Style Sheets
the flex-shrink css property sets the flex shrink factor of a flex item.
... syntax /* <number> values */ flex-shrink: 2; flex-shrink: 0.6; /* global values */ flex-shrink: inherit; flex-shrink: initial; flex-shrink: unset; the flex-shrink property is specified as a single <number>.
... formal definition initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set.
... d and e have flex-shrink:2 set</p> <p>the width of d and e is less than the others.</p> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class="box" style="background-color:lightblue;">b</div> <div class="box" style="background-color:yellow;">c</div> <div class="box1" style="background-color:brown;">d</div> <div class="box1" style="background-color:lightgreen;">e</div> </div> css #content { display: flex; width: 500px; } #content div { flex-basis: 120px; border: 3px solid rgba(0,0,0,.2); } .box { flex-shrink: 1; } .box1 { flex-shrink: 2; } result specifications specification status comment css flexible box layout modulethe definition of 'flex-shrink' in that specification.
flex-wrap - CSS: Cascading Style Sheets
WebCSSflex-wrap
the flex-wrap css property sets whether flex items are forced onto one line or can wrap onto multiple lines.
... if wrapping is allowed, it sets the direction that lines are stacked.
... syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below.
... formal definition initial valuenowrapapplies toflex containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax nowrap | wrap | wrap-reverse examples setting flex container wrap values html <h4>this is an example for flex-wrap:wrap </h4> <div class="content"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> <h4>this is an example for flex-wrap:nowrap </h4> <div class="content1"> <div class="red">1</div> <div class="green">2</div> <div class="blue">3</div> </div> <h4>this is an example for flex-wra...
font-style - CSS: Cascading Style Sheets
the font-style css property sets whether a font should be styled with a normal, italic, or oblique face from its font-family.
... syntax font-style: normal; font-style: italic; font-style: oblique; font-style: oblique 10deg; /* global values */ font-style: inherit; font-style: initial; font-style: unset; the font-style property is specified as a single keyword chosen from the list of values below, which can optionally include an angle if the keyword is oblique.
...see font-variation-settings.
...ctor('label[for="slant"]'); let slantinput = document.queryselector('#slant'); let sampletext = document.queryselector('.sample'); function update() { let slant = `oblique ${slantinput.value}deg`; slantlabel.textcontent = `font-style: ${slant};`; sampletext.style.fontstyle = slant; } slantinput.addeventlistener('input', update); update(); accessibility concerns large sections of text set with a font-style value of italic may be difficult for people with cognitive concerns such as dyslexia to read.
font-variant-position - CSS: Cascading Style Sheets
/* 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.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | sub | super examples setting superscript and subscript forms html <p class="normal">normal!</p> <p class="super">super!</p> <p class="sub">sub!</p> css p { display: inline; } .normal { font-variant-position: normal; } .super { font-variant-position: super; } .sub { font-variant-position: sub; } result specifications specification status comment css fonts module level 3the...
... noedge no support nofirefox full support 34 full support 34 no support 24 — 34disabled disabled from version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true).
...e android no support nofirefox android full support 34 full support 34 no support 24 — 34disabled disabled from version 24 until version 34 (exclusive): this feature is behind the layout.css.font-features.enabled preference (needs to be set to true).
grid-template - CSS: Cascading Style Sheets
eas grid-template-rows / grid-template-column values */ grid-template: "a a a" "b b b"; grid-template: "a a a" 20% "b b b" auto; grid-template: [header-top] "a a a" [header-bottom] [main-top] "b b b" 1fr [main-bottom] / auto 1fr auto; /* global values */ grid-template: inherit; grid-template: initial; grid-template: unset; values none is a keyword that sets all three longhand properties to none, meaning there is no explicit grid.
... <'grid-template-rows'> / <'grid-template-columns'> sets grid-template-rows and grid-template-columns to the specified values, and sets grid-template-areas to none.
... sets grid-template-areas to the strings listed, grid-template-rows to the track sizes following each string (filling in auto for any missing sizes), and splicing in the named lines defined before/after each size, and grid-template-columns to the track listing specified after the slash (or none, if not specified).
... note: the grid shorthand accepts the same syntax, but also resets the implicit grid properties to their initial values.
height - CSS: Cascading Style Sheets
WebCSSheight
if box-sizing is set to border-box, however, it instead determines the height of the border area.
... syntax /* keyword value */ height: auto; /* <length> values */ height: 120px; height: 10em; /* <percentage> value */ height: 75%; /* global values */ height: inherit; height: initial; height: unset; values <length> defines the height as an absolute value.
... accessibility concerns ensure that elements set with a height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
...a percentage height on the root element is relative to the initial containing block.computed valuea percentage or auto or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting height using pixels and percentages html <div id="taller">i'm 50 pixels tall.</div> <div id="shorter">i'm 25 pixels tall.</div> <div id="parent"> <div id="child"> i'm half the height of my parent.
image-rendering - CSS: Cascading Style Sheets
the image-rendering css property sets an image scaling algorithm.
... the property applies to an element itself, to any images set in its other properties, and to its descendants.
... syntax /* keyword values */ image-rendering: auto; image-rendering: crisp-edges; image-rendering: pixelated; /* global values */ image-rendering: inherit; image-rendering: initial; image-rendering: unset; values auto the scaling algorithm is ua dependent.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated and crisp-edges rules can be combined to provide some fallback for each other.
<image> - CSS: Cascading Style Sheets
WebCSSimage
a selection of images chosed based on resolution defined by the image-set() function.
...*/ image-set('test.jpg' 1x, 'test-2x.jpg' 2x) /* a selection of images with varying resolutions */ invalid images nourl.jpg /* an image file must be defined using the url() function.
...*/ image(z.jpg#xy=0,0) /* the spatial fragment must be written in the format of xywh=#,#,#,# */ image-set('cat.jpg' 1x, 'dog.jpg' 1x) /* every image in an image set must have a different resolutions */ specifications specification status comment css images module level 4the definition of '<image>' in that specification.
... working draft adds element(), image(), image-set(), conic-gradient(), repeating-conic-gradient(), and image-resolution.
image() - CSS: Cascading Style Sheets
the size of the color swatch can be set with the background-size property.
... this is different from the background-color, which sets a color to cover the entire element.
... examples directionally-sensitive images <ul> <li dir="ltr">bullet is a right facing arrow on the left</li> <li dir="rtl">bullet is the same arrow, flipped to point left.</li> </ul> ul { list-style-image: image(ltr 'https://mdn.mozillademos.org/files/16412/rightarrow.png'); } in the left-to-right list items — those with dir="ltr" set on the element itself or inheriting the directionality from an ancestor or default value for the page — the image will be used as-is.
... list items with dir="rtl" set on the <li> or inheriting the right-to-left directionality from an ancestor, such as documents set to arabic or hebrew, will have the bullet display on the right, horizontally flippled, as if transform: scalex(-1) had been set.
ime-mode - CSS: Cascading Style Sheets
WebCSSime-mode
/* keyword values */ ime-mode: auto; ime-mode: normal; ime-mode: active; ime-mode: inactive; ime-mode: disabled; /* global values */ ime-mode: inherit; ime-mode: initial; ime-mode: unset; the ime-mode property is only partially and inconsistently implemented in browsers.
...this property should only be used for private web applications or to undo the property if it was previously set by legacy code.
... normal the ime state should be normal; this value can be used in a user style sheet to override the page's setting.
...in the past, this was commonly used on fields that entered data into databases which didn't support extended character sets.
justify-content - CSS: Cascading Style Sheets
items have equal space around them */ justify-content: stretch; /* distribute items evenly stretch 'auto'-sized items to fit the container */ /* overflow alignment */ justify-content: safe center; justify-content: unsafe center; /* global values */ justify-content: inherit; justify-content: initial; justify-content: unset; values start the items are packed flush to each other toward the start edge of the alignment container in the main axis.
... normal the items are packed in their default position as if no justify-content value was set.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
...[ <content-position> | left | right ]where <content-distribution> = space-between | space-around | space-evenly | stretch<overflow-position> = unsafe | safe<content-position> = center | start | end | flex-start | flex-end examples setting flex item distribution css #container { display: flex; justify-content: space-between; /* can be changed in the live sample */ } #container > div { width: 100px; height: 100px; background: linear-gradient(-45deg, #788cff, #b4c8ff); } html <div id="container"> <div></div> <div></div> <div></div> </div> <select id="justifycontent"> <option value="start">start</option> ...
justify-self - CSS: Cascading Style Sheets
the css justify-self property sets the way a box is justified inside its alignment container along the appropriate axis.
... for absolutely-positioned elements, it aligns an item inside its containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
... /* pack item from the left */ justify-self: right; /* pack item from the right */ /* baseline alignment */ justify-self: baseline; justify-self: first baseline; justify-self: last baseline; /* overflow alignment (for positional alignment only) */ justify-self: safe center; justify-self: unsafe center; /* global values */ justify-self: inherit; justify-self: initial; justify-self: unset; this property can take one of three different forms: basic keywords: one of the keyword values normal, auto, or stretch.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
<length> - CSS: Cascading Style Sheets
WebCSSlength
absolute lengths can cause accessibility problems, since they are fixed and do not scale according to user settings.
... for this reason, prefer relative lengths (such as em or rem) when setting font-size.
...300px, 50%, 30vw) to set the width of a result bar that will appear below it once you've pressed return.
...iner"> <label>enter width:</label> <input type="text" id="length"> </div> <div class="inner"> </div> </div> <div class="results"> </div> css html { font-family: sans-serif; font-weight: bold; box-sizing: border-box; } .outer { width: 100%; height: 50px; background-color: #eee; position: relative; } .inner { height: 50px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); } .result { height: 20px; background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); background-color: orange; display: flex; align-items: center; margin-top: 10px; } .result code { position: absolute; margin-left: 20px; } ...
list-style-position - CSS: Cascading Style Sheets
the list-style-position css property sets the position of the ::marker relative to a list item.
...because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items.
... syntax /* keyword values */ list-style-position: inside; list-style-position: outside; /* global values */ list-style-position: inherit; list-style-position: initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below.
... formal definition initial valueoutsideapplies tolist itemsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax inside | outside examples setting list item position html <ul class="inside">list 1 <li>list item 1-1</li> <li>list item 1-2</li> <li>list item 1-3</li> <li>list item 1-4</li> </ul> <ul class="outside">list 2 <li>list item 2-1</li> <li>list item 2-2</li> <li>list item 2-3</li> <li>list item 2-4</li> </ul> <ul class="inside-img">list 3 <li>list item 3-1</li> <li>list item 3-2</li> <li>list item 3-3</li> <li>list item 3-4</li> </ul> css .inside { list-style-position: inside; list-sty...
mask-border-width - CSS: Cascading Style Sheets
the mask-border-width css property sets the width of an element's mask border.
...er-width: 1rem; /* <percentage> value */ mask-border-width: 25%; /* <number> value */ mask-border-width: 3; /* vertical | horizontal */ mask-border-width: 2em 3em; /* top | horizontal | bottom */ mask-border-width: 5% 15% 10%; /* top | right | bottom | left */ mask-border-width: 5% 2em 10% auto; /* global values */ mask-border-width: inherit; mask-border-width: initial; mask-border-width: unset; the mask-border-width property may be specified using one, two, three, or four values chosen from the list of values below.
...percentages are relative to the width of the border area for horizontal offsets and the height of the border area for vertical offsets.
...when it eventually starts to be supported, it will serve to define the width of the border mask — setting this to a different value to mask-border-slice will cause the slices to be scaled to fit the border mask.
mask-origin - CSS: Cascading Style Sheets
the mask-origin css property sets the origin of a mask.
...igin: margin-box; mask-origin: fill-box; mask-origin: stroke-box; mask-origin: view-box; /* multiple values */ mask-origin: padding-box, content-box; mask-origin: view-box, fill-box, border-box; /* non-standard keyword values */ -webkit-mask-origin: content; -webkit-mask-origin: padding; -webkit-mask-origin: border; /* global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; for elements rendered as a single box, this property specifies the mask positioning area.
...if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute.
...itial valueborder-boxapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <geometry-box>#where <geometry-box> = <shape-box> | fill-box | stroke-box | view-boxwhere <shape-box> = <box> | margin-boxwhere <box> = border-box | padding-box | content-box examples setting mask origin to border-box css #masked { width: 100px; height: 100px; margin: 10px; border: 10px solid blue; background-color: #8cffa0; padding: 10px; mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-origin: border-box; /* can be changed in the live sample */ } html <div id="masked"> </div> <select id="origin"> <option value="content-box">content...
mask-type - CSS: Cascading Style Sheets
WebCSSmask-type
the mask-type css property sets whether an svg <mask> element is used as a luminance or an alpha mask.
... /* keyword values */ mask-type: luminance; mask-type: alpha; /* global values */ mask-type: inherit; mask-type: initial; mask-type: unset; this property may be overridden by the mask-mode property, which has the same effect but applies to the element where the mask is used.
... formal definition initial valueluminanceapplies to<mask> elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax luminance | alpha examples setting an alpha mask html <div class="redsquare"></div> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> <defs> <mask id="m" maskcontentunits="objectboundingbox" style="mask-type:alpha"> <rect x=".1" y=".1" width=".8" height=".8" fill="red" fill-opacity="0.7"/> </mask> </defs> </svg> css .
...redsquare { height: 100px; width: 100px; background-color: rgb(128, 128, 128); border: solid 1px black; mask: url("#m"); } result setting a luminance mask html <div class="redsquare"></div> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="0" height="0"> <defs> <mask id="m" maskcontentunits="objectboundingbox" style="mask-type:luminance"> <rect x=".1" y=".1" width=".8" height=".8" fill="red" fill-opacity="0.7"/> </mask> </defs> </svg> css .redsquare { height: 100px; width: 100px; background-color: rgb(128, 128, 128); border: solid 1px black; mask: url("#m"); mask-type:luminance; } result specifications specification status comment css maski...
max-height - CSS: Cascading Style Sheets
the max-height css property sets the maximum height of an element.
... syntax /* <length> value */ max-height: 3.5em; /* <percentage> value */ max-height: 75%; /* keyword values */ max-height: none; max-height: max-content; max-height: min-content; max-height: fit-content(20em); /* global values */ max-height: inherit; max-height: initial; max-height: unset; values <length> defines the max-height as an absolute value.
... accessibility concerns ensure that elements set with a max-height are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
...ds on content height), and this element is not absolutely positioned, the percentage value is treated as none.computed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max-height using percentage and keyword values table { max-height: 75%; } form { max-height: none; } specifications specification status comment css box sizing module level 4the definition of 'max-height' in that specification.
max-width - CSS: Cascading Style Sheets
WebCSSmax-width
the max-width css property sets the maximum width of an element.
... syntax /* <length> value */ max-width: 3.5em; /* <percentage> value */ max-width: 75%; /* keyword values */ max-width: none; max-width: max-content; max-width: min-content; max-width: fit-content(20em); /* global values */ max-width: inherit; max-width: initial; max-width: unset; values <length> defines the max-width as an absolute value.
... accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size.
...ed inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute length or noneanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max width in pixels in this example, the "child" will be either 150 pixels wide or the width of the "parent," whichever is smaller.
min-height - CSS: Cascading Style Sheets
the min-height css property sets the minimum height of an element.
... the element's height is set to the value of min-height whenever min-height is larger than max-height or height.
... syntax /* <length> value */ min-height: 3.5em; /* <percentage> value */ min-height: 10%; /* keyword values */ min-height: max-content; min-height: min-content; min-height: fit-content(20em); /* global values */ min-height: inherit; min-height: initial; min-height: unset; values <length> defines the min-height as an absolute value.
...., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0.computed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting min-height table { min-height: 75%; } form { min-height: 0; } specifications specification status comment css box sizing module level 4the definition of 'min-height' in that specification.
min-width - CSS: Cascading Style Sheets
WebCSSmin-width
the min-width css property sets the minimum width of an element.
... the element's width is set to the value of min-width whenever min-width is larger than max-width or width.
... syntax /* <length> value */ min-width: 3.5em; /* <percentage> value */ min-width: 10%; /* keyword values */ min-width: max-content; min-width: min-content; min-width: fit-content(20em); /* global values */ min-width: inherit; min-width: initial; min-width: unset; values <length> defines the min-width as an absolute value.
...n-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting minimum element width table { min-width: 75%; } form { min-width: 0; } specifications specification status comment css box sizing module level 4the definition of 'min-width' in that specification.
mix-blend-mode - CSS: Cascading Style Sheets
the mix-blend-mode css property sets how an element's content should blend with the content of the element's parent and the element's background.
...end-mode: darken; mix-blend-mode: lighten; mix-blend-mode: color-dodge; mix-blend-mode: color-burn; mix-blend-mode: hard-light; mix-blend-mode: soft-light; mix-blend-mode: difference; mix-blend-mode: exclusion; mix-blend-mode: hue; mix-blend-mode: saturation; mix-blend-mode: color; mix-blend-mode: luminosity; /* global values */ mix-blend-mode: initial; mix-blend-mode: inherit; mix-blend-mode: unset; values <blend-mode> the blending mode that should be applied.
...ss="col"> <div class="note">blending in isolation (no blending with the background)</div> <div class="row isolate"> <div class="cell"> normal <div class="container normal"> <div class="group"> <div class="item firefox"></div> <svg viewbox="0 0 150 150"> <defs> <lineargradient id="red"> <stop offset="0" stop-color="hsl(0,100%,50%)" /> <stop offset="100%" stop-color="hsl(0,0%,100%)" /> </lineargradient> <lineargradient id="green"> <stop offset="0" stop-color="hsl(120,100%,50%)" /> <stop offset="100%" stop-color="hsl(120,0%,100%)" /> </lineargradient> <lineargradient id="...
...blue"> <stop offset="0" stop-color="hsl(240,100%,50%)" /> <stop offset="100%" stop-color="hsl(240,0%,100%)" /> </lineargradient> </defs> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item g" cx="75" cy="75" rx="25" ry="70"></ellipse> <ellipse class="item b" cx="75" cy="75" rx="25" ry="70"></ellipse> </svg> </div> </div> </div> <div class="cell"> multiply <div class="container multiply"> <div class="group"> <div class="item firefox"></div> <svg viewbox="0 0 150 150"> <ellipse class="item r" cx="75" cy="75" rx="25" ry="70"></ellipse> <elli...
object-position - CSS: Cascading Style Sheets
syntax /* <position> values */ object-position: center top; object-position: 100px 50px; /* global values */ object-position: inherit; object-position: initial; object-position: unset; values <position> from one to four values that define the 2d position of the element.
... relative or absolute offsets can be used.
... note: the position can be set so that the replaced element is drawn outside its box.
... img { width: 300px; height: 250px; border: 1px solid black; background-color: silver; margin-right: 1em; object-fit: none; } #object-position-1 { object-position: 10px; } #object-position-2 { object-position: 100% 10%; } the first image is positioned with its left edge inset 10 pixels from the left edge of the element's box.
outline-color - CSS: Cascading Style Sheets
the outline-color css property sets the color of an element's outline.
... syntax /* <color> values */ outline-color: #f92525; outline-color: rgb(30,222,121); outline-color: blue; /* keyword value */ outline-color: invert; /* global values */ outline-color: inherit; outline-color: initial; outline-color: unset; the outline-color property is specified as any one of the values listed below.
...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).
...)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples setting a solid blue outline html <p>my outline is blue, as you can see.</p> css p { outline: 2px solid; /* set the outline width and style */ outline-color: #0000ff; /* make the outline blue */ margin: 5px; } result specifications specification status comment css basic user interface module level 3the definition of 'outline-color' in that specificat...
overscroll-behavior - CSS: Cascading Style Sheets
the overscroll-behavior css property sets what a browser does when reaching the boundary of a scrolling area.
... /* keyword values */ overscroll-behavior: auto; /* default */ overscroll-behavior: contain; overscroll-behavior: none; /* two values */ overscroll-behavior: auto contain; /* global values */ overscroll-behavior: inherit; overscroll-behavior: initial; overscroll-behavior: unset; by default, mobile browsers tend to provide a "bounce" effect or even a page refresh when the top or bottom of a page (or other scroll area) is reached.
... contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
...this can be prevented by setting overscroll-behavior: none on the <body> element: body { margin: 0; overscroll-behavior: none; } specifications specification status comment css overscroll behavior module level 1the definition of 'overscroll-behavior' in that specification.
padding-bottom - CSS: Cascading Style Sheets
the padding-bottom css property sets the height of the padding area on the bottom of an element.
... note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
... syntax /* <length> values */ padding-bottom: 0.5em; padding-bottom: 0; padding-bottom: 2cm; /* <percentage> value */ padding-bottom: 10%; /* global values */ padding-bottom: inherit; padding-bottom: initial; padding-bottom: unset; the padding-bottom property is specified as a single value chosen from the list below.
...it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting padding bottom with pixels and percentages .content { padding-bottom: 5%; } .sidebox { padding-bottom: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-bottom' in that specification.
padding-left - CSS: Cascading Style Sheets
the padding-left css property sets the width of the padding area to the left of an element.
... note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
... syntax /* <length> values */ padding-left: 0.5em; padding-left: 0; padding-left: 2cm; /* <percentage> value */ padding-left: 10%; /* global values */ padding-left: inherit; padding-left: initial; padding-left: unset; the padding-left property is specified as a single value chosen from the list below.
...it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting left padding using pixels and percentages .content { padding-left: 5%; } .sidebox { padding-left: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-left' in that specification.
padding-right - CSS: Cascading Style Sheets
the padding-right css property sets the width of the padding area on the right of an element.
... note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
... syntax /* <length> values */ padding-right: 0.5em; padding-right: 0; padding-right: 2cm; /* <percentage> value */ padding-right: 10%; /* global values */ padding-right: inherit; padding-right: initial; padding-right: unset; the padding-right property is specified as a single value chosen from the list below.
...it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting right padding using pixels and percentages .content { padding-right: 5%; } .sidebox { padding-right: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-right' in that specification.
padding-top - CSS: Cascading Style Sheets
the padding-top css property sets the height of the padding area on the top of an element.
... note: the padding property can be used to set paddings on all four sides of an element with a single declaration.
... syntax /* <length> values */ padding-top: 0.5em; padding-top: 0; padding-top: 2cm; /* <percentage> value */ padding-top: 10%; /* global values */ padding-top: inherit; padding-top: initial; padding-top: unset; the padding-top property is specified as a single value chosen from the list below.
...it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples setting top padding using pixels and percentages .content { padding-top: 5%; } .sidebox { padding-top: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-top' in that specification.
perspective - CSS: Cascading Style Sheets
syntax /* keyword value */ perspective: none; /* <length> values */ perspective: 20px; perspective: 3.5em; /* global values */ perspective: inherit; perspective: initial; perspective: unset; values none indicates that no perspective transform is to be applied.
... formal definition initial valuenoneapplies totransformable elementsinheritednocomputed valuethe absolute length or noneanimation typea lengthcreates stacking contextyes formal syntax none | <length> examples setting perspective this example shows a cube with the perspective set at different positions.
... html the html below creates four copies of the same box, with the perspective set at different values.
...pers650"> <div class="face front">1</div> <div class="face back">2</div> <div class="face right">3</div> <div class="face left">4</div> <div class="face top">5</div> <div class="face bottom">6</div> </div> </div> </td> </tr> </tbody> </table> css the css establishes classes that can be used to set the perspective to different distances.
resize - CSS: Cascading Style Sheets
WebCSSresize
the resize css property sets whether an element is resizable, and if so, in which directions.
... syntax /* keyword values */ resize: none; resize: both; resize: horizontal; resize: vertical; resize: block; resize: inline; /* global values */ resize: inherit; resize: initial; resize: unset; the resize property is specified as a single keyword value from the list below.
... resize does not apply to the following: inline elements block elements for which the overflow property is set to visible formal definition initial valuenoneapplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | both | horizontal | vertical | block | inline examples disabling resizability of textareas in many browsers, <textarea> elements are res...
... html <div class="resizable"> <p class="resizable"> this paragraph is resizable in all directions, because the css `resize` property is set to `both` on this element.
scroll-margin-block - CSS: Cascading Style Sheets
the scroll-margin-block shorthand property sets the scroll margins of an element in the block dimension.
... constituent properties this property is a shorthand for the following css properties: scroll-margin-block-end scroll-margin-block-start syntax /* <length> values */ scroll-margin-block: 10px; scroll-margin-block: 1em .5em ; /* global values */ scroll-margin-block: inherit; scroll-margin-block: initial; scroll-margin-block: unset; values <length> an outset from the corresponding edge of the scroll container.
... description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport.
... the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
scroll-padding-block - CSS: Cascading Style Sheets
the scroll-padding-block shorthand property sets the scroll padding of an element in the block dimension.
... the scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
...ies this property is a shorthand for the following css properties: scroll-padding-block-end scroll-padding-block-start syntax /* keyword values */ scroll-padding-block: auto; /* <length> values */ scroll-padding-block: 10px; scroll-padding-block: 1em .5em; scroll-padding-block: 10%; /* global values */ scroll-padding-block: inherit; scroll-padding-block: initial; scroll-padding-block: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-inline - CSS: Cascading Style Sheets
the scroll-padding-inline shorthand property sets the scroll padding of an element in the inline dimension.
... the scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... property is a shorthand for the following css properties: scroll-padding-inline-end scroll-padding-inline-start syntax /* keyword values */ scroll-padding-inline: auto; /* <length> values */ scroll-padding-inline: 10px; scroll-padding-inline: 1em .5em; scroll-padding-inline: 10%; /* global values */ scroll-padding-inline: inherit; scroll-padding-inline: initial; scroll-padding-inline: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding - CSS: Cascading Style Sheets
the scroll-padding shorthand property sets scroll padding on all sides of an element at once, much like the padding property does for padding on an element.
... the scroll-padding-* properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
...rties this property is a shorthand for the following css properties: scroll-padding-bottom scroll-padding-left scroll-padding-right scroll-padding-top syntax /* keyword values */ scroll-padding: auto; /* <length> values */ scroll-padding: 10px; scroll-padding: 1em .5em 1em 1em; scroll-padding: 10%; /* global values */ scroll-padding: inherit; scroll-padding: initial; scroll-padding: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid <length> or a <percentage>.
... auto the offset is determind by the user agent.
scrollbar-width - CSS: Cascading Style Sheets
the scrollbar-width property allows the author to set the maximum thickness of an element’s scrollbars when they are shown.
... initial valueautoapplies toscrolling boxesinheritednocomputed valueas specifiedanimation typediscrete syntax /* keyword values */ scrollbar-width: auto; scrollbar-width: thin; scrollbar-width: none; /* global values */ scrollbar-width: inherit; scrollbar-width: initial; scrollbar-width: unset; values <scrollbar-width> defines the width of the scrollbar as a keyword.
... note: user agents must apply any scrollbar-width value set on the root element to the viewport.
... 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.
<shape> - CSS: Cascading Style Sheets
WebCSSshape
rect() rect(top, right, bottom, left) values top is a <length> representing the offset for the top of the rectangle relative to the top border of the element's box.
... right is a <length> representing the offset for the right of the rectangle relative to the left border of the element's box.
... bottom is a <length> representing the offset for the bottom of the rectangle relative to the top border of the element's box.
... left is a <length> representing the offset for the left of the rectangle relative to the left border of the element's box.
text-emphasis-position - CSS: Cascading Style Sheets
the text-emphasis-position css property sets where emphasis marks are drawn.
...al value */ text-emphasis-position: over right; /* keywords value */ text-emphasis-position: over left; text-emphasis-position: under right; text-emphasis-position: under left; text-emphasis-position: left over; text-emphasis-position: right under; text-emphasis-position: left under; /* global values */ text-emphasis-position: inherit; text-emphasis-position: initial; text-emphasis-position: unset; syntax values over draw marks over the text in horizontal writing mode.
...ble below summarizes the preferred emphasis mark positions for chinese, mongolian and japanese: preferred emphasis mark and ruby position language preferred position illustration horizontal vertical japanese over right korean mongolian chinese under right note: the text-emphasis-position cannot be set, and therefore are not reset either, using the text-emphasis shorthand property.
...in html, this can be done with the following pattern: em { text-emphasis: dot; /* set text-emphasis for <em> elements */ } em rt { display: none; /* hide ruby inside <em> elements */ } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification.
transform-style - CSS: Cascading Style Sheets
the transform-style css property sets whether children of an element are positioned in the 3d space or are flattened in the plane of the element.
... as this property is not inherited, it must be set for all non-leaf descendants of the element.
... syntax /* keyword values */ transform-style: flat; transform-style: preserve-3d; /* global values */ transform-style: inherit; transform-style: initial; transform-style: unset; values flat indicates that the children of the element are lying in the plane of the element itself.
...the parent container of the cube faces has transform-style: preserve-3d set on it by default, so it is transformed in the 3d space and you can see it as intended.
transition-timing-function - CSS: Cascading Style Sheets
the transition-timing-function css property sets how intermediate values are calculated for css properties being affected by a transition effect.
...n: steps(20, jump-none); transition-timing-function: steps(5, jump-both); transition-timing-function: steps(6, start); transition-timing-function: steps(8, end); /* multiple timing functions */ transition-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); /* global values */ transition-timing-function: inherit; transition-timing-function: initial; transition-timing-function: unset; values <timing-function> each <timing-function> represents the timing function to link to the corresponding property to transition, as defined in transition-property.
...div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration: 2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].classlist.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .ease { transition-timing-function: ease; } .easein { transition-timing-function: ease-in; } .easeout { transition-timing-function: ease-out; } .easeinout { transition-timing-function: ease-in-out; } .linear { transition-timing-function: linear; } .cb { transition-timing-function: cubic-bezier(0.2,-2,0.8,2); } step examples <div class="p...
... div.box1{ width: 90vw; min-width: 24em; background-color: magenta; color: yellow; border: 1px solid orange; transition-property: all; transition-duration:2s; } function updatetransition() { var els = document.queryselectorall(".parent > div[class]"); for(var c = els.length, i = 0; i < c; i++) { els[i].classlist.toggle("box1"); } } var intervalid = window.setinterval(updatetransition, 10000); .jump-start { transition-timing-function: steps(5, jump-start); } .jump-end { transition-timing-function: steps(5, jump-end); } .jump-none { transition-timing-function: steps(5, jump-none); } .jump-both { transition-timing-function: steps(5, jump-both); } .step-start { transition-timing-function: step-start; } .step-end { transition-timing-fu...
width - CSS: Cascading Style Sheets
WebCSSwidth
the width css property sets an element's width.
... by default, it sets the width of the content area, but if box-sizing is set to border-box, it sets the width of the border area.
... syntax /* <length> values */ width: 300px; width: 25em; /* <percentage> value */ width: 75%; /* keyword values */ width: max-content; width: min-content; width: fit-content(20em); width: auto; /* global values */ width: inherit; width: initial; width: unset; the width property is specified as either: one of the following keyword values: min-content, max-content, fit-content, auto.
... accessibility concerns ensure that elements set with a width aren't truncated and don't obscure other content when the page is zoomed to increase text size.
str:concat() - EXSLT
WebEXSLTstrconcat
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:concat() returns a string containing all the string values in a node-set concatenated together.
... syntax str:concat(nodeset) parameters nodeset the node-set whose nodes' string values should be concatenated into one string.
... returns a string whose value is all the string values of the nodes in nodeset concatenated together.
... if nodeset is empty, an empty string is returned.
Ajax - Developer guides
WebGuideAJAX
it will seem familiar to anyone who has used xmlhttprequest, but this api provides a more powerful and flexible feature set.
... sending and receiving binary data the responsetype property of the xmlhttprequest object can be set to change the expected response type from the server.
...the response property will contain the entity body according to responsetype, as an arraybuffer, blob, document, json, or string.
...it is a simplified subset of sgml, capable of describing many different kinds of data.
Web Audio playbackRate explained - Developer guides
playbackrate basics let's starting by looking at a brief example of playbackrate usage: var myaudio = document.createelement('audio'); myaudio.setattribute('src','audiofile.mp3'); myaudio.playbackrate = 0.5; here we create an <audio> element, and set its src to a file of our choice.
... next we set playbackrate to 0.5, which represents half normal speed (the playbackrate is a multiplier applied to the original rate.) a complete example let's create a <video> element first, and set up video and playback rate controls in html: <video id="myvideo" controls> <source src="https://udn.realityripple.com/samples/6f/08625b424a.m4v" type='video/mp4' /> <source src="https://udn.realityripple.com/samples/5b/8cd6da9c65.webm" type='video/webm' /> </video> <form> <input id="pbr" type="range" value="1" min="0.5" max="4" step="0.1" > <p>playback rate <span id="currentpbr">1</span></p> </form> and apply some javascript to it: window.onload = function () { var v = document.getelementbyid("myvideo"); var p = document.getelementbyid("pbr"); var c = document.getelementbyid("...
... defaultplaybackrate and ratechange in addition to playbackrate, we also have a defaultplaybackrate property available, which lets us set the default playback rate: the playback rate to which the media resets; for example, if we change the source of the video, or (in some browsers) when an ended event is generated.
... so defaultplaybackrate allows us to set the playback rate before playing the media, while playbackrate allows us to change it during media playback.
Challenge solutions - Developer guides
use domi's right-hand pane to find out where the node's color is set to red, and where its appearance is made bolder than normal text.
... solution add the following style declaration to the strong rule: font: 200% serif; if you use separate declarations for font-size and font-family, then the font-style setting on the first paragraph is not overridden.
... solution add a rule to the body element (parent of the headings) to reset a new counter, and one to display and increment the counter on the headings: /* numbered headings */ body {counter-reset: headnum;} h3:before { content: "(" counter(headnum, upper-latin) ") "; counter-increment: headnum; } boxes ocean border challenge add one rule to your stylesheet, making a wide border all around the oceans in a color that reminds you of the sea.
...the following script achieves the desired result: // javascript demonstration function dodemo (button) { var square = document.getelementbyid("square"); square.style.backgroundcolor = "#fa4"; square.style.marginleft = "20em"; button.setattribute("disabled", "true"); settimeout(cleardemo, 2000, button); } function cleardemo (button) { var square = document.getelementbyid("square"); square.style.backgroundcolor = "transparent"; square.style.marginleft = "0em"; button.removeattribute("disabled"); } svg and css change color of inner petals challenge change the stylesheet so that the inner petals all turn pink w...
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
for example, if you have a graphical button that shows an image with an icon and/or image text "login now", you should also set the alt attribute to something like login now.
...this allows you to specify a frame for the image using the width and height attributes to set aside space in the layout, then adjust where within that space the image is located and how (or if) it is scaled to occupy that space.
...cddbec0e0b540098c28451e57203e5cab46dfed7ab0115d5a659fcfb7b.png" alt="login" width="100"> </div> </form> css and now some simple css to make the basic elements sit more neatly: div { margin-bottom: 10px; } label { display: inline-block; width: 70px; text-align: right; padding-right: 10px; } adjusting the image position and scaling in this example, we adapt the previous example to set aside more space for the image and then adjust the actual image's size and positioning using object-fit and object-position.
... alt="login" width="200" height="100"> </div> </form> css div { margin-bottom: 10px; } label { display: inline-block; width: 70px; text-align: right; padding-right: 10px; } #image { object-position: right top; object-fit: contain; background-color: #ddd; } here, object-position is configured to draw the image at the top-right corner of the element, while object-fit is set to contain, which indicates that the image should be drawn at the largest size that will fit within the element's box without altering its aspect ratio.
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
WebHTMLElementnoframes
a <noframes> element can contain any html elements that are allowed within the body of an html document, with the exception of the <frameset> and <frame> elements, since using frames when they aren't supported doesn't make sense.
... in html 5 and later, <noframes> is obsolete and shouldn't be used, since the <frame> and <frameset> elements are also obsolete.
... example in this example, we see a frameset with two frames.
... <frameset cols="50%,50%"> <frame src="https://developer.mozilla.org/en/html/element/frameset" /> <frame src="https://developer.mozilla.org/en/html/element/frame" /> <noframes><p>it seems your browser does not support frames or is configured to not allow them.</p></noframes> </frameset> specifications specification status comment html5the definition of 'noframes' in that specification.
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
set margin-left and margin-right to auto or margin to 0 auto to achieve an effect that is similar to the align attribute.
...if set to 0, the frame attribute is set to void.
... to achieve a similar effect, apply the border-collapse property to the <table> element, with its value set to collapse, and the padding property to the <td> elements.
...border-spacing does not have any effect if border-collapse is set to collapse.
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
values higher than 1000 will be considered as incorrect and will be set to the default value (1).
...its default value is 1; if its value is set to 0, it extends until the end of the table section (<thead>, <tbody>, <tfoot>, even if implicitly defined), that the cell belongs to.
... char (with text only): the content is aligned to a character inside the <th> element with minimal offset.
...if align is not set to char, this attribute is ignored.
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
values higher than 1000 will be considered as incorrect and will be set to the default value (1).
...its default value is 1; if its value is set to 0, it extends until the end of the table section (<thead>, <tbody>, <tfoot>, even if implicitly defined), that the cell belongs to.
... char (with text only): the content is aligned to a character inside the <th> element with minimal offset.
...if align is not set to char, this attribute is ignored.
data-* - HTML: Hypertext Markup Language
all such custom data are available via the htmlelement interface of the element the attribute is set on.
... the htmlelement.dataset property gives access to them.
... note that the htmlelement.dataset property is a domstringmap, and the name of the custom data attribute data-test-value will be accessible via htmlelement.dataset.testvalue (or by htmlelement.dataset["testvalue"]) as any dash (u+002d) is replaced by the capitalization of the next letter, converting the name to camelcase.
...for example, a space-ship "sprite" in a game could be a simple <img> element with a class attribute and several data-* attributes: <img class="spaceship cruiserx3" src="shipx3.png" data-ship-id="324" data-weapons="laseri laserii" data-shields="72%" data-x="414354" data-y="85160" data-z="31940" onclick="spaceships[this.dataset.shipid].blasted()"> for a more in-depth tutorial about using html data attributes, see using data attributes.
HTTP caching - HTTP
WebHTTPCaching
you might have seen "caching" in your browser's settings already.
...for example, an isp or your company might have set up a web proxy as part of its local network infrastructure to serve many users so that popular resources are reused a number of times, reducing network traffic and latency.
... the expiration time is computed as follows: expirationtime = responsetime + freshnesslifetime - currentage where responsetime is the time at which the response was received according to the browser.
...to optimize this, good practices recommend to set expiration times as far in the future as possible.
Cross-Origin Resource Policy (CORP) - HTTP
cross-origin resource policy is a policy set by the cross-origin-resource-policy http header that lets web sites and applications opt in to protection against certain requests from other origins (such as those issued with elements like <script> and <img>), to mitigate speculative side-channel attacks, like spectre, as well as cross-site script inclusion attacks.
... usage note: due to a bug in chrome, setting cross-origin-resource-policy can break pdf rendering, preventing visitors from being able to read past the first page of some pdfs.
... web applications set a cross-origin resource policy via the cross-origin-resource-policy http response header, which accepts one of three values: same-site only requests from the same site can read the resource.
... cross-origin-resource-policy: same-site | same-origin | cross-origin during a cross-origin resource policy check, if the header is set, the browser will deny no-cors requests issued from a different origin/site.
CSP: object-src - HTTP
to set allowed types for <object>, <embed>, and <applet> elements, use the plugin-types directive.
...explicitly set object-src 'none' if possible).
... 'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: plugin-types - HTTP
the http content-security-policy (csp) plugin-types directive restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded.
...not setting this allows anything.
... syntax one or more mime types can be set for the plugin-types policy: content-security-policy: plugin-types <type>/<subtype>; content-security-policy: plugin-types <type>/<subtype> <type>/<subtype>; <type>/<subtype> a valid mime type.
... examples disallowing plugins to disallow all plugins, the object-src directive should be set to 'none' which will disallow plugins.
CSP: script-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
... content-security-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.
...if 'unsafe-eval' isn't specified with the script-src directive, the following methods are blocked and won't have any effect: eval() function() when passing a string literal like to methods like: window.settimeout("alert(\"hello world!\");", 500); window.settimeout window.setinterval window.setimmediate window.execscript (ie < 11 only) strict-dynamic the 'strict-dynamic' source expression specifies that the trust explicitly given to a script present in the markup, by accompanying it with a nonce or a hash, shall be propagated to all the scripts loaded by that root script.
CSP: style-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
...xt/css" /> <style> #inline-style { background: red; } </style> <style> @import url("https://not-example.com/styles/print.css") print; </style> as well as styles loaded using the link header: link: <https://not-example.com/styles/stylesheet.css>;rel=stylesheet inline style attributes are also blocked: <div style="display:none">foo</div> as well as styles that are applied in javascript by setting the style attribute directly, or by setting csstext: document.queryselector('div').setattribute('style', 'display:none;'); document.queryselector('div').style.csstext = 'display:none;'; however, styles properties that are set directly on the element's style property will not be blocked, allowing users to safely manipulate styles via javascript: document.queryselector('div').style.display =...
...y-policy: style-src 'unsafe-inline'; the above content security policy will allow inline styles like the <style> element, 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.
Content-Security-Policy - HTTP
therefore it is recommended to restrict this fetch-directive (e.g., explicitly set object-src 'none' if possible).
... plugin-types restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded.
... other directives block-all-mixed-content prevents loading any assets using http when the page is loaded using https.
...to specify a content security policy for the worker, set a content-security-policy response header for the request which requested the worker script itself.
Content-Type - HTTP
browsers will do mime sniffing in some cases and will not necessarily follow the value of this header; to prevent this behavior, the header x-content-type-options can be set to nosniff.
... syntax content-type: text/html; charset=utf-8 content-type: multipart/form-data; boundary=something directives media-type the mime type of the resource or the data.
... charset the character encoding standard.
... boundary for multipart entities the boundary directive is required, which consists of 1 to 70 characters from a set of characters known to be very robust through email gateways, and not ending with white space.
Cross-Origin-Opener-Policy - HTTP
coop will process-isolate your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks.
... same-origin-allow-popups retains references to newly opened windows or tabs which either don't set coop or which opt out of isolation by setting a coop of unsafe-none.
... examples certain features depend on cross-origin isolation certain features like sharedarraybuffer objects or performance.now() with unthrottled timers are only available if your document has a coop header with the value same-origin value set.
... cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp see also the cross-origin-embedder-policy header which you'll need to set as well.
Keep-Alive - HTTP
the keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests.
... the connection header needs to be set to "keep-alive" for this header to have any meaning.
...note that timeouts longer than the tcp timeout may be ignored if no keep-alive tcp message is set at the transport level.
... examples a response containing a keep-alive header: http/1.1 200 ok connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: thu, 11 aug 2016 15:23:13 gmt keep-alive: timeout=5, max=1000 last-modified: mon, 25 jul 2016 04:32:39 gmt server: apache (body) specifications specification title http keep-alive header keep-alive header (ietf internet draft) rfc 7230, appendix a.1.2: keep-alive hypertext transfer protocol (http/1.1): message syntax and routing ...
A typical HTTP session - HTTP
WebHTTPSession
for example, sending the result of a form: post /contact_form.php http/1.1 host: developer.mozilla.org content-length: 64 content-type: application/x-www-form-urlencoded name=joe%20user&request=send%20me%20one%20of%20your%20catalogue request methods http defines a set of request methods indicating the desired action to be performed upon a resource.
... example responses successful web page response: http/1.1 200 ok content-type: text/html; charset=utf-8 content-length: 55743 connection: keep-alive cache-control: s-maxage=300, public, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:37:18 gmt etag: "2e77ad1dc6ab0b53a2996dfd4653c1c3" server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary: accept-encoding,cookie age: 7 <!doctype...
... html> <html lang="en"> <head> <meta charset="utf-8"> <title>a simple webpage</title> </head> <body> <h1>simple html5 webpage</h1> <p>hello, world!</p> </body> </html> notification that the requested resource has permanently moved: http/1.1 301 moved permanently server: apache/2.4.37 (red hat) content-type: text/html; charset=utf-8 date: thu, 06 dec 2018 17:33:08 gmt location: https://developer.mozilla.org/ (this is the new link to the resource; it is expected that the user-agent will fetch it) keep-alive: timeout=15, max=98 accept-ranges: bytes via: moz-cache-zlb05 connection: keep-alive content-length: 325 (the content contains a default page to display if the user-agent is not able to follow the link) <!doctype html...
... (contains a site-customized page helping the user to find the missing resource) notification that the requested resource doesn't exist: http/1.1 404 not found content-type: text/html; charset=utf-8 content-length: 38217 connection: keep-alive cache-control: no-cache, no-store, must-revalidate, max-age=0 content-language: en-us date: thu, 06 dec 2018 17:35:13 gmt expires: thu, 06 dec 2018 17:35:13 gmt server: meinheld/0.6.1 strict-transport-security: max-age=63072000 x-content-type-options: nosniff x-frame-options: deny x-xss-protection: 1; mode=block vary: accept-encoding,cookie x-cache: error from cloudfront <!doctype html...
Control flow and error handling - JavaScript
« previousnext » javascript supports a compact set of statements, specifically control flow statements, that you can use to incorporate a great deal of interactivity in your application.
... in older javascript, variables introduced within a block are scoped to the containing function or script, and the effects of setting them persist beyond the block itself.
... conditional statements a conditional statement is a set of commands that executes if a specified condition is true.
...if the value does not correspond to a month number (1–12), an exception is thrown with the value "invalidmonthno" and the statements in the catch block set the monthname variable to 'unknown'.
Expressions and operators - JavaScript
if x is 3, then ++x sets x to 4 and returns 4, whereas x++ returns 3 and, only then, sets x to 4.
... if x is 3, then --x sets x to 2 and returns 2, whereas x-- returns 3 and, only then, sets x to 2.
... bitwise operators a bitwise operator treats their operands as a set of 32 bits (zeros and ones), rather than as decimal, hexadecimal, or octal numbers.
... 15 | 9 15 1111 | 1001 = 1111 15 ^ 9 6 1111 ^ 1001 = 0110 ~15 -16 ~ 0000 0000 ... 0000 1111 = 1111 1111 ... 1111 0000 ~9 -10 ~ 0000 0000 ... 0000 1001 = 1111 1111 ... 1111 0110 note that all 32 bits are inverted using the bitwise not operator, and that values with the most significant (left-most) bit set to 1 represent negative numbers (two's-complement representation).
Meta programming - JavaScript
handler.setprototypeof() object.setprototypeof() reflect.setprototypeof() if target is not extensible, the prototype parameter must be the same value as object.getprototypeof(target).
... handler.set() property assignment proxy[foo] = bar proxy.foo = bar inherited property assignment object.create(proxy)[foo] = bar {jsxref("reflect.set()")}} cannot change the value of a property to be different from the value of the corresponding target property if the corresponding target property is a non-writable, non-configurable data property.
... cannot set the value of a property if the corresponding target property is a non-configurable accessor property that has undefined as its [[set]] attribute.
... in strict mode, a false return value from the set handler will throw a typeerror exception.
Assertions - JavaScript
if the multiline flag is set to true, also matches immediately after a line break character.
...if the multiline flag is set to true, also matches immediately before a line break character.
... let fruitsstartswitha = fruits.filter(fruit => /^a/.test(fruit)); console.log(fruitsstartswitha); // [ 'apple', 'avocado' ] in the second example ^ is used both for matching at the beginning of input and for creating negated or complemented character sets when used within groups.
...// in this example, two meanings of '^' control symbol are represented: // 1) matching begining of the input // 2) a negated or complemented character set: [^a] // that is, it matches anything that is not enclosed in the brackets.
RangeError: invalid array length - JavaScript
the javascript exception "invalid array length" occurs when creating an array or an arraybuffer which has a length which is either negative or larger or equal to 232, or when setting the array.length property to a value which is either negative or larger or equal to 232.
... an invalid array length might appear in these situations: when creating an array or an arraybuffer which has a length which is either negative or larger or equal to 232, or when setting the array.length property to a value which is either negative or larger or equal to 232.
... otherwise, you might want to clamp the length before setting the length property, or using it as argument of the constructor.
... examples invalid cases new array(math.pow(2, 40)) new array(-1) new arraybuffer(math.pow(2, 32)) new arraybuffer(-1) let a = []; a.length = a.length - 1; // set -1 to the length property let b = new array(math.pow(2, 32) - 1); b.length = b.length + 1; // set 2^32 to the length property valid cases [ math.pow(2, 40) ] // [ 1099511627776 ] [ -1 ] // [ -1 ] new arraybuffer(math.pow(2, 32) - 1) new arraybuffer(0) let a = []; a.length = math.max(0, a.length - 1); let b = new array(math.pow(2, 32) - 1); b.length = math.min(0xffffffff, b.length + 1); // 0xffffffff is the hexadecimal notation for 2^32 - 1 // which can also be written as (-1 >>> 0) ...
Functions - JavaScript
defining method functions getter and setter functions you can define getters (accessor methods) and setters (mutator methods) on any standard built-in object or user-defined object that supports the addition of new properties.
... the syntax for defining getters and setters uses the object literal syntax.
... set binds an object property to a function to be called when there is an attempt to set that property.
... method definition syntax starting with ecmascript 2015, you are able to define own methods in a shorter syntax, similar to the getters and setters.
Array - JavaScript
setting or accessing via non-integers using bracket notation (or dot notation) will not set or retrieve an element from the array list itself, but will set or access a variable associated with that array's object property collection.
... let years = [1950, 1960, 1970, 1980, 1990, 2000, 2010] console.log(years.0) // a syntax error console.log(years[0]) // works properly renderer.3d.settexture(model, 'character.png') // a syntax error renderer['3d'].settexture(model, 'character.png') // works properly in the 3d example, '3d' had to be quoted (because it begins with a digit).
... const fruits = [] fruits.push('banana', 'apple', 'peach') console.log(fruits.length) // 3 when setting a property on a javascript array when the property is a valid array index and that index is outside the current bounds of the array, the engine will update the array's length property accordingly: fruits[5] = 'mango' console.log(fruits[5]) // 'mango' console.log(object.keys(fruits)) // ['0', '1', '2', '5'] console.log(fruits.length) // 6 increasing the length.
... king's pawn forward 2 board[4][4] = board[6][4] board[6][4] = ' ' console.log(board.join('\n')) here is the output: r,n,b,q,k,b,n,r p,p,p,p,p,p,p,p , , , , , , , , , , , , , , , , , , , , , , , , , , , , p,p,p,p,p,p,p,p r,n,b,q,k,b,n,r r,n,b,q,k,b,n,r p,p,p,p,p,p,p,p , , , , , , , , , , , , , , , , , ,p, , , , , , , , , , p,p,p,p, ,p,p,p r,n,b,q,k,b,n,r using an array to tabulate a set of values values = [] for (let x = 0; x < 10; x++){ values.push([ 2 ** x, 2 * x ** 2 ]) } console.table(values) results in // the first column is the index 0 1 0 1 2 2 2 4 8 3 8 18 4 16 32 5 32 50 6 64 72 7 128 98 8 256 128 9 512 162 specifications specification initial publication ecmascript (ecma-262)the definition of 'array' in that specification.
DataView.prototype.getBigInt64() - JavaScript
the getbigint64() method gets a signed 64-bit integer (long long) at the specified byte offset from the start of the dataview.
... syntax dataview.getbigint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from.
... errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getBigUint64() - JavaScript
the getbiguint64() method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the dataview.
... syntax dataview.getbiguint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from.
... errors thrown rangeerror thrown if the byteoffset is set such that it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getFloat32() - JavaScript
the getfloat32() method gets a signed 32-bit float (float) at the specified byte offset from the start of the dataview.
... syntax dataview.getfloat32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getFloat64() - JavaScript
the getfloat64() method gets a signed 64-bit float (double) at the specified byte offset from the start of the dataview.
... syntax dataview.getfloat64(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getInt16() - JavaScript
the getint16() method gets a signed 16-bit integer (short) at the specified byte offset from the start of the dataview.
... syntax dataview.getint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getInt32() - JavaScript
the getint32() method gets a signed 32-bit integer (long) at the specified byte offset from the start of the dataview.
... syntax dataview.getint32(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getInt8() - JavaScript
the getint8() method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the dataview.
... syntax dataview.getint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getUint16() - JavaScript
the getuint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the dataview.
... syntax dataview.getuint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getUint32() - JavaScript
the getuint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the dataview.
... syntax dataview.getuint32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
DataView.prototype.getUint8() - JavaScript
the getuint8() method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the dataview.
... syntax dataview.getuint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
... errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view.
... description there is no alignment constraint; multi-byte values may be fetched from any offset.
Intl.Collator() constructor - JavaScript
this option can be set through an options property or through a unicode extension key; if both are provided, the options property takes precedence.
...this option can be set through an options property or through a unicode extension key; if both are provided, the options property takes precedence.
...this option can be set through an options property or through a unicode extension key; if both are provided, the options property takes precedence.
...this option can be set through an options property or through a unicode extension key; if both are provided, the options property takes precedence.
Intl.Locale.prototype.numberingSystem - JavaScript
ts taml tamil numerals — algorithmic tamldec modern tamil decimal digits telu telugu digits thai thai digits tirh tirhuta digits tibt tibetan digits traditio traditional numerals — may be algorithmic vaii vai digits wara warang citi digits wcho wancho digits examples setting the numberingsystem value via the locale string in the unicode locale string spec, the values that numberingsystem represents correspond to the key nu.
...to set the numberingsystem value via the string argument to the locale constructor, first add the -u extension key.
... let numberingsystemviastr = new intl.locale("fr-latn-fr-u-nu-mong"); console.log(numberingsystemstr.numberingsystem); // prints "mong" setting the numberingsystem value via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
... set the numberingsystem property of the configuration object to your desired numberingsystem value and pass it into the constructor.
JSON.stringify() - JavaScript
all the other object instances (including map, set, weakmap, and weakset) will have only their enumerable properties serialized.
...), new boolean(false)]); // '[3,"false",false]' // string-keyed array elements are not enumerable and make no sense in json let a = ['foo', 'bar']; a['baz'] = 'quux'; // a: [ 0: 'foo', 1: 'bar', baz: 'quux' ] json.stringify(a); // '["foo","bar"]' json.stringify({ x: [10, undefined, function(){}, symbol('')] }); // '{"x":[10,null,null,null]}' // standard data structures json.stringify([new set([1]), new map([[1, 2]]), new weakset([{a: 1}]), new weakmap([[{a: 1}, 2]])]); // '[{},{},{},{}]' // typedarray json.stringify([new int8array([1]), new int16array([1]), new int32array([1])]); // '[{"0":1},{"0":1},{"0":1}]' json.stringify([new uint8array([1]), new uint8clampedarray([1]), new uint16array([1]), new uint32array([1])]); // '[{"0":1},{"0":1},{"0":1},{"0":1}]' json.stringify([new float3...
... issue with plain json.stringify for use as javascript historically, json was not a completely strict subset of javascript.
...sh({ 'name': 'screenc', 'width': 750, 'height': 120 }); session.screens.push({ 'name': 'screend', 'width': 250, 'height': 60 }); session.screens.push({ 'name': 'screene', 'width': 390, 'height': 120 }); session.screens.push({ 'name': 'screenf', 'width': 1240, 'height': 650 }); // converting the json string with json.stringify() // then saving with localstorage in the name of session localstorage.setitem('session', json.stringify(session)); // example of how to transform the string generated through // json.stringify() and saved in localstorage in json object again var restoredsession = json.parse(localstorage.getitem('session')); // now restoredsession variable contains the object that was saved // in localstorage console.log(restoredsession); well-formed json.stringify() engines implem...
Object.defineProperties() - JavaScript
set a function which serves as a setter for the property, or undefined if there is no setter.
... if a descriptor has neither of value, writable, get and set keys, it is treated as a data descriptor.
... if a descriptor has both value or writable and get or set keys, an exception is thrown.
...igurable')) d.configurable = !!desc.configurable; if (hasproperty(desc, 'value')) d.value = desc.value; if (hasproperty(desc, 'writable')) d.writable = !!desc.writable; if (hasproperty(desc, 'get')) { var g = desc.get; if (!iscallable(g) && typeof g !== 'undefined') throw new typeerror('bad get'); d.get = g; } if (hasproperty(desc, 'set')) { var s = desc.set; if (!iscallable(s) && typeof s !== 'undefined') throw new typeerror('bad set'); d.set = s; } if (('get' in d || 'set' in d) && ('value' in d || 'writable' in d)) throw new typeerror('identity-confused descriptor'); return d; } if (typeof obj !== 'object' || obj === null) throw new typeerror('bad obj'); properties = o...
Object.getOwnPropertyDescriptors() - JavaScript
set a function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only).
...e whereas the object.assign() method will only copy enumerable and own properties from a source object to a target object, you are able to use this method and object.create() for a shallow copy between two unknown objects: object.create( object.getprototypeof(obj), object.getownpropertydescriptors(obj) ); creating a subclass a typical way of creating a subclass is to define the subclass, set its prototype to an instance of the superclass, and then define properties on that instance.
... this can get awkward especially for getters and setters.
... instead, you can use this code to set the prototype: function superclass() {} superclass.prototype = { // define your methods and properties here }; function subclass() {} subclass.prototype = object.create( superclass.prototype, { // define your methods and properties here } ); specifications specification ecmascript (ecma-262)the definition of 'object.getownpropertydescriptors' in that specification.
Promise.prototype.finally() - JavaScript
when the promise is settled, i.e either fulfilled or rejected, the specified callback function is executed.
... syntax p.finally(onfinally); p.finally(function() { // settled (fulfilled or rejected) }); parameters onfinally a function called when the promise is settled.
... return value returns a promise whose finally handler is set to the specified function, onfinally.
... description the finally() method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome.
RegExpInstance.lastIndex - JavaScript
property attributes of regexpinstance.lastindex writable yes enumerable no configurable no description this property is set only if the regular expression instance used the g flag to indicate a global search, or the y flag to indicate a sticky search.
... the following rules apply: if lastindex is greater than the length of the string, test() and exec() fail, then lastindex is set to 0.
... if lastindex is equal to the length of the string and if the regular expression does not match the empty string, then the regular expression mismatches input, and lastindex is reset to 0.
... otherwise, lastindex is set to the next position following the most recent match.
RegExp.prototype.test() - JavaScript
r); console.log(result); // true the following example logs a message which depends on the success of the test: function testinput(re, str) { let midstring; if (re.test(str)) { midstring = 'contains'; } else { midstring = 'does not contain'; } console.log(`${str} ${midstring} ${re.source}`); } using test() on a regex with the "global" flag when a regex has the global flag set, test() will advance the lastindex of the regex.
... note: as long as test() returns true, lastindex will not reset—even when testing a different string!
... when test() returns false, the calling regex's lastindex property will reset to 0.
... the following example demonstrates this behaviour: const regex = /foo/g; // the "global" flag is set // regex.lastindex is at 0 regex.test('foo') // true // regex.lastindex is now at 3 regex.test('foo') // false // regex.lastindex is at 0 regex.test('barfoo') // true // regex.lastindex is at 6 regex.test('foobar') //false // regex.lastindex is at 0 // (...and so on) specifications specification ecmascript (ecma-262)the definition of 'regexp.test' in that specification.
Symbol.asyncIterator - JavaScript
if this property is set on an object, it is an async iterable and can be used in a for await...of loop.
... property attributes of symbol.asynciterator writable no enumerable no configurable no examples user-defined async iterables you can define your own async iterable by setting the [symbol.asynciterator] property on an object.
... built-in async iterables there are currently no built-in javascript objects that have the [symbol.asynciterator] key set by default.
... however, whatwg streams are set to be the first built-in object to be async iterable, with [symbol.asynciterator] recently landing in the spec.
Symbol.unscopables - JavaScript
setting a property to true in an unscopables object will make it unscopable and therefore it won't appear in lexical scope variables.
... setting a property to false will make it scopable and thus it will appear in lexical scope variables.
...a built-in unscopables setting is implemented as array.prototype[@@unscopables] to prevent that some of the array methods are being scoped into the with statement.
... var keys = []; with (array.prototype) { keys.push('something'); } object.keys(array.prototype[symbol.unscopables]); // ["copywithin", "entries", "fill", "find", "findindex", // "includes", "keys", "values"] unscopables in objects you can also set unscopables for your own objects.
TypedArray.prototype.subarray() - JavaScript
the begin offset is inclusive and the end offset is exclusive.
...the offset is inclusive.
...the offset is exclusive.
... examples using the subarray method var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] var sub = uint8.subarray(0,4); console.log(sub); // uint8array [ 1, 2, 3, 0 ] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.subarray' in that specification.
Uint8ClampedArray() constructor - JavaScript
the uint8clampedarray() constructor creates a typed array of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead; if you specify a non-integer, the nearest integer will be set.
... syntax new uint8clampedarray(); // new in es2017 new uint8clampedarray(length); new uint8clampedarray(typedarray); new uint8clampedarray(object); new uint8clampedarray(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
JavaScript typed arrays - JavaScript
a view provides a context — that is, a data type, starting offset, and the number of elements — that turns the data into a typed array.
... number (16 significant digits e.g., 1.123...15) unrestricted double double bigint64array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) biguint64array 0 to 264-1 8 64-bit unsigned integer bigint uint64_t (unsigned long long) dataview the dataview is a low-level interface that provides a getter/setter api to read and write arbitrary data to the buffer.
...it is big-endian by default and can be set to little-endian in the getter/setter methods.
... working with complex data structures by combining a single buffer with multiple views of different types, starting at different offsets into the buffer, you can interact with data objects containing multiple data types.
The "codecs" parameter in common media types - Web media technologies
avc1.oo[.ppccll] (avc video) oo is the oti describing the contents, while ppccll is six hexadecimal digits specifying the profile number (pp), constraint set flags (cc), and level (ll).
... the constraint set flags byte is comprised of one-bit boolean flags, with the most significant bit being referred to as flag 0 (or constraint_set0_flag, in some resources), and each successive bit being numbered one higher.
... 56 00 scalable constrained high profile a subset of the scalable high profile designed mainly for real-time communticions.
...this value indicates which set of coefficients to use when mapping from the native red, blue, and green primaries to the luma and chroma signals.
Graphic design for responsive sites - Progressive web apps (PWAs)
serving images selectively via css in general, you will use mostly the same graphical assets for different layouts in a responsive design, but you may well include slightly different ones dependant on context.
...css3 drop shadows and gradients), you may want to simplify or remove certain assets for the site's mobile layout, or even provide smaller assets to suit the smaller screen better.
...so when the page is loaded on a mobile device, the mobile will only download the mobile assets, and not the desktop resource assets.
... high res and low res image copies one option here is to create a hi res and a low res set of images, then use resolution media queries to serve the hi res images only to hi res devices.
Progressive web apps (PWAs)
pwa can be thought of as similar to ajax or other similar patterns that encompass a set of application attributes, including use of specific web technologies and techniques.
... this set of docs tells you all you need to know about them.
... service workers a service worker is a script that allows intercepting and control of how a web browser handles its network requests and asset caching.
... progressive web apps: everything you need to know collection of resources, codelabs and tools you need to build pwas by the team at pwafire.org setting up your progressive web app development environment ...
d - SVG: Scalable Vector Graphics
WebSVGAttributed
moveto path commands moveto instructions can be thought of as picking up the drawing instrument, and setting it down somewhere else—in other words, moving the current point (po; {xo, yo}).
...all subsequent sets of parameters are considered implicit absolute arc curve (a) commands.
...all subsequent sets of parameters are considered implicit relative arc curve (a) commands.
... note: the appearance of a shape closed with closepath may be different to that of one closed by drawing a line to the origin, using one of the other commands, because the line ends are joined together (according to the stroke-linejoin setting), rather than just being placed at the same coordinates.
g1 - SVG: Scalable Vector Graphics
WebSVGAttributeg1
the g1 attribute specifies a list of glyph names which identify a set of possible first glyphs in the kerning pair.
... all glyphs with the given glyph name are included in the set.
... the total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes.
... two elements are using this attribute: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible first glyphs in the kerning pair.
g2 - SVG: Scalable Vector Graphics
WebSVGAttributeg2
the g2 attribute specifies a list of glyph names which identify a set of possible second glyphs in the kerning pair.
... all glyphs with the given glyph name are included in the set.
... the total set of possible second glyphs in the kerning pair is the union of glyphs specified by the u2 and g2 attributes.
... two elements are using this attribute: <hkern> and <vkern> context notes value <name># default value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible second glyphs in the kerning pair.
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.
...text which is not fullwidth will be set with a glyph orientation of 90 degrees.
... note: text set in this "rotated" manner may contain ligatures or other glyph combining and reordering common to the language and script.
... a value of 0deg indicates that all glyphs are set with the top of the glyphs oriented towards the reference orientation.
keySplines - SVG: Scalable Vector Graphics
the keysplines attribute defines a set of bézier curve control points associated with the keytimes list, defining a cubic bézier function that controls interval pacing.
... this attribute is ignored unless the calcmode attribute is set to spline.
... <control-point> each control point description is a set of four values: x1 y1 x2 y2, describing the bézier control points for one time segment.
...thus, there must be one fewer sets of control points than there are keytimes.
keyTimes - SVG: Scalable Vector Graphics
each time value in the keytimes list is specified as a floating point value between 0 and 1 (inclusive), representing a proportional offset into the duration of the animation element.
...the key time associated with each value defines when the value is set; values are interpolated between the key times.
...the time associated with each value defines when the value is set; the animation function uses that value until the next time defined in the list.
... if the calcmode attribute is set to paced, the keytimes attribute is ignored.
u1 - SVG: Scalable Vector Graphics
WebSVGAttributeu1
the u1 attribute specifies list of unicode characters (refer to the description of the unicode attribute of the <glyph> element for a description of how to express individual unicode characters) and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair.
... if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set.
...the total set of possible first glyphs in the kerning pair is the union of glyphs specified by the u1 and g1 attributes.
... two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair.
u2 - SVG: Scalable Vector Graphics
WebSVGAttributeu2
the u2 attribute specifies list of unicode characters (refer to the description of the unicode attribute of the <glyph> element for a description of how to express individual unicode characters) and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair.
... if a given unicode character within the set has multiple corresponding <glyph> elements (i.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set.
...the total set of possible second glyphs in the kerning pair is the union of glyphs specified by the u2 and g2 attributes.
... two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair.
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 defines the location of the referenced object.
... if the reference is to an <altglyphdef> element, then if an appropriate set of alternate glyphs is located from processing the <altglyphdef> element, then those alternate glyphs are rendered instead of the characters that are inside of the <altglyph> element.
... value <iri> default value none animatable no animate, animatecolor, animatemotion, animatetransform, set for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>, xlink:href defines the reference to the element which is the target of this animation and which therefore will be modified over time.
... scalable vector graphics (svg) 1.1 (second edition)the definition of 'href for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>' in that specification.
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
in in2 intercept k k k1 k2 k3 k4 kernelmatrix kernelunitlength kerning keypoints keysplines keytimes l lang lengthadjust letter-spacing lighting-color limitingconeangle local m marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order path pathlength patterncontentunits patterntransform patternunits ping pointer-events points pointsatx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolicy refx refy rel rendering-intent repeatcount...
... repeatdur requiredextensions requiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tabindex tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type u u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v v-alphabetic v-hanging v-ideographic v-ma...
...lood-color, flood-opacity, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight, glyph-orientation-horizontal, glyph-orientation-vertical, image-rendering, kerning, letter-spacing, lighting-color, marker-end, marker-mid, marker-start, mask, opacity, overflow, pointer-events, shape-rendering, stop-color, stop-opacity, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, text-decoration, text-rendering, transform, transform-origin, unicode-bidi, vector-effect, visibility, word-spacing, writing-mode filters attributes filter primitive attributes height, result, width, x, y transfer function attributes type, tablevalues, slope, intercept, amplitude, exponent, offset...
...gend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting graphical event attributes onactivate, onfocusin, onfocusout ...
<feComposite> - SVG: Scalable Vector Graphics
ng the following formula: result = k1*i1*i2 + k2*i1 + k3*i2 + k4 where: i1 and i2 indicate the corresponding pixel channel values of the input image, which map to in and in2 respectively k1, k2, k3 and k4 indicate the values of the attributes with the same name usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes » presentation attributes » filter primitive attributes » class style specific attributes in in2 operator k1 k2 k3 k4 dom interface this element implements the svgfecompositeelement interface.
...sion="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>example fecomposite - examples of fecomposite operations</title> <desc>four rows of six pairs of overlapping triangles depicting the six different fecomposite operators under different opacity values and different clearing of the background.</desc> <defs> <desc>define two sets of six filters for each of the six compositing operators.
... the first set wipes out the background image by flooding with opaque white.
... the second set does not wipe out the background, with the result that the background sometimes shines through and is other cases is blended into itself (i.e., "double-counting").</desc> <filter id="overflood" filterunits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <feflood flood-color="#ffffff" flood-opacity="1" result="flood"/> <fecomposite in="sourcegraphic" in2="backgroundimage" operator="over" result="comp"/> <femerge> <femergenode in="flood"/> <femergenode in="comp"/> </femerge> </filter> <filter id="inflood" filterunits="objectboundingbox" x="-5%" y="-5%" width="110%" height="110%"> <feflood flood-color="#ffffff" flood-opacity="1" result="flood"/> <fecomposite in="sourcegraphic" in2="backgroundi...
<metadata> - SVG: Scalable Vector Graphics
WebSVGElementmetadata
used by hub symbol --> <symbol id="hubplug"> <desc>a 10baset/100basetx socket</desc> <path d="m0,10 h5 v-9 h12 v9 h5 v16 h-22 z"/> </symbol> <!-- hub symbol --> <symbol id="hub"> <desc>a typical 10baset/100basetx network hub</desc> <text x="0" y="15">hub</text> <g transform="translate(0 20)"> <rect width="253" height="84"/> <rect width="229" height="44" x="12" y="10"/> <circle fill="red" cx="227"...
...--> <g id="cablea" transform="translate(107 88)"> <title>cable a</title> <desc>10baset twisted pair cable</desc> <path d="m0,0c100,140 50,140 -8,160"/> </g> <!-- draw cable b.
... --> <g id="cableb" transform="translate(142 88)"> <title>cable b</title> <desc>10baset twisted pair cable</desc> <path d="m0,0c100,180 110,160 159,160"/> </g> <!-- draw cable n.
... --> <g id="cablen" transform="translate(242 88)"> <title>cable n</title> <desc>10baset twisted pair cable</desc> <path d="m0,0c0,-70 20,-50 60,-50"/> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of '<metadata>' in that specification.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
this is different than being hidden by default, as setting the display property won't show the text.
... html,body,svg { height:100% } <svg viewbox="0 0 240 80" xmlns="http://www.w3.org/2000/svg"> <style> .small { font: italic 13px sans-serif; } .heavy { font: bold 30px sans-serif; } /* note that the color of the text is set with the * * fill property, the color property is for html only */ .rrrrr { font: italic 40px serif; fill: red; } </style> <text x="20" y="35" class="small">my</text> <text x="40" y="35" class="heavy">cat</text> <text x="55" y="55" class="small">is</text> <text x="65" y="55" class="rrrrr">grumpy!</text> </svg> attributes x the x coordinate of the starting point of the text baseline.
...tributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expande...
...d, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specification status comment scalable vector graphics (svg)...
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
if the path attribute is set, href has no effect.
... value type: auto|exact ; default value: exact; animatable: yes startoffset how far the beginning of the text should be offset from the beginning of the path.
...ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 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 ...
Namespaces crash course - SVG: Scalable Vector Graphics
however, instead of setting the default namespace, this namespace declaration sets the namespace for something called a "namespace prefix".
...ributens createelement createelementns getattributenode getattributenodens getattribute getattributens getelementsbytagname getelementsbytagnamens (also added to element) getnameditem getnameditemns hasattribute hasattributens removeattribute removeattributens removenameditem removenameditemns setattribute setattributens setattributenode setattributenodens setnameditem setnameditemns the first parameter for all the dom2 namespace aware methods must be the namespace name (also known as the namespace uri) of the element or parameter in question.
...hence to get the value of the xlink:href parameter of an <a> element in svg you would write: elt.getattributens('http://www.w3.org/1999/xlink', 'href'); for setting parameters that have a namespace, it is recommended (but not required) that you also include their prefix in the second parameter so that the dom can later be more easily converted back to xml (if for instance you want to send it back to the server).
... for example: elt.setattributens('http://www.w3.org/1999/xlink', 'xlink:href', 'otherdoc.svg'); as a final example, here's a demonstration of how you should dynamically create an <image> element using script: var svg_ns = 'http://www.w3.org/2000/svg'; var xlink_ns = 'http://www.w3.org/1999/xlink'; var image = document.createelementns(svg_ns, 'image'); image.setattributens(null, 'width', '100'); image.setattributens(null, 'height', '100'); image.setattributens(xlink_ns, 'xlink:href', 'flower.png'); conclusion make sure you always declare the namespaces you use in your xml files.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
nknown svgviewspec removed implementation status unknown svgelement.style removed implementation status unknown svggraphicselement.gettransformtoelement() removed not removed yet svggraphicselement.getctm() on the outermost element implementation status unknown animval attribute alias of baseval implementation status unknown dataset attribute for svgelement implementation status unknown moved pathlength attribute and gettotallength() and getpointatlength() methods from svgpathelement to svggeometryelement implemented (bug 1239100) document structure change notes svgsvgelement.suspendredraw(), svgsvgelement.unsuspendredraw(), and svgsvgelement.unsuspendredrawall() deprecated ...
...mplementation status unknown kerning property removed implementation status unknown path attribute for <textpath> implemented (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 s...
...tatus unknown getcomputedtextlength() not including dx and dy values implementation status unknown text in non-rendered elements not included in addressable characters implementation status unknown unknown elements in text render as unpositioned spans implementation status unknown offset distances of text positioned along a transformed path measured in text elements coordinate system implementation status unknown embedded content change notes <video> implementation status unknown <audio> implementation status unknown <iframe> implementation status unknown <canvas> implementation status unknown <source> implementation status unknown <track> implementat...
... spaces in svg view fragments implementation status unknown pixel: and percent: spatial media fragments implementation status unknown linking to <view> elements does not cause implicit box transformation to show nearest ancestor <svg> element implementation status unknown unspecified svg view fragment parameters don't cause corresponding attributes to be reset to initial values implementation status unknown viewtarget attribute of <view> and corresponding svg view fragment parameter removed implementation status unknown fragment-only urls are always same-document implementation status unknown additional attributes on <a> implemented (bug 1451823) scripting change notes contentscrip...
How to turn off form autocompletion - Web security
disabling autocompletion to disable autocompletion in forms, you can set the autocomplete attribute to "off": autocomplete="off" you can do this either for an entire form, or for specific input elements in a form: <form method="post" action="/form" autocomplete="off"> […] </form> <form method="post" action="/form"> […] <div> <label for="cc">credit card:</label> <input type="text" id="cc" name="cc" autocomplete="off"> </div> </form> setting autoc...
... if a browser keeps on making suggestions even after setting autocomplete to off, then you have to change the name attribute of the input element.
... for this reason, many modern browsers do not support autocomplete="off" for login fields: if a site sets autocomplete="off" for a <form>, and the form includes username and password input fields, then the browser still offers to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page.
... if a site sets autocomplete="off" for username and password <input> fields, then the browser still offers to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page.
Tutorials
you'll set up the tools you need to construct a simple webpage and publish your own simple code.
... html tutorials introductory level introduction to html this module sets the stage, getting you used to important concepts and syntax, looking at applying html to text, how to create hyperlinks, and how to use html to structure a webpage.
... styling text here we look at text styling fundamentals, including setting font, boldness, and italics, line and letter spacing, and drop shadows and other text features.
...we have covered the necessary prerequisites so can now dive deep into css layout, looking at different display settings, traditional layout methods involving float and positioning, and new fangled layout tools like flexbox.
An Overview - XSLT: Extensible Stylesheet Language Transformations
instead they are simply a way of specifying a unique identifier for a known set of elements.
... the string "http://www.w3.org/1999/xsl/transform" is a constant that designates the elements so marked as belonging to the set of tags designated by the w3c in the 1999 xslt recommendation.
... in essence, an xslt stylesheet is a set of rules, called templates, which declare that any node that matches this specific pattern should be manipulated in this specific way and end up in this specific position in the result tree.
... potential conflicts in template matching are resolved by using a set of cascading precedence rules.
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
if you want to override this, you can set the output method normally in the standard way.
... setting parameters you can control parameters for the stylesheet using the xsltprocessor.setparameter(), xsltprocessor.getparameter(), and xsltprocessor.removeparameter() methods.
... these all take a namespace uri and a local name as the first two parameters, with xsltprocessor.setparameter() taking a third - the value of the parameter to be set.
... resetting the xsltprocessor object also implements a xsltprocessor.reset() method, which can be used to remove all stylesheets and parameters then put the processor back into its initial state.
Advanced Example - XSLT: Extensible Stylesheet Language Transformations
the javascript loads the .xsl file only on the first sort and sets the xslloaded variable to true once it has finished loading the file.
...the sorting value is set using xsltprocessor.setparameter().
... the xslt file has a parameter called myorder that javascript sets to change the sorting method.
... // importnode is used to clone the nodes we want to process via xslt - true makes it do a deep clone var mynode = document.getelementbyid("example"); var clonednode = xmlref.importnode(mynode, true); // after cloning, we append xmlref.appendchild(clonednode); // set the sorting parameter in the xsl file var sortval = xsltprocessor.getparameter(null, "myorder"); if (sortval == "" || sortval == "descending") xsltprocessor.setparameter(null, "myorder", "ascending"); else xsltprocessor.setparameter(null, "myorder", "descending"); // initiate the transformation var fragment = xsltprocessor.transformtofragment(xmlref, document); // clear the...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
emscripten environment setup first, let's set up the required development environment.
... prerequisites get the emscripten sdk, using these instructions: https://emscripten.org/docs/getting_started/downloads.html compiling an example with the environment set up, let's look at how to use it to compile a c example to emscripten.
...you need to run your html file through an http server (http://) — see how do you set up a local testing server?
...due to c versus c++ name mangling rules, this would otherwise break, but here we are setting it so that it treats it as an external c function if you are using c++.
Using the WebAssembly JavaScript API - WebAssembly
webassembly memory exposes its bytes by simply providing a buffer getter/setter that returns an arraybuffer.
... tables can be mutated via table.prototype.set(), which updates one of the values in a table, and table.prototype.grow(), which increases the number of values that can be stored in a table.
... this allows the indirectly-callable set of functions to change over time, which is necessary for dynamic linking techniques.
...es to your code in the indicated place: var tbl = results.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 this code accesses each function reference stored in the table in turn, and instantiates them to print the values they hold to the console — note how each function reference is retrieved with a table.prototype.get() call, then we add an extra set of parentheses on the end to actually invoke the function.
Interacting with page scripts - Archive of obsolete content
any of them, even setters and getters, could have been redefined by a page script.
...to do this, add an option called “unsafe-content-script” under the “permissions” key in package.json, and set it to true.
...r tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta charset="utf-8"> </head> <body> <input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcusto...
Modules - Archive of obsolete content
each compartment has a set of privileges that determines what scripts running in that compartment can and cannot do.
...compartments are very useful from a security point of view: each compartment has a set of privileges that determines what a script running in that compartment can and cannot do.
... the sandbox constructor takes a url parameter, which is used to determine the set of privileges for the compartment in which the sandbox will be created.
system - Archive of obsolete content
var system = require("sdk/system"); system.exit(); parameters code : integer to exit with failure, set this to 1.
... for example: // get firefox profile path var profilepath = require('sdk/system').pathfor('profd'); // get os temp files directory (/tmp) var temps = require('sdk/system').pathfor('tmpd'); // get os desktop path for an active user (~/desktop on linux // or c:\documents and settings\username\desktop on windows).
... you can get the value of an environment variable by accessing the property with that name: var system = require("sdk/system"); console.log(system.env.path); you can test whether a variable exists by checking whether a property with that name exists: var system = require("sdk/system"); if ('path' in system.env) { console.log("path is set"); } you can set a variable by setting the property: var system = require("sdk/system"); system.env.foo = "bar"; console.log(system.env.foo); you can unset a variable by deleting the property: var system = require("sdk/system"); delete system.env.foo; you can't enumerate environment variables.
High-Level APIs - Archive of obsolete content
clipboard interact with the system clipboard, setting and getting its contents.
... selection get and set text and html selections in the current web page.
... timers set one-off and periodic timers.
system/environment - Archive of obsolete content
access, set and clear environment variables.
...usage var { env } = require('sdk/system/environment'); you can get the value of an environment variable, by accessing the property with the name of the desired variable: var path = env.path; you can check for the existence of an environment variable by checking whether a property with that variable name exists: console.log('path' in env); // true console.log('foo' in env); // false you can set the value of an environment variable by setting the property: env.foo = 'foo'; env.path += ':/my/path/' you can unset an environment variable by deleting the property: delete env.foo; limitations there is no way to enumerate existing environment variables, also env won't have any enumerable properties: console.log(object.keys(env)); // [] environment variable will be unset, show up as non-...
...existing if it's set to null, undefined or ''.
ui/sidebar - Archive of obsolete content
<!doctype html> <html> <head> <link href="stuff.css" type="text/css" rel="stylesheet"> </head> <body> <script type="text/javascript" src="stuff.js"></script> </body> </html> you can update the sidebar's content by setting the sidebar's url property.
... here's a simple but complete add-on that shows how to set up communication between main.js and a script in a sidebar, in the case where the sidebar script initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file sends a ping message to main.js using port.emit() as soon as...
... here's a simple but complete add-on that shows how to set up communication between main.js and a script in a sidebar, in the case where the main.js script initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file listens to the ping message from main.js, and responds with ...
util/collection - Archive of obsolete content
usage a collection is ordered, like an array, but its items are unique, like a set.
...setting the property to a scalar value empties the collection and adds the value.
... setting it to an array empties the collection and adds all the items in the array.
window/utils - Archive of obsolete content
features object map of features to set for the window, defined like this: { width: 10, height: 15, chrome: true }.
... features string map of features to set for the window, defined like: { width: 10, height: 15, chrome: true }.
... for the set of features you can set, see the window.opendialog documentation.
Creating annotations - Archive of obsolete content
it is initially off: var matchedelement = null; var originalbgcolor = null; var active = false; function resetmatchedelement() { if (matchedelement) { (matchedelement).css('background-color', originalbgcolor); (matchedelement).unbind('click.annotator'); } } self.on('message', function onmessage(activation) { active = activation; if (!active) { resetmatchedelement(); } }); this selector listens for occurrences of the jquery mouseenter event.
... $('*').mouseenter(function() { if (!active || $(this).hasclass('annotated')) { return; } resetmatchedelement(); ancestor = $(this).closest("[id]"); matchedelement = $(this).first(); originalbgcolor = $(matchedelement).css('background-color'); $(matchedelement).css('background-color', 'yellow'); $(matchedelement).bind('click.annotator', function(event) { event.stoppropagation(); event.preventdefault(); self.port.emit('show', [ document.location.tostring()...
..., $(ancestor).attr("id"), $(matchedelement).text() ] ); }); }); conversely, the add-on resets the matched element on mouseout: $('*').mouseout(function() { resetmatchedelement(); }); save this code in a new file called selector.js in your add-on's data directory.
Drag & Drop - Archive of obsolete content
dropping files onto an xul application it's possible to setup drag and drop events to handle dropping files from external applications or os file managers onto your xul-based application.
...next, setup the handlers so that files can be dropped on the application: function _dragover(aevent) { var dragservice = components.classes["@mozilla.org/widget/dragservice;1"].getservice(components.interfaces.nsidragservice); var dragsession = dragservice.getcurrentsession(); var supported = dragsession.isdataflavorsupported("text/x-moz-url"); if (!supported) supported = dragsession.isdataflavorsupported("application/x-moz-file"); if (supported) dragsession.candrop = true; } function _dragdrop(aevent) { var dragservice = components.clas...
...service;1"].getservice(components.interfaces.nsidragservice); var dragsession = dragservice.getcurrentsession(); var _ios = components.classes['@mozilla.org/network/io-service;1'].getservice(components.interfaces.nsiioservice); var uris = new array(); // if sourcenode is not null, then the drop was from inside the application if (dragsession.sourcenode) return; // setup a transfer item to retrieve the file data var trans = components.classes["@mozilla.org/widget/transferable;1"].createinstance(components.interfaces.nsitransferable); trans.adddataflavor("text/x-moz-url"); trans.adddataflavor("application/x-moz-file"); for (var i=0; i<dragsession.numdropitems; i++) { var uri = null; dragsession.getdata(trans, i); var flavor = ...
HTML to DOM - Archive of obsolete content
r, we're going to load our html document first: var request = xmlhttprequest(); request.open("get", "http://example.org/file.html", false); request.send(null); our next step is to create the document object that will represent the dom into which we'll insert our newly-retrieved html: var doc = document.implementation.createhtmldocument("example"); doc.documentelement.innerhtml = request.responsetext; after this any manipulation that we might want to do will be something as simple as the following: doc.body.textcontent = "this is inside the body!"; using a hidden iframe element to parse html to a window's dom sample code may need more work.
... var frame = document.getelementbyid("sample-frame"); if (!frame) { // create frame frame = document.createelement("iframe"); // iframe (or browser on older firefox) frame.setattribute("id", "sample-frame"); frame.setattribute("name", "sample-frame"); frame.setattribute("type", "content"); frame.setattribute("collapsed", "true"); document.getelementbyid("main-window").appendchild(frame); // or // document.documentelement.appendchild(frame); // set restrictions as needed frame.webnavigation.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 using browser element instead of iframe frame.parentnode.removechild(frame); // or set location "about:blank" // frame.contentdocument.location.href = "about:blank"; },10); }, true); } // load a page frame.co...
Sidebar - Archive of obsolete content
resizing the sidebar programmatically in case you need to change the width of the sidebar, use the following code: function setsidebarwidth(newwidth) { var mainwindow = window.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsidocshelltreeitem) .roottreeitem .queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsidomwindow); mainwindow.document.getelementbyid("sidebar-b...
...ox").width=newwidth; } or function setsidebarwidth(newwidth) { window.top.document.getelementbyid("sidebar-box").width=newwidth; } you can also disable the ability to resize it manually, using the mouse, by hiding the sidebar's splitter element.
... for this snippet to work, you have to declare mainwindow as in the previous code block then write: mainwindow.document.getelementbyid("sidebar-splitter").hidden = true; be aware that if you change the splitter's hidden attribute, you need to reset it to a safe value when your sidebar is closed, or replaced by another sidebar.
Code snippets - Archive of obsolete content
xml file i/o code used to read, write and process files drag & drop code used to setup and handle drag and drop events dialogs code used to display and process dialog boxes alerts and notifications modal and non-modal ways to notify users preferences code used to read, write, and modify preferences js xpcom code used to define and call xpcom components in javascript running applications code used to run other applications <canvas> related what wg canvas-related code ...
... rosetta by default, the only possible standardized scripting language for html is ecmascript.
...ion animate svg using javascript and smil svg interacting with script using javascript and dom events to create interactive svg embedding svg in html and xul using svg to enhance html or xul based markup xul widgets html in xul for rich tooltips dynamically embed html into a xul element to attain markup in a tooltip label and description special uses and line breaking examples tree setup and manipulation of trees using xul and js scrollbar changing style of scrollbars.
Communication between HTML and your extension - Archive of obsolete content
i set the onblur action to a little javascript function that performed a standard ajax request to get a result.
... the onreadystatechange was set to another little javascript function that would update a specific element on the html page with the result.
...as a last ditch effort i tried setting a timeout using settimeout when i got the event in the extension to wait a few milliseconds before looking for the desired element.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
this article describes how to set up the development environment for a large, complex firefox extension with any or all of the above-mentioned requirements.
...module and xpi_name are both set to the name of your extension; they should be repeated in all project makefiles so that all of the files land in the same place in the xpi staging area (see below).
...if so, try setting the moz_no_remote environment variable to "1" before running the development version of firefox.
Migrating from Internal Linkage to Frozen Linkage - Archive of obsolete content
use .setlength() instead: nsstring mystring = somestring; - mystring.truncate(4); + mystring.setlength(4); the frozen string api doesn't support the iterator or const_iterator classes, but you can use pointers the same way: nsstring mystring = somestring; - nsstring::const_iterator begin, end;- mystring.beginreading(begin); mystring.endreading(end); + const prunichar *begin, *end;+ mystring.beginread...
...ewisupportsarray(getter_addrefs(array)); + array = do_createinstance(ns_supportsarray_contractid); - nscomptr<nsiinputstream> rawstream;- rv = ns_newbyteinputstream(getter_addrefs(rawstream),- (const char*)data, length); + nscomptr<nsistringinputstream> rawstream =+ do_createinstance(ns_stringinputstream_contractid, &rv);+ ns_ensure_success(rv, rv);++ rv = rawstream->setdata((const char*)data, length); ns_ensure_success(rv, rv); nsistringinputstream is not frozen (and thus, not available in the gecko sdk as currently published).
...#define compare(str1, str2, comp) (str1).compare(str2, comp) #define last() endreading()[-1] #define setcharat(c, i) replace(i, 1, ch) #define ns_newisupportsarray(result) callcreateinstance(ns_supportsarray_contractid, static_cast<nsisupportsarray**>(result)); ideally we would switch to nsimutablearray, but in the mean time there's no point changing the same code twice.
Chapter 1: Introduction to Extensions - Archive of obsolete content
but we didn't set out to create an all-in-one browser that can satisfy everyone.
... the add-ons manager handles the following tasks: safely installs and uninstalls add-ons makes sure add-ons are compatible with the version of firefox you're using manages a whitelist of sites trusted for installing add-ons helps troubleshoot add-ons by disabling them and offering a safe mode confirms and runs updates provides access to add-ons' settings dialogs provides access to add-ons' support sites development environment amenities initially, there wasn't adequate documentation available, and extension developers were largely left to fend for themselves1; however, now there's a considerable store of knowledge.
... tab mix plus offers detailed tab-related settings.
Appendix D: Loading Scripts - Archive of obsolete content
flexibility: script tags provide a means to specify the character set and javascript version of the scripts to be loaded, which many other methods do not.
...this behavior can be reversed by setting the wantsxrays parameter to false when constructing the sandbox.
... flexibility: the sub-script loader can load scripts into a variety of different namespaces for a wide variety of uses, and as of gecko 2 allows the character set of the script to be specified.
Observer Notifications - Archive of obsolete content
you should normally set the third parameter to false.
...you may notice that we explicitly set the interface of the asubject object to nsisupportsstring using the queryinterface method.
... this is because the first parameter of the observe method is typed as nsisupports (the generic interface, as seen before), therefore its properties and methods cannot be accessed unless the correct interface is set to it.
Updating addons broken by private browsing changes - Archive of obsolete content
moziasyncfavicons/nsifaviconservice: setandfetchfaviconforpage/setandloadfaviconforpage now take a required privacy status argument, either nsifaviconservice.favicon_load_private or nsifaviconservice.favicon_load_non_private.
... nsicontentprefservice: getpref, setpref, haspref, hascachedpref, removepref, removegroupedprefs, removeprefsbyname, getprefs, and getprefsbyname all take a required nsiloadcontext argument to indicate the privacy status of the pref in question.
... nsihttpauthmanager: setauthidentity and getauthidentity now take an optional boolean parameter to indicate whether the identity is classified as private.
Creating a status bar extension - Archive of obsolete content
the chrome is the set of user interface elements outside the content area of the application's window, such as toolbars, status bars, menu bars, and the like.
...rlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="status-bar-sample-1" label="hello world" tooltiptext="sample status bar item" /> </statusbar> </overlay> the first order of business in the status-bar-sample-1.xul file is to establish that this is in fact a xul file, and to set up a unique id for the overlay.
...we include properties to configure our new status bar panel the way we want, setting its text label to "hello world" and establishing a tool tip with the message "sample status bar item" in it.
Environment variables affecting crash reporting - Archive of obsolete content
the following environment variables affect crash reporting: moz_crashreporter_url sets the url that the crash reporter will submit reports to.
... additionally, on mac os x, you can set an application default setting to allow apple's crash reporter tool to run alongside the breakpad crash reporter.
... run this on the command line: defaults write org.mozilla.firefox oscrashreporter 1 note that you will get two crash dialogs with this setting, one from the os and one from mozilla.
Images, Tables, and Mysterious Gaps - Archive of obsolete content
of course, documents authored in xhtml strict or html strict will trigger the "standards" rendering mode, so we're going to go through two basic ways to address the problem in strict documents, and a number of ways to call on these "fixes." setting images to be blocks the first choice, and one that will work for most graphically-intense designs, is to convert the image from being an inline element to a block-level element.
...should this property be adopted, then any browser supporting it could emulate traditional "shrinkwrap" behavior without risking other layout upset with the following rule: td {line-box-contain: font replaced;} /* proposed for css3 */ there are other possible fixes contained within the current css3 working drafts, such as line-height-policy.
... recommendations absent support for css3, it is difficult to provide a clear set of steps for fixing every instance of these problems, because the best solution for a given document will greatly depend on its structure.
Source code directories overview - Archive of obsolete content
caps contains c interfaces and code for determining the capabilities of content based on the security settings and certificates (e.g.
...essentially, it is a a set of interfaces for a platform-independent device (drawing) context.
...it contains code for various character sets, locale formats (e.g.
Visualizing an audio spectrum - Archive of obsolete content
dedmetadata', loadedmetadata, false); // fft from dsp.js, see below var fft = function(buffersize, samplerate) { this.buffersize = buffersize; this.samplerate = samplerate; this.spectrum = new float32array(buffersize/2); this.real = new float32array(buffersize); this.imag = new float32array(buffersize); this.reversetable = new uint32array(buffersize); this.sintable = new float32array(buffersize); this.costable = new float32array(buffersize); var limit = 1, bit = buffersize >> 1; while ( limit < buffersize ) { for ( var i = 0; i < limit; i++ ) { this.reversetable[i + limit] = this.reversetable[i] + bit; } limit = l...
... bit = bit >> 1; } for ( var i = 0; i < buffersize; i++ ) { this.sintable[i] = math.sin(-math.pi/i); this.costable[i] = math.cos(-math.pi/i); } }; fft.prototype.forward = function(buffer) { var buffersize = this.buffersize, costable = this.costable, sintable = this.sintable, reversetable = this.reversetable, real = this.real, imag = this.imag, spectrum = this.spectrum; if ( buffersize !== buffer.length ) { throw "supplied buffer is not the same size as defined fft.
... fft size: " + buffersize + " buffer size: " + buffer.length; } for ( var i = 0; i < buffersize; i++ ) { real[i] = buffer[reversetable[i]]; imag[i] = 0; } var halfsize = 1, phaseshiftstepreal, phaseshiftstepimag, currentphaseshiftreal, currentphaseshiftimag, off, tr, ti, tmpreal, i; while ( halfsize < buffersize ) { phaseshiftstepreal = costable[halfsize]; phaseshiftstepimag = sintable[halfsize]; currentphaseshiftreal = 1.0; currentphaseshiftimag = 0.0; for ( var fftstep = 0; fftstep < halfsize; fftstep++ ) { i = fftstep; while ( i < buffersize ) {...
Getting Started - Archive of obsolete content
setup download the latest version of mozilla, install it (install the dom inspector as well), and select the classic skin.
...now all of the css and images are extracted, but if you make some changes and run mozilla as it is, you will not see them because it's still set to look at the files in the jar files.
...this version is set to 1.0, so this skin will only work in versions of mozilla 1.0.
In-Depth - Archive of obsolete content
a bunch of 20px x 20px icons in a grid format above is the source image of some icons setup to use the -moz-image-region style.
...inside of the xml file there is an image which has its class set to toolbar-primary-icon.
...set the background-image to a url of your choosing, such as url("chrome://navigator/skin/icons/dino.png");.
Extension Frequently Asked Questions - Archive of obsolete content
this is quick set of answers to the most common issues with extension development.
... be sure to set the development preferences.
... before asking for help, be sure to set the debugging prefs and check the error console for related messages.
Helper Apps (and a bit of Save As) - Archive of obsolete content
four primary tasks: sets up temporary file and instantiate the nsihelperapplauncherdialog in onstartrequest.
... nsexternalapphandler::onstoprequest set a flag that we're done, then do whatever the user wants if the user has decided (save to disk and open in helper are the current options the user has).
... possibly reflecting the os settings in our helper app preferences (readonly?
Twitter - Archive of obsolete content
for instance, some twitter methods have an id parameter, so you would define an id property and set its value to a user's id.
...user info jetpack.lib.twitter.users.show({ id: "mozlabs", success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.responsetext) }); friends of a user jetpack.lib.twitter.statuses.friends({ id: "mozlabs", page: 3, success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.responsetext) }); trends jetpack.lib.twitter.trends({ success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.resp...
...onsetext) }); searching jetpack.lib.twitter.search({ q: "#jetpack", lang: "ja", rpp: 10, page: 5, since_id: 1337, success: function (data, status) console.log(data.tosource()), error: function (xhr, errmsg, errobj) console.error(xhr.responsetext) }); ...
First run - Archive of obsolete content
a manifest is simply an object set to a variable named manifest.
... it's the same manifest you use when defining settings for your jetpack.
...this example sets the first-run page to some html: var manifest = { firstrunpage: '<p>thanks for installing!
First Run - Archive of obsolete content
a manifest is simply an object set to a variable named manifest.
...it's the same manifest you use when defining settings for your jetpack.
...this example sets the first-run page to some html: var manifest = { firstrunpage: '<p>thanks for installing!
Simple Storage - Archive of obsolete content
for the most part this object is like any other javascript object, and a jetpack can set whatever properties it wants on it.
... if there are no notes, we'll show a// disabled "(empty)" menuitem.function updatejetpackmenu() { jetpack.menu.set({ label: "notes", menu: new jetpack.menu(notes.length > 0 ?
...:(jetpack.menu.context.page.beforeshow = function (menu) { menu.reset(); if (jetpack.selection.text) menu.add({ label: "note", command: function () { notes.unshift(jetpack.selection.text); if (notes.length > 20) notes.pop(); updatejetpackmenu(); } });};// initialize the jetpack menu with the current notes.updatejetpackmenu(); see also settings jep 11 ...
Selection - Archive of obsolete content
features can get, set, and listen for selection events in html or plain text.
...this api currently lives in the future and must be imported for use: jetpack.future.import("selection"); getting and setting the selection the current version of jetpack.selection includes these formats: .text and .html getting the selection the following is an example of getting the selection from the user.
... jetpack.import.future("selection");var textofsel = jetpack.selection.text;var htmlofsel = jetpack.selection.html; setting the selection the following is an example of getting the selection from the user.
Selection - Archive of obsolete content
features can get, set, and listen for selection events in html or plain text.
...this api currently lives in the future and must be imported for use: jetpack.future.import("selection"); getting and setting the selection the current version of jetpack.selection includes these formats: .text and .html getting the selection the following is an example of getting the selection from the user.
... jetpack.import.future("selection"); var textofsel = jetpack.selection.text; var htmlofsel = jetpack.selection.html; setting the selection the following is an example of getting the selection from the user.
Selection - Archive of obsolete content
ArchiveMozillaJetpackdocsUISelection
features can get, set, and listen for selection events in html or plain text.
...this api currently lives in the future and must be imported for use: jetpack.future.import("selection"); getting and setting the selection the current version of jetpack.selection includes these formats: .text and .html getting the selection the following is an example of getting the selection from the user.
... jetpack.import.future("selection"); var textofsel = jetpack.selection.text; var htmlofsel = jetpack.selection.html; setting the selection the following is an example of getting the selection from the user.
Metro browser chrome tests - Archive of obsolete content
for information on setting your local build as the default, visit the windows 8 integration wiki page.
...a simple test looks like this: gtests.push({ desc: "test loading about:blank", setup: function () { }, teardown: function () { }, run: function () { yield addtab("about:blank"); is(tab.browser.currenturi.spec, "about:blank", "about:blank is loaded"); } }); function test() { runtests(); } gtests contains individual tests that make up the library of tests your test file will contain.
...setup(), teardown(), and run() each have individual exception handlers to prevent one method from interfering with the execution of another.
Plugin Architecture - Archive of obsolete content
it is not set in stone.
...(the event is necessary because by the time hasnewframe is called, the frame isn't fully set up yet) in layout note: some of this should move to content an instance owner is created the window passed to the plugin is adjusted (the npwindow, http://devedge-temp.mozilla.org/libr...nt.html#999221) the plugin host is asked to instantiate the plugin this will call back to the instance owner / the object frame in order to create a widget to draw to (if the plugin is not windowless) n...
...splugininstanceowner::setwindow setwindow is called on the plugin ...
Space Manager High Level Design - Archive of obsolete content
if so, the vertical space that has been affected (including both the float's old region and the float's new region) is noted in the internal nsintervalset as potential float damage (the method is includeindamage).
... getavailablespace is called on the blockreflowstate the blockreflowstate calls getavailablespace on its blockbanddata instance (which was setup in the blockreflowstate's constructor based on the space manager passed in and computed content area).
...should be private (compiles fine) nsblockframe::paint is mucking with nsblockbanddata in and #if 0 block - remove that and the include (compiles fine) nsspacemanger has no way of clearing the float damage interval set - this might be needed if the spacemanager persists beyond a reflow original document information author(s): marc attinasi other contributors: alex savulov, chris waterson, david baron, josh soref last updated date: november 20, 2005 ...
Supporting per-window private browsing - Archive of obsolete content
to do this, observe the last-pb-context-exiting notification and set the data field of the nsisupportsprbool subject to true.
...var channel = services.io.newchannel("http://example.org", null, null); channel.queryinterface(components.interfaces.nsiprivatebrowsingchannel); channel.setprivate(true); // force the channel to be loaded in private mode similarly, xmlhttprequest objects created via createinstance(ci.nsixmlhttprequest) will often require explicit adjustment, since they have no context from which to derive a privacy status.
... var xhr = components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createinstance(components.interfaces.nsixmlhttpreqeust); var channel = xhr.channel.queryinterface(components.interfaces.nsiprivatebrowsingchannel); channel.setprivate(true); ...
Table Layout Regression Tests - Archive of obsolete content
avoid the nasty assertions to pop up by set xpcom_debug_break=warn, the world would be a much better place if we could first fix those assertions.
... as you will probably run your normal mozilla in parallel with the testing issue then: set moz_no_remote=1 at the command prompt.
...0x1]enum top: 1[0x1]enum right: 1[0x1]enum bottom: 1[0x1]enum left: null top: null right: null bottom: null left: null top: null right: null bottom: null 1[0x1]enum 0" /> <list data="100 100 " /> <position data="left: auto top: auto right: auto bottom: auto auto 0[0x0]tw null auto 0[0x0]tw null 0 auto " /> <text data="0 0 0 normal normal 0[0x0]tw normal " /> <textreset data="0 10[0xa]enum " /> <display data="0 1 0 0 0 0 0 0 0 0 0 0 " /> <visibility data="0 1 1.000000" /> <table data="0 0 4 -1 1 " /> <tableborder data="1 null null 0 2 " /> <content data="0 0 0 null " /> <quotes data="0 " /> <ui data="3 0 0 1 " /> <uireset data="7 0 4" /> <xul data="0 0 0 0 0 1 <svg data="0 1.000000 1.000000 0 1.000000" /> </stylecont...
Treehydra Manual - Archive of obsolete content
a value used in the analysis script that represents a set of concrete values.
...conceptually, this is an object used in the analysis that represents a set of concrete states.
...this is a special abstract state the represents the empty set of concrete states.
getFolder - Archive of obsolete content
there are two sets of possible values for this parameter.
... the first set contains platform-independent locations; the second set contains platform-specific locations.
...see the list in the description section for the two sets of locations.
Methods - Archive of obsolete content
patch applies a set of differences between two versions.
... reseterror resets a saved error code to zero.
... setpackagefolder sets the default package folder that is saved with the root node.
allowevents - Archive of obsolete content
by setting the allowevents attribute to true, this special behavior is disabled, and the events are targeted the same as other elements.
...instead, the allowevents may be set to true on a descendant instead.
...for the latter, the allowevents attribute is set to true to have a click on the child button receive events instead of targeting all events at the menu.
browser.type - Archive of obsolete content
the type of browser, which can be used to set access of the document loaded inside the browser.
... if this is not set, the loaded document has the same access as the window containing the browser.
... warning: the type attribute must be set before the element is inserted into the document.
checkState - Archive of obsolete content
this means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state.
... if you wish to have different behavior for how the states are adjusted, set the autocheck attribute to false and adjust the state with a script.
... the type attribute must be set to checkbox for buttons with a check state.
disabled - Archive of obsolete content
if this attribute is set, the element is disabled.
...do not set the attribute to true, as this will suggest you can set it to false to enable the element again, which is not the case.
... // disabling an element document.getelementbyid('buttonremove').setattribute("disabled", "disabled"); // enabling back an element by removing the "disabled" attribute document.getelementbyid('buttonremove').removeattribute("disabled"); firefox 3.5 note for keyset elements, support for this attribute was added in firefox 3.5.
panel.level - Archive of obsolete content
if this attribute is not set, the popup window level depends on the platform.
...if a panel has one or more text fields, this attribute should not be set, otherwise ime or on-screen keyboard popups will appear incorrectly.
... for these reasons, you should avoid setting the level if not needed.
tooltiptext - Archive of obsolete content
« xul reference home tooltiptext type: string used to set the text which appears in the tooltip when the user moves the mouse over the element.
... this can be used instead of setting the tooltip to a popup for the common case where it contains only text.
... the tooltip is displayed in a default tooltip which displays only a label, however the default tooltip may be changed by setting the default attribute on a tooltip element.
value - Archive of obsolete content
be aware, however, that some elements, such as textbox will display the value visually, so in order to merely associate data with an element, you could 1) use another attribute like "value2" or "data-myatt" (as in the html5 draft), as xul does not require validation (less future-proof); 2) use setattributens() to put custom attributes in a non-xul namespace (serializable and future-proof); 3) use setuserdata() (future-proof and clean, but not easily serializable).
... for user editable menulist elements, the contents, as visible to the user, are read and set using the menulist.value syntax.
... for those elements, setattribute("value", myvalue) and getattribute("value") do not access or affect the contents displayed to the user.
Attribute (XUL) - Archive of obsolete content
nlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeynavigation disablesecurity dlgtype dragging editable editortype element empty emptytext deprecated since gecko 2 enablecolumndrag enablehistory equalsize eventnode events expr ...
...oreincolumnpicker ignorekeys image inactivetitlebarcolor increment index inputtooltiptext insertafter insertbefore instantapply inverted iscontainer isempty key keycode keytext label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput on...
...load onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpopuphiding onpopupshowing onpopupshown onsearchcomplete onselect ontextcommand ontextentered ontextrevert ontextreverted onunload onwizardback onwizardcancel onwizardfinish onwizardnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selectedindex seltype setfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll ...
How to implement a custom XUL query processor component - Archive of obsolete content
we are not really using the datasources in our sample component, so we set it to a dummy value.
... rulematched: function(aquery, arulenode) { }, // the output for a result has been removed and the result is no longer being used by the builder hasbeenremoved: function() { } }; // basic wrapper for nsisimpleenumerator function templateresultset(aarrayofdata) { this._index = 0; this._array = aarrayofdata; } templateresultset.prototype = { queryinterface: xpcomutils.generateqi([components.interfaces.nsisimpleenumerator]), hasmoreelements: function() { return this._index < this._array.length; }, getnext: function() { return new templateresult(this._array[this._index++]); } }; // the query processor class - implem...
... // eventually we should read the <query> to create filters return this._data; }, generateresults: function(adatasource, aref, aquery) { // preform any query and pass the data to the result set return new templateresultset(this._data); }, addbinding: function(arulenode, avar, aref, aexpr) { // add a variable binding for a particular rule, which we aren't using yet }, translateref: function(adatasource, arefstring) { // if we return null, everything stops return new templateresult(null); }, compareresults: function(aleft, aright, avar) { // -1 less, 0 =...
appendNotification - Archive of obsolete content
the type property must also be set to "menu", or "menu-button".
...if no button has this set, the first button in the array is the default.
...valid values are "menu-button" and "menu" which must be set if the button is to provide a popup via the popup property.
MenuModification - Archive of obsolete content
this value be set as the menuitem's value attribute and can be used for whatever purpose is desired.
...also, need replace newmenu.label= "new" by newmenu.setattribute("label", "new"); (all when creating from bootstrap.js in a bootstrapped addon) the addsubmenu function is called during the popupshowing event, which will be fired when an attempt to open the menu is made.
...the label is set appropriately, and now, as we have a menu, we can use the appenditem method to append two items to the submenu.
canAdvance - Archive of obsolete content
« xul reference canadvance type: boolean this property is set to true if the user can press the next button to go to the next page.
...set this property to true to indicate that the user can go to the next page.
... set to false to disallow moving to the next page.
canRewind - Archive of obsolete content
« xul reference canrewind type: boolean this property is set to true if the user can press the back button to go to the previous page.
...set this property to true to indicate that the user can go back a page.
... set to false to disallow moving to the previous page.
Attribute Substitution - Archive of obsolete content
it can also be used to separate a variable with normal text: <label value="?name" class="?gender^german"/> these last two examples have been setting the class attribute on a label.
...in a stylesheet, you could set properties for each of these classes such that different values appear differently without having to use multiple rules.
...thus, if you use a variable set in a binding, you must ensure the datasource is loaded before the template is built, or just rebuild the template.
Multiple Rules - Archive of obsolete content
by setting the negate attribute to true, the condition matches only those that don't match the condition, reversing the results that match.
...you can disable this for a where clause by setting the ignorecase attribute to true.
...you can do this with the multiple attribute set to true.
RDF Query Syntax - Archive of obsolete content
the value of ?start is set to 'http://www.xulplanet.com/rdf/a'.
...the seed is actually an internal variable set to the container, in this case, the vbox, and the ?start variable is set to the ref later, but that is a minor detail that doesn't make templates more understandable.
...recall the data in the potential results set: (?start = http://www.xulplanet.com/rdf/a) this was the seed data created by the content statement.
Simple Example - Archive of obsolete content
first, we set the datasources and ref attributes as needed: <vbox datasources="template-guide-ex2.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> this time, we need to use a new statement, the member condition as well as a triple.
... <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> the seed is set in a similar manner as the previous examples, effectively creating a single result with the ?start variable set to the reference resource 'http://www.xulplanet.com/rdf/myphotos'.
...there's only one result so far; the member element's container attribute is set to value of the ?start variable of this result.
Box Model Details - Archive of obsolete content
layout examples using spacers example 3 : source view <hbox> <button label="one"/> <spacer style="width: 5px"/> <button label="two"/> </hbox> here, a spacer is used as a separator between the two buttons, by setting an explicit width of 5 pixels.
... you could also set margins using the css margin property.
...because we don't want the find button to change size, we need to set an alignment.
Creating a Window - Archive of obsolete content
we'll add some of these in the next set of sections.
... note: the local xul document can be opened in the browser as mentioned above only if |dom.allow_xul_xbl_for_file| preference in "about:config" has been set to |true| .
... if it does not exist, then it needs to be created and set to |true|.
Features of a Window - Archive of obsolete content
if you only specify one, the other will be set to 0.
... to have the window set its size automatically, leave both the width and height out.
...you may disable a feature by setting it to 'no', for example 'dialog=no'.
Introduction to RDF - Archive of obsolete content
resource description framework we can use the tree elements to display a set of data, such as bookmarks or mail messages.
...it contains a fairly simple set of elements.
...a bookmarks list contains a set of records, each with a set of data associated with it, such as a url, a bookmark title and a visited date.
Introduction to XBL - Archive of obsolete content
the basic appearance of all elements, such as scroll bars and check boxes may be modified by adjusting the style or by setting attributes on the element.
...an xbl file contains a set of bindings.
...you assign a binding to an element by setting the css property -moz-binding to the url of the bindings file.
List Controls - Archive of obsolete content
set it to the number of rows to display in the list box.
...use the label attribute to set the label for the header cell.
...you can use the crop attribute on the cells or items set to the value none to disable the ellipsis.
More Button Features - Archive of obsolete content
by setting this attribute to the value reverse, the image will be placed on the right side of the text.
...however, in this case you must set the type attribute to the value menu.
...you can also set the type attribute to the value menu-button.
Property Files - Archive of obsolete content
a property file contains a set of strings.
...<stringbundleset id="stringbundleset"> <stringbundle id="strings" src="strings.properties"/> </stringbundleset> including this element will read the properties from the file 'strings.properties' in the same directory as the xul file.
... use a chrome url to read a file from the locale: <stringbundleset id="stringbundleset"> <stringbundle id="strings" src="chrome://myplugin/locale/strings.properties"/> </stringbundleset> like other non-displayed elements, you should declare all your stringbundles inside a stringbundleset element so that they are all kept together.
Simple Menu Bars - Archive of obsolete content
this means that you could create a vertical menubar by setting the orient attribute to vertical.
...this attribute can be set to either true or false.
...this attribute can be set to either true or false where the latter is the default.
XBL Attribute Inheritance - Archive of obsolete content
its value should be set to a comma-separated list of attribute names that are to be inherited.
...this technique is used to set the default value if the attribute is not present.
...to set the value attribute on the label, we need to use a different attribute name and map it to the value.
XML - Archive of obsolete content
when we say language, we mean that developers create a set of terms, orlexicon, and a relationship between these terms, or what some people call agrammar.
... as a set of interface-defining tags, xulis the widgets its tags describe.
... xul is little beyond the set of tags used to define interface widgets, the relationship between them, or grammar, and some built-in flexibility for using extra resources like images, html elements, and other standards-based technologies.
XUL Coding Style Guidelines - Archive of obsolete content
to make xul files easy to read and maintain, localization friendly, and portable across user agents, we need to have a set of coding style guidelines to ensure our objectives are achievable.
... the author has collected a set of guidelines from various sources listed in the references section.
...--> <!-- entity homebtn.label "home" --> properties files are very similar, but use the pound sign instead of <!--<var>xxxxx</var>-->: # localization note entity name : content we recognize that translation is a subset of localization even though we've consistently referred to our notes as "localization note".
action - Archive of obsolete content
one descendant of the action body should have a uri attribute set to the member variable.
... examples example needed attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
bbox - Archive of obsolete content
ArchiveMozillaXULbbox
it is equivalent to using an hbox element with an align attribute set to baseline.
... examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hid...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
bindings - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] used to specify a set of variable bindings for a rule.
... examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width object type: string the object of the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
broadcaster - Archive of obsolete content
for menuitems or buttons that just want to have their disabled status set when the feature should be disabled, you should use a command element instead.
... examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
content - Archive of obsolete content
propiedades tag, uri ejemplos (no son necesarios) atributos inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width propiedades tag type: tag name this may be set to a tag name.
... if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata relacionados tbd ...
deck - Archive of obsolete content
ArchiveMozillaXULdeck
attributes selectedindex properties selectedindex, selectedpanel examples <deck selectedindex="2"> <description value="this is the first page"/> <button label="this is the second page"/> <box> <description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> attributes selectedindex type: integer gets and sets the index of the currently selected panel.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties selectedindex type: integer returns the index of the currently selected item.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related stack ...
groupbox - Archive of obsolete content
properties accessibletype examples <groupbox> <caption label="settings"/> <radiogroup> <radio label="black and white"/> <radio label="colour"/> </radiogroup> <checkbox label="enabled"/> </groupbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, inserta...
...fter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsiaccessibleprovider ...
observes - Archive of obsolete content
when an observed attribute is modified on the broadcaster, the attribute's value will be forwarded and set on the parent element of the observer.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
resizer - Archive of obsolete content
typetype: stringset this to the value "window" for a resizing grip that appears in the bottom corner of the window, used for resizing the window.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
titlebar - Archive of obsolete content
if you don't want this behavior, you can override it by setting allowevents="true" on the titlebar element.
...file:///users/markus/sites/hudwindow.xul", "", "chrome=1, titlebar=0") attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width note: the allowevents attribute did not work for title bars prior to firefox 3.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
treerow - Archive of obsolete content
attributes properties examples (example needed) attributes properties type: space-separated list of property names sets the properties of the element, which can be used to style the element.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, ...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecols, treecol, treechildren, treeitem, treecell and treeseparator.
treeseparator - Archive of obsolete content
attributes properties examples (example needed) attributes properties type: space-separated list of property names sets the properties of the element, which can be used to style the element.
... inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, ...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecols, treecol, treechildren, treeitem, treerow and treecell.
Building XULRunner with Python - Archive of obsolete content
development machine setup first a word of warning that zonealarm has exhibited memory leaks that cause build machines to crash with rather spurious errors.
...if you plan to checkout often into empty folders you could modify it to set the cvsroot environment variable.
... set cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot having created amozilla project directory (e.g.c:\projects\mozilla or/c/projects/mozilla in msys) create the following .mozconfig file.
Make your xulrunner app match the system locale - Archive of obsolete content
then set the locale preference.
... the following is python code to set this preference.
... from xpcom import components ps_cls = components.classes["@mozilla.org/preferences-service;1"] ps = ps_cls.getservice(components.interfaces.nsiprefservice) branch = ps.getbranch("general.useragent.") branch.setcharpref("locale", lang) i also set the language environment variable to match the system locale so that python's gettext functionality will work (it pulls straight from language instead of using setlocale): os.environ["language"] = lang ...
XULRunner tips - Archive of obsolete content
the following prefs must also be set to make the xpinstall dialog, extension manager, and theme manager work: pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallconfirm.xul"); pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul?type=themes"); pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul?type=extensions"); pref("xpinstal...
...0 jar:inspector.jar!/skin/modern/inspector/ skin inspector classic/1.0 jar:inspector.jar!/skin/classic/inspector/ overlay chrome://inspector/content/popupoverlay.xul chrome://inspector/content/viewers/dom/popupoverlay.xul overlay chrome://inspector/content/commandoverlay.xul chrome://inspector/content/viewers/stylerules/commandoverlay.xul overlay chrome://inspector/content/keysetoverlay.xul chrome://inspector/content/viewers/dom/keysetoverlay.xul overlay chrome://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 lik...
...without these settings password manager will not store login details.
Windows and menus in XULRunner - Archive of obsolete content
it has attributes to set the title/caption as well as to control its width and height.
...you can add a <commandset> and <command> elements like this: <commandset> <command id="cmd_open" label="&file.open;" oncommand="dofileopen();"/> <command id="cmd_save" label="&file.save;" oncommand="dofilesave();"/> </commandset> ...
... see also xul:windows xul tutorial:creating a window commandset command xul tutorial:commands xul tutorial:simple menu bars xul tutorial:toolbars « previousnext » original document information author: mark finkle last updated date: october 2, 2006 ...
calICalendarViewController - Archive of obsolete content
the calievent should have its enddate set to aendtime, if this parameter is specified.
... otherwise, it should be set to a default value, as determined by the application.
... the other values of the calievent (title, summary, alarm, etc) should likewise be set to defaults.
Gecko Compatibility Handbook - Archive of obsolete content
set up browsers for testing the various gecko-based browsers do not always contain netscape in the user-agent string.
...if this works, set up your detection to serve ie 6 content to visitors with gecko in their user-agent strings.
...later versions did support netscape 6; however, in netscape 6.1 and higher, support for internet explorer's proprietary offsetxxx properties results in hiermenu placing popups in the wrong position.
Mozilla release FAQ - Archive of obsolete content
when i try to use cvs on windows, i get an error about no home directory you need to set the home environment variable to a valid directory, as cvs was designed with unix in mind, and wants to put a file in your home directory (the password file) i'm on a unix system, and still am having problems building here's a brief guide to common build problems: cc1: invalid option 'foo' cc: no such file or directory 'foo' these are almost always caused by your platform-specific makefile being...
...use that to launch mozilla for you -- it sets ld_library_path automatically.
...you can find the binaries at mozilla.org's binaries page on win32, it fails to build, with the message '.\win32' unexpected you didn't properly set the environment variables -- you must not include a space at the end of the set statements (be careful if you are cut'n'pasting).
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.accessibility - oct 6, 2006 announcements legal precedent set for web accessibility us federal court rules that retailers may be sued if its website is inaccsessible.
... discussions w3c sets road map for web app accessibility the w3c introduced its wai-aria (web accessibility initiative for accessible rich internet applications) roadmap--a set of guidelines for developers to make accessible web content.
... this set of documents tackles some of the difficulties that ajax has been causing with regards to accessibility.
Logging Multi-Process Plugins - Archive of obsolete content
your safest bet is your home directory (c:\users\username on windows vista and above, c:\documents and settings\username on windows xp, and ~ (home directory) on mac os x and linux).
...from within a command prompt: c:\> set nspr_log_modules=ipcplugins:5 c:\> set nspr_log_file=c:\plugins.log c:\> cd c:\program files\mozilla firefox c:\> firefox.exe the log file will be saved to c:\plugins.log (or wherever nspr_log_file is set).
...from within a bash shell: $ export nspr_log_modules=ipcplugins:5 $ export nspr_log_file=~/plugins.log $ /usr/bin/firefox the file will be saved to ~/plugins.log (or wherever nspr_log_file is set).
NPEvent - Archive of obsolete content
: point; modifiers: integer; end; xwindows typedef xevent npevent; fields npevent on microsoft windows the data structure has the following fields: event one of the following event types: wm_paint wm_lbuttondown wm_lbuttonup wm_lbuttondblclk wm_rbuttondown wm_rbuttonup wm_rbuttondblclk wm_mbuttondown wm_mbuttonup wm_mbuttondblclk wm_mousemove wm_keyup wm_keydown wm_setcursor wm_setfocus wm_killfocus for information about these events, see the microsoft windows developer documentation.
... if your plug-in wants to set the cursor when the mouse is within the instance, set the cursor and return true.
...as the xevents sent to the plug-in are synthesized and there is not a native window corresponding to the plug-in rectangle, some of the members of the xevent structures are not set to their normal xserver values.
NPFullPrint - Archive of obsolete content
the npfullprint structure is used when the mode field of npprint is set to np_full.
...if you want the plug-in to take complete control of the printing process, it should print the full page and set the field pluginprinted to true before returning.
... if you want an embedded plug-in to simply render its area of the page, set pluginprinted to false and return immediately; the browser calls npp_print again with the npembedprint substructure of npprint.
NPP_HandleEvent - Archive of obsolete content
instead, the windowed plug-in draws into the graphics port associated with the the browser window, at the offset that the browser specifies.
...when npp_handleevent is called, the current port is set up so that its origin matches the top-left corner of the plug-in.
... a plug-in does not need to set up the current port for mouse coordinate translation.
NPP_Print - Archive of obsolete content
it uses the print mode set in the npprint structure in its printinfo parameter to determine whether the plug-in should print as an embedded plug-in or as a full-page plug-in.
...for an embedded plug-in, set the printinfo field to npembedprint.
...for a full-page plug-in, set the printinfo field to npfullprint or null.
Table Reflow Internals - Archive of obsolete content
review of reflow the reflowee sets various sizes in the reflow metrics after (possibly) reflowing some or all of its children which reflows it children, etc.
... special height reflow the reflow state holds an observer and initiator observer is the table cell used as the height basis set by frame without computed height in didreflow gives its block a computed height during 3rd pass doesn't change height during 3rd pass initiator is the table containing the observer starts the 3rd pass reflow and sets a bit in the reflow state gives its block a computed height during 3rd pass could also be inside a cell which is an observer special height reflow optimizations only frames n...
...if the page is incomplete then the page sequence creates a continuation for the page and sets it as the page's next sibling (it is also the page's nextinflow).
Developing cross-browser and cross-platform pages - Archive of obsolete content
opera 6+ allows users to set the browser identification string via a menu internet explorer uses the windows registry safari, konqueror and icab browsers can mask their browser identity under internet explorer or netscape labels a user or browser distributor can put what they want in the navigator.useragent string and this may trick your code into executing a "wrong" block of code.
...if the style object exists on the element, then it sets that object's visibility property.
... the browser will not error if you set this unimplemented property, so you do not need to check that the visiblity property itself exists.
-moz-stack-sizing - Archive of obsolete content
/* keyword values */ -moz-stack-sizing: auto; -moz-stack-sizing: ignore; /* global values */ -moz-stack-sizing: inherit; -moz-stack-sizing: initial; -moz-stack-sizing: unset; if you wish to prevent the stack from resizing automatically to accommodate its children, you can set -moz-stack-sizing to ignore on the child element.
... the property is set not on the stack itself, but on the stack's children.
... note: in previous versions of gecko it was possible to work around the problem by setting very large negative bottom and right margins on the stack element and equally large positive bottom and right margins on the children whose size you didn't want to ignore.
-ms-wrap-margin - Archive of obsolete content
the -ms-wrap-margin css property is a microsoft extension that specifies a margin that offsets the inner wrap shape from other shapes.
... remarks offsets created by the -ms-wrap-margin property are offset from the outside of the exclusion.
... this property can be set to any supported length value.
::-ms-ticks-after - Archive of obsolete content
to show them, set the control's display property to block.
...to do so would create three sets of tick marks, but the best user experience is one set.
... to remove tick marks altogether, set the color property to transparent.
::-ms-ticks-before - Archive of obsolete content
to show them, set the control's display property to block.
...to do so would create three sets of tick marks, but the best user experience is one set.
... to remove tick marks altogether, set the color property to transparent.
Object.prototype.__noSuchMethod__ - Archive of obsolete content
if this method cannot be called, either as if undefined by default, if deleted, or if manually set to a non-function, the javascript engine will revert to throwing typeerrors.
... // example base class 1 function namedthing(name) { this.name = name; } namedthing.prototype = { getname: function() { return this.name; }, setname: function(newname) { this.name = newname; } } // example base class 2 function agedthing(age) { this.age = age; } agedthing.prototype = { getage: function() { return this.age; }, setage: function(age) { this.age = age; } } // child class.
... inherits from namedthing and agedthing // as well as defining address function person(name, age, address){ addparent(this, namedthing.prototype); namedthing.call(this, name); addparent(this, agedthing.prototype); agedthing.call(this, age); this.address = address; } person.prototype = { getaddr: function() { return this.address; }, setaddr: function(addr) { this.address = addr; } } var bob = new person('bob', 25, 'new york'); console.log('getage is ' + (('getage' in bob) ?
Object.prototype.watch() - Archive of obsolete content
you can usually use setters and getters or proxies instead.
... description watches for assignment to a property named prop in this object, calling handler(prop, oldval, newval) whenever prop is set and storing the return value in that property.
... if you delete a property for which a watchpoint has been set, that watchpoint does not disappear.
Troubleshooting XForms Forms - Archive of obsolete content
if form controls are within repeat, check that you are using attribute nodeset for the repeat instead of attribute ref.
... if your binding expression contains a /, look for any containing xf:group, xf:repeat, xf:input or other elements that set the context node.
... repeat and tables not working unfortunately you cannot do: <table> <xf:repeat nodeset="..."> <tr> ...
Examples - Game development
experience both available on 2d screens and on vr hmds (settings / switch to vr mode).
... katan.io html5 and canvas implementation of settlers of catan.
... explosion and chain reaction exploding particles that set off other explosions.
Implementing game control mechanisms - Game development
setting up the environment let's start with a quick overview of the game's folder structure, javascript files and in-game states, so we know what's happening where.
...the first one initializes phaser, the second preloads all the assets, the third one controls the main menu welcoming the player, and the fourth controls the actual gameplay.
...the first one is needed for preloading required assets, create() is executed once the state had started, and update() is executed on every frame.
Buttons - Game development
add the following lines to the bottom of your create() function: startbutton = game.add.button(game.world.width*0.5, game.world.height*0.5, 'button', startgame, this, 1, 0, 2); startbutton.anchor.set(0.5); the button() method's parameters are as follows: the button's x and y coordinates the name of the graphic asset to be displayed for the button a callback function that will be executed when the button is pressed a reference to this to specify the execution context the frames that will be used for the over, out and down events.
... now we need to define the startgame() function referenced in the code above: function startgame() { startbutton.destroy(); ball.body.velocity.set(150, -150); playing = true; } when the button is pressed, we remove the button, sets the ball's initial velocity and set the playing variable to true.
... finally for this section, go back into your create() function, find the ball.body.velocity.set(150, -150); line, and remove it.
Visual typescript game engine - Game development
client config if you want web app without any networking then setup: appusenetwork: boolean = false; you want to use communication for multiplayer but you don't want to use server database account sessions.
... the setup this on false in main client config class.
... */ private appusenetwork = false; /** * appuseaccountssystem if you don't want to use session * in your application just setup this variable to the false.
Client hints - MDN Web Docs Glossary: Definitions of Web-related terms
client hints are a set of http request header fields for proactive content negotiation allowing clients to indicate a list of device and agent specific preferences.
... client hints enable automated delivery of optimized assets like the automatic negotiation of image dpr resolution.
...in the second example, the server gives the browser the hints by setting the accept-ch meta tag.
Conditional - MDN Web Docs Glossary: Definitions of Web-related terms
a condition is a set of rules that can interrupt normal code execution or change it, depending on whether the condition is completed or not.
... an instruction or a set of instructions is executed if a specific condition is fulfilled.
...it is also possible to repeat the execution of an instruction, or set of instructions, while a condition is not yet fulfilled.
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
to enable concurrent downloads of assets exceeding that limit, domain sharding splits content across multiple subdomains.
... when multiple domains are used to serve multiple assets, browsers are able to download more resources simultaneously, resulting in a faster page load time and improved user experience.
...as browsers limit the number of active connections per domain, serving all the required resources from a single domain could be slow as assets need to be downloaded sequentially.
Unicode - MDN Web Docs Glossary: Definitions of Web-related terms
unicode is a standard character set that numbers and defines characters from the world's different languages, writing systems, and symbols.
...for example, one character set would store japanese characters, and another would store the arabic alphabet.
... if it was not clearly marked which parts of the data were in which character set, other programs and computers would display the text incorrectly, or damage it during processing.
caret - MDN Web Docs Glossary: Definitions of Web-related terms
on the web, a caret is used to represent the insertion point in <input> and <textarea> elements, as well as any elements whose contenteditable attribute is set, thereby allowing the contents of the element to be edited by the user.
... learn more general knowledge caret navigation on wikipedia css related to the caret you can set the color of the caret for a given element's editable content by setting the element's css caret-color property to the appropriate <color> value.
... <input type="text"> <input type="password"> <input type="search"> <input type="date">, <input type="time">, <input type="datetime">, and <input type="datetime-local"> <input type="number">, <input type="range"> <input type="email">, <input type="tel">, and <input type="url"> <textarea> any element with its contenteditable attribute set ...
Pseudo-classes and pseudo-elements - Learn web development
previous overview: building blocks next the next set of selectors we will look at are referred to as pseudo-classes and pseudo-elements.
...we have set this to display: block in order that we can style it with a width and height.
... :default matches the one or more ui elements that are the default among a set of similar elements.
Grids - Learn web development
gaps between tracks to create gaps between tracks we use the properties grid-column-gap for gaps between columns, grid-row-gap for gaps between rows, and grid-gap to set both at once.
... the minmax() function lets us set a minimum and maximum size for a track, for example minmax(100px, auto).
...we do this by setting the value of grid-template-columns using repeat() notation, but instead of passing in a number, pass in the keyword auto-fill.
Supporting older browsers - Learn web development
display: inline-block this method can be used to create column layouts, if an item has display: inline-block set but then becomes a flex or grid item, the inline-block behaviour is ignored.
...items that have css table layouts set on them will lose this behaviour if they become flex or grid items.
... if we add a feature query to the above example, we can use it to set the widths of our items back to auto if we know that we have grid support.
CSS layout - Learn web development
we have covered the necessary prerequisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy techniques you might still want to know about.
... 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.
...you imagine your layout as a set number of columns (e.g.
Styling text - Learn web development
here we look at text styling fundamentals including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features.
... fundamental text and font styling in this article we go through all the basics of text/font styling in detail, including setting font weight, family and style, font shorthand, text alignment and other effects, and line and letter spacing.
... typesetting a community school homepage in this assessment we'll test your understanding of styling text by getting you to style the text for a community school's homepage.
Learn to style HTML using CSS - Learn web development
you should have a basic work environment set up as detailed in installing basic software and understand how to create and manage files, as detailed in dealing with files — both of which are parts of our getting started with the web complete beginner's module.
...here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows and other text features.
...we have covered the necessary prerequisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy techniques you might still want to know about.
How much does it cost to do something on the Web? - Learn web development
this cost varies depending on: local obligations: some country top-level domain names are more costly, as different countries set different prices.
...“packaged” hosting when you want to publish a website, you could do everything by yourself: set up a database (if needed), content management system, or cms (like wordpress, dotclear, spip, etc.), upload pre-made or your own templates.
... next steps now that you understand what kind of money your website may cost you, it's time to start designing that website and setting up your work environment.
Example - Learn web development
a payment form html content <form method="post"> <h1>payment form</h1> <p>required fields are followed by <strong><abbr title="required">*</abbr></strong>.</p> <section> <h2>contact information</h2> <fieldset> <legend>title</legend> <ul> <li> <label for="title_1"> <input type="radio" id="title_1" name="title" value="a"> ace </label> </li> <li> <label for="title_2"> <input type="radio" id="title_2" name="title" value="k" > king </label> </li> <li> <label for="title_3"> <input type="radio" id="title_3" name="title" value="q...
..."> queen </label> </li> </ul> </fieldset> <p> <label for="name"> <span>name: </span> <strong><abbr title="required">*</abbr></strong> </label> <input type="text" id="name" name="username"> </p> <p> <label for="mail"> <span>e-mail: </span> <strong><abbr title="required">*</abbr></strong> </label> <input type="email" id="mail" name="usermail"> </p> <p> <label for="pwd"> <span>password: </span> <strong><abbr title="required">*</abbr></strong> </label> <input type="password" id="pwd" name="password"> </p> </section> <section> <h2>payment information</h2> <p> <label for="card"> <span>card type:</span> <...
... inline-block; width: 120px; text-align: right; } input, textarea { font: 1em sans-serif; width: 250px; box-sizing: border-box; border: 1px solid #999; } input[type=checkbox], input[type=radio] { width: auto; border: none; } input:focus, textarea:focus { border-color: #000; } textarea { vertical-align: top; height: 5em; resize: vertical; } fieldset { width: 250px; box-sizing: border-box; margin-left: 136px; border: 1px solid #999; } button { margin: 20px 0 0 124px; } label { position: relative; } label em { position: absolute; right: 5px; top: 20px; } result ...
Dealing with files - Learn web development
dealing with files discusses some issues you should be aware of so you can set up a sensible file structure for your website.
... styles folder: this folder will contain the css code used to style your content (for example, setting text and background colors).
... <!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
a version control system, to manage files on servers, collaborate on a project with a team, share code and assets and avoid editing conflicts.
...in this article, we'll just set you up with a bare minimum — a text editor and some modern web browsers.
...you can find out how to do this in how do you set up a local testing server?
Publishing your website - Learn web development
the available feature set will be limited, but it might be perfect for your first experiments.
... these options are usually free, but you may outgrow the limited feature-set.
...however, the features are limited, and these apps usually don't provide hosting space for assets (like images).
Getting started with the Web - Learn web development
you'll set up the tools you need to construct a simple webpage and publish your own simple code.
...dealing with files explains how to set up a sensible file structure for your website and what issues you should be aware of.
...for example, is my content a set of paragraphs or a list of bullet points?
Mozilla splash page - Learn web development
to complete this section you'll need to insert an <img> element inside each one containing appropriate src, alt, srcset and sizes attributes.
... note: to properly test the srcset/sizes examples, you'll need to upload your site to a server (using github pages is an easy and free solution), then from there you can test whether they are working properly using browser developer tools such as the firefox network monitor.
...glitch is probably better for this example, as it allows you upload assets like images, whereas some of the other tools don't.
Making asynchronous programming easier with async and await - Learn web development
there is a pattern that can mitigate this problem — setting off all the promise processes by storing the promise objects in variables, and then awaiting them all afterwards.
...both of them start off with a custom promise function that fakes an async process with a settimeout() call: function timeoutpromise(interval) { return new promise((resolve, reject) => { settimeout(function(){ resolve("done"); }, interval); }); }; then each one includes a timetest() async function that awaits three timeoutpromise() calls: async function timetest() { ...
... in the fast-async-await.html example, timetest() looks like this: async function timetest() { const timeoutpromise1 = timeoutpromise(3000); const timeoutpromise2 = timeoutpromise(3000); const timeoutpromise3 = timeoutpromise(3000); await timeoutpromise1; await timeoutpromise2; await timeoutpromise3; } here we store the three promise objects in variables, which has the effect of setting off their associated processes all running simultaneously.
Test your skills: Events - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
... events 3 in our final events-related task, you need to set an event listener on the <button>s' parent element (<div class="button-bar"> ...
... </div>), which when invoked by clicking any of the buttons will set the background of the button-bar to the color contained in the button's data-color attribute.
JavaScript object basics - Learn web development
setting object members so far we've only looked at retrieving (or getting) object members — you can also set (update) the value of object members by simply declaring the member you want to set (using dot or bracket notation), like this: person.age = 45; person['name']['last'] = 'cratchit'; try entering the above lines, and then getting the members again to see how they've changed, like so: pers...
...on.age person['name']['last'] setting members doesn't just stop at updating the values of existing properties and methods; you can also create completely new members.
... try these in the js console: person['eyes'] = 'hazel'; person.farewell = function() { alert("bye everybody!"); } you can now test out your new members: person['eyes'] person.farewell() one useful aspect of bracket notation is that it can be used to set not only member values dynamically, but member names too.
Adding a new todo form: Vue events, methods, and models - Learn web development
we can set the initial value of the label to an empty string.
...v-model binds to the data property you set on it and keeps it in sync with the <input>.
...but this is easy to fix — because we're using v-model to bind the data to the <input> in todoform, if we set the name parameter to equal an empty string, the input will update as well.
Handling common accessibility problems - Learn web development
note: this technique will only work if you set your original event handlers via event handler properties (e.g.
... you should make sure interactive elements like buttons and links have appropriate focus/hover/active states set, to give the user visual clues as to their function.
... previous overview: cross browser testing next in this module introduction to cross browser testing strategies for carrying out testing handling common html and css problems handling common javascript problems handling common accessibility problems implementing feature detection introduction to automated testing setting up your own test automation environment ...
Client-side tooling overview - Learn web development
parcel is a particularly clever tool that fits into this category — it can do the above tasks, but also helps to package assets like html, css, and image files into convenient bundles that you can then go on to deploy, and also adds dependencies for you automatically whenever you try to use them.
... typescript: typescript is a superset of javascript that offers a bunch of additional features.
... it often takes some time for new developer tools to settle down in their complexity.
Mozilla accessibility architecture
each of these accessible nodes supports at minimum the generic cross-platform accessibility interface nsiaccessible (which provides a text name, enumerated role identifier and a set of state flags) and sometimes additional interfaces.
...accessible tree contains only a subset of nodes from the dom tree not all dom nodes are exposed through accessibility api toolkits -- only those objects deemed important by the developers of the toolkit.
... above: a diagram showing that the msaa tree is a subset of the dom tree.
Mozilla's Section 508 Compliance
the default theme, classic, uses the operating system's font and color contrast settings.
...the default theme, classic, uses gnome's font and color contrast settings.
... (j) when a product permits a user to adjust color and contrast settings, a variety of color selections capable of producing a range of contrast levels shall be provided.
Mozilla’s UAAG evaluation report
the uaag document contains a very rich set of accessibility guidelines, that broadly define how accessibility should be implemented by any user agent, i.e.
... zooming can be controlled via hotkeys ctrl+plus and ctrl+minus the prefs are at preferences, appearances, fonts there is also a hidden pref line that can be added to prefs.js, if you just want to change the minimum font size for a certain font: user_pref("font.minimum-size.x-western", newfontsizeinpoints); 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 4.2 configure font family.
...(p1) vg provides a focus outline box highlights follow graphical rendering conventions for windows does not highlight selected images we do not have the ability to show a border around the text selection we have the following focus appearance prefs that are not exposed in the ui, but can be manually inserted in the user's prefs.js file: setboolpref("browser.display.use_focus_colors", usefocuscolors); /* true or false */ setcharpref("browser.display.focus_background_color", colorstring); /* for example #ffeedd or the name of a color */ setcharpref("browser.display.focus_text_color", colorstring); setcharpref("browser.display.focus_ring_width", numpixels); /* integer 0-4 */ 10.3 distinct default highlight styles.
Accessible Toolkit Checklist
abel) automatically define mnemonics for all standard common dialogs (like yes/no confirmations and retry/exit error dialogs) support mnemonics in dialogs created via method calls layout engine - drawing underline under correct letter events - making keystrokes do the right thing msaa support, via iaccessible's get_acckeyboardshortcut support for ms windows settings when high contrast checkbox is set (in accessibility control panel, spi_gethighcontrast), or when user selects a "native" skin option in your software, then get all look and feel from current os skin.
...l/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 caret pay attention to 'route mouse pointer to default button' setting it's possible that the user wants mnemonics hidden except when the alt key is pressed.
...for autocomplete lists, use the system color offset by 1, so that it looks active but the list items don't get echoed while they user's trying to simply type and edit.
Theme concepts
e, you wanted to tile a centrally justified image, such as to create this effect here you specify the weta image like this: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta_for_tiling.png"] }, and the images tiling with: "properties": { "additional_backgrounds_alignment": [ "top" ], "additional_backgrounds_tiling": [ "repeat" ] }, full details of how to setup this theme can be found in the themes example weta_tiled.
...mages, 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 top" ] }, full details of how to setup this theme can be found in the themes example weta_mirror.
...theme_frame: 'sun.jpg', }, colors: { frame: '#cf723f', tab_background_text: '#111', } }, 'night': { images: { theme_frame: 'moon.jpg', }, colors: { frame: '#000', tab_background_text: '#fff', } } }; the theme.theme object is then passed to theme.update() to change the header theme, as in this code snippet from the same example: function settheme(theme) { if (currenttheme === theme) { // no point in changing the theme if it has already been set.
Cookies Preferences in Mozilla
network.cookie.cookiebehavior default value: 0 0 = accept all cookies by default 1 = only accept from the originating site (block third party cookies) 2 = block all cookies by default 3 = use p3p settings (note: this is only applicable to older mozilla suite and seamonkey versions.) 4 = storage access policy: block cookies from trackers network.cookie.lifetimepolicy default value: 0 0 = accept cookies normally 1 = prompt for each cookie (prompting was removed in firefox 44) 2 = accept for current session only 3 = accept for n days network.cookie.lifetime.days default value: 90 only ...
...used if network.cookie.lifetimepolicy is set to 3 sets the number of days that the lifetime of cookies should be limited to.
... network.cookie.alwaysacceptsessioncookies default value: false only used if network.cookie.lifetimepolicy is set to 1 true = accepts session cookies without prompting false = prompts for session cookies network.cookie.thirdparty.sessiononly default value: false true = restrict third party cookies to the session only false = no restrictions on third party cookies network.cookie.maxnumber default value: 1000 configures the maximum amount of cookies to be stored valid range is from 0-65535, rfc 2109 and 2965 require this to be at least 300 network.cookie.maxperhost default value: 50 configures the maximum amount of cookies to be stored per host valid range is from 0-65535, rfc 2109 and 2965 require this to be at least 20 network.cookie.disablecookieformailnews default value: ...
Creating reftest-based unit tests
to run all the reftests, go to the directory where you save firefox's source code and run: ./mach reftest if you want to run a particular set of reftests, pass the path as an argument: ./mach reftest path/from/sourcedir/reftest.list and to run a single reftest just pass the path to the test file (not the reference file): ./mach reftest path/from/sourcedir/reftest-name.html there is no reftest equivalent to mach mochitest --keep-open, but temporarily adding the reftest-wait class to a test (or disabling the script that removes it) ...
...it would be possible to try and wait for the initial rendering to be done using a settimeout, but that would be unreliable, and just as bad, it can increase the time it takes to run a test many times over (which when you're running thousands of tests can really slow things down).
...the event bubbles up to the document and window so you can set listeners there too.
Debugging Table Reflow
it can be invoked by set gecko_block_debug_flags=reflow the available options are: reflow really-noisy-reflow max-element-size space-manager verify-lines damage-repair lame-paint-metrics lame-reflow-metrics disable-resize-opt these options can be combined with a comma separated list messages generated by the reflow switch: block(div)(1)@00be5ac4: reflowing dirty lines computedwidth=9000 computedheight=1500 this message is generated inside of nsresult nsbl...
...the first line of the data dump shows that no width has yet been assigned to the columns mcolwidths=-1 -1 -1 -1, -1 stands for: #define width_not_set -1 this is followed by a reference to the column frame pointers: col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 this is followed by the information which width has been set for each column.
...e to col spans #define pct 6 // percent width of cell or col #define pct_adj 7 // percent width of cell or col from percent colspan #define min_pro 8 // desired width due to proportional <col>s or cols attribute #define final 9 // width after the table has been balanced, considering all of the others in the last log snippet none of these width's has been set.
Old Thunderbird build
windows build prerequisites gnu/linux build prerequisites mac os x build prerequisites get the source note: on windows, you won't be able to build the thunderbird source code if it's under a directory with spaces in the path (e.g., don't use "documents and settings").
...on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
... building thunderbird and lightning if you've set up your build environment as above, then all you need to do is: echo 'ac_add_options --enable-calendar' >> mozconfig in the comm-central directory, or just add the ac_add_options --enable-calendar line to your mozconfig with your favorite editor.
Simple SeaMonkey build
(if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'.
... # get the source # for aurora, use https://hg.mozilla.org/releases/comm-aurora/ and comm-aurora instead # for beta, use https://hg.mozilla.org/releases/comm-beta/ and comm-beta instead # for release, use https://hg.mozilla.org/releases/comm-release/ and comm-release instead hg clone https://hg.mozilla.org/comm-central/ cd comm-central python client.py checkout # set up a basic .mozconfig file echo 'ac_add_options --enable-application=suite' > .mozconfig # let's build seamonkey...
... on windows, the above commands will create the comm-central directory in %userprofile% which may be some subfolder of c:\documents and settings\ on systems upgraded from xp or below.
Contributing to the Mozilla code base
we know even before you start contributing that getting set up to work on firefox and finding a bug that's a good fit for your skills can be a challenge.
...they're all about small changes, sometimes as little as a few lines, but they're a great way to learn about setting up your development environment, navigating bugzilla, and making contributions to the mozilla codebase.
...in a worst case scenario, set the module owner as the reviewer, asking them in the comments to pick someone more suitable please select only one reviewer.
Reviewer Checklist
accessibility for html pages, images should have the alt attribute set when appropriate.
... similarly, a button that is not a native html button should have role="button" and the aria-label attribute set.
... [fennec: make sure contentdescription is set for parts of the ui that should be accessible] ...
SVG Guidelines
examples here are some examples for excessive number precision: 5.000000e-02 → 0.05 (as seen here) -3.728928e-10 → 0 (as seen here) translate(0.000000, -1.000000) → translate(0, -1) (as seen here) as for descriptive ids: for gradients: svg_id1 → gradient1 (as seen here) use of class names avoid using a class if that class is only used once in the file if that class only sets a fill or a stroke, it's better to set the fill/stroke directly on the actual shape, instead of introducing a class just for that shape.
... you can also use svg grouping to avoid duplicating those attributes avoid introducing variants of the same file (color/style variants), and use sprites instead (with class names) default style values there's usually no need to set the default style value unless you're overriding a style.
... here are some commonly seen examples: style="display: none;" on <defs> elements (a <defs> element is hidden by default) type="text/css" on <style> elements stroke: none or stroke-width: 0 svg grouping style grouping group similarly styled shapes under one <g> tag; this avoids having to set the same class/styles on many shapes.
Cross Process Object Wrappers
the chrome script can get and set the wrapped object's properties and call its functions: // chrome script windowmm.addmessagelistener("my-e10s-extension-message", handlemessage); function handlemessage(message) { let wrapper = message.objects.clicked; console.log(wrapper.innerhtml); wrapper.innerhtml = "<h2>modified by chrome!</h2>" wrapper.setattribute("align", "center"); } auto-generated cpows add-ons that have not...
... declared themselves multiprocess compatible are set up with a number of compatibility shims.
...for example, you can't pass a cpow into nsifocusmanager.setfocus().
Limitations of chrome scripts
you'll get the shims for your add-on by default, unless you set the multiprocesscompatible flag in your add-on's install manifest.
... however, these shims are not a substitute for migrating extensions: they are only a temporary measure, and will be removed eventually they can have a bad effect on responsiveness there are likely to be edge cases in which they don't work properly you can see all the places where your add-on uses compatibility shims by setting the dom.ipc.shims.enabledwarnings preference and watching the browser console as you use the add-on.
... with the shim the shim intercepts chrome process code that adds listeners to xul elements and sets up listeners in the content process, relaying the result back to the chrome process.
How to add a build-time test
for standalone executables, if one sets up the right variables, then the rules.mk file will do lots of magic and most of the heavy lifting.
...un the testcookie program) in the test program: if the test fails, exit with a non-zero status and/or print the string "fail" to stdout if the test passes, exit with a zero status and don't print the string "fail" (bonus points for printing "pass" :) ) write the test so that you expect it to pass on all platforms, since if the test fails, the tree will go orange (once we've set this up - see bug 352240 for status).
...if you're in <tt>netwerk/test</tt>, set depth = ../..
How to get a stacktrace with WinDbg
(you'll want the 32-bit version, even if you are using a 64-bit version of windows) then install it, the standard settings in the installation process are fine.
... troubleshooting: symbols will not download if symbols will not download no matter what you do, the problem may be that internet explorer has been set to the work offline mode.
...this is because microsoft uses internet explorer's internet & proxy settings to download the symbol files.
FxAccountsOAuthClient.jsm
components.utils.import("resource://gre/modules/fxaccountsoauthclient.jsm"); creating a new fxaccountsoauthclient new fxaccountsoauthclient(object options); method overview launchwebflow(); teardown(); attributes parameters object returns the set of parameters that initialized the firefox accounts oauth flow.
... parameters set of parameters to initialize the firefox accounts oauth flow.
...registers a webchannel listener and sets up a callback if needed.
Log.jsm
// use dots to create a hierarchy, this way you can later change // the log level of sets of loggers under some common root let log = log.repository.getlogger("myextension.myclass"); log.level = log.level.debug; // a console appender logs to the browser console.
...ength: 1 keys of prototype: append(); doappend(); level: 0 basicformatter(); length: 1 keys of prototype: format(); boundedfileappender(); length: 2 keys of prototype: doappend(); reset(); consoleappender(); length: 1 keys of prototype: doappend(); dumpappender(); length: 1 keys of prototype: doappend(); fileappender(); length: 2 keys of prototype: doappend(); reset(); ...
... loggerrepository(); length: 0 keys of prototype: getlogger(); rootlogger storagestreamappender(); length: 1 keys of prototype: doappend(); getinputstream(); newoutputstream(); outputstream reset(); structuredformatter(); length: 0 keys of prototype: format(); method overview enumerateinterfaces(); length: 0 enumerateproperties(); length: 2 member fields variable type description level object contains the following fields: ...
Sqlite.jsm
getschemaversion() the user-set version associated with the schema for the current database.
... if no schema version has been set, this will return the string "0".
... setschemaversion(value) sets value as the new version associated with the schema for the current database.
Localizing extension descriptions
because a new method for doing so was implemented in gecko 1.9 (firefox 3), there are two sets of instructions below.
...the localization information provided by the em:localized property can be overriden using a set of localized preferences as detailed below.
... if a preference isn't set and there isn't a matching em:localized property for the current locale or en-us, then the properties specified directly on the install manifest are used as a last resort, as they were always used before gecko 1.9.
Localizing without a specialized tool
before we start, did you make sure to install mercurial and confirm that you have set up the proper build environment on your local machine?
...ory (root) mozilla-1.9.2 (en-us source, pulled from http://hg.mozilla.org/releases/mozilla-1.9.2) l10n-mozilla-1.9.2 (a directory containing localization directories, one dir per localization; often referred to as "l10n base") x-testing (a directory with your localization files) please either follow this structure closely or adjust all commands in the documentation as needed by your custom set-up.
... each time you see a directory or set of sub-directories, you will need to run the mkdir command inside your locale directory and then copy the .dtd or .properties files into that directory.
Localization quick start guide
we will take you through the steps to get started, from the initial environment setup to testing and releasing your own localization.
...as you near the end of this guide, you should be able to make a change to firefox in your local setting and then see that change in the firefox interface.
... initial setup tech prep work before localizing.
SVN for Localizers
windows users can install the svn client directly from the cygwin setup file.
... note: if you do not already have access to svn, visit this wiki page on how to get set up with an svn account before proceeding.
...trunk refers to a set of files and directories that are in the testing stage (i.e., staging).
Localization formats
.lang files provide some features that differentiate it from gettext: .lang is not dependent on php/.po library, so if our webdev team sets up a site without gettext support, we still have .lang.
... (it should be noted that this is near impossibility since most sites will be set up with gettext support.) .lang files can be easily edited in a text editor with this setup, a localizer is given a "[something].lang" file containing all the strings needing localization.
..." "allez-y et montrez-le en téléchargeant et en imprimant votre " "certificat personnalisé firefox 3 download day." advantages of gettext gettext has very powerful tools to update this site (if you use the actual english strings in msgids, not unique identifier strings like certificate_intro) very established with a large set of powerful tools harder to screw things up because existing tools will not allow localizers to edit the l10n file where they shouldn't separates localizable strings available for localizers for the rest of the code, protecting it from unintended changes disadvantage of gettext .po file needs to be compiled into a .mo file for localizer to see changes using regular diff to see changes to ...
Extras
<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%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(255,0,0); stop-opacity:.8;"/> </radialgradient> </defs> <g transform="translate(15,1...
... l 30 15 l 20 20 l 15 30 l 10 20 l 0 15 l 10 10"/> </g> </g> </g> </svg> </mtext> </mpadded> </msqrt> <mo>=</mo> <msubsup> <mo>∫</mo> <mn>0</mn> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </msubsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"> <defs> <radialgradient id="radgrad2" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:.9;"/> </radialgradient> </defs> <g> <animatemotion path="m0,0 l3,0 l2,5 l5,5 l0,4 l5,2 z" begin="0s" dur="0.5s" repeatcount="indefinite"/> <circle fill="url(#radgrad2)" r="5px" cx="5px" cy="5px"/> </g> </svg> </m...
...text> </msup> <mrow> <mo>ⅆ</mo> <mi>θ</mi> </mrow> </math> <div style="width: 300px; margin-left: auto; margin-right: auto;"> <svg width="300px" height="250px"> <defs> <lineargradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:rgb(0,0,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(0,255,0);stop-opacity:1"/> </lineargradient> <lineargradient id="grad2" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:rgb(255,0,0);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(255,255,0);stop-opacity:1"/> </lineargradient> <radialgradient id="grad3" cx="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(0,255,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(255,255,255)...
Fonts for Mozilla's MathML engine
advanced setup arabic mathematical alphabetic symbols currently, very few fonts have appropriate glyphs for the arabic mathematical alphabetic symbols.
...alternatively, you can try the mathml-fontsettings add-on.
...rn math libertinus math lucida bright math minion math stix math tex gyre bonum math tex gyre pagella math tex gyre schola math tex gyre termes math xits math fira math (sans-serif typeface, under development) gfs neohellenic math (sans-serif typeface) using mathematical fonts on web pages starting with gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28), it is now easy to set up the css style (and optional woff fonts) to use on your web site.
Fonts for Mozilla 2.0's MathML engine
recommended fonts the stix fonts project has been developing a comprehensive set of fonts that cover all the symbols in mathml and also contains glyphs to stretch mathematical operators.
... reset old preferences if users have previously changed the "font.mathfont-family" preference for a previous version of mozilla, then it is best to reset this to the default value.
... to do this, enter the url "about:config", "filter" for "mathfont", and "reset" to the default value through the context menu on the preference.
MathML In Action
next to it is this tiny formula, det | a c b d | = a d - b c , which can also be typeset in displaystyle as det | a b c d | = a d - b c .
... mathematical typesetting is picky.
...mrow> </msqrt> </mrow> <mrow> <mn>2</mn> <mi>a</mi> </mrow> </mfrac> </mrow> </mstyle> </math> </p> javascript content function zoomtoggle() { if (this.hasattribute("mathsize")) { this.removeattribute("mathsize"); } else { this.setattribute("mathsize", "200%"); } } function load() { document.getelementbyid("zoomablemath").
MathML Demo: <mtable> - tables and matrices
by default -- when the align attribute is not set, or when align="axis", the middle of the table coincides with the math axis.
...do you see which vertical alignment is set on that table?
...d+p ( α β γ δ ) ...--- , but note that setting the baseline relative to a particular row is meaningless if the row doesn't have at least one cell with "rowalign=baseline" where to anchor the baseline (in which case mozilla will behave as if it was align="center#rownumber").
JS::PerfMeasurement
perfmeasurement::perfmeasurement(eventmask tomeasure) the constructor creates a new profiling object, which measures some subset of the requested events.
... it will not have any more bits set than were set in the mask passed to the constructor, but if the os cannot or will not measure all of the requested events, then only those events that will actually be measured have their bits set.
...void reset() resets all enabled counters to zero.
Measuring performance using the PerfMeasurement.jsm code module
now we want to benchmark a function that is pretty fast (but not fast enough), so we run it several thousand times: for (let i = 0; i < 10000; i++) { set_up_some_state(); monitor.start(); code_to_be_benchmarked(); monitor.stop(); clean_up_afterward(); } we call the perfmeasurement object's start() method when we want to start recording, and stop() when we want to stop recording.
...since we enable monitoring immediately before calling code_to_be_benchmarked(), and disable it as soon as it returns, the code in set_up_some_state() and clean_up_afterward() is not measured.
... when you're done benchmarking, you can read out each of the counters you asked for as properties: let report = "cpu cycles: " + monitor.cpu_cycles + "\n" + "cache refs: " + monitor.cache_references + "\n" + "cache misses: " + monitor.cache_misses + "\n"; monitor.reset(); alert(report); the reset() method clears all of the enabled counters, as you might expect.
Memory Profiler
you may need to set the "xpinstall.signatures.required" pref to false in order to install it, since the xpi is not yet signed.
... start - start profiling stop - stop profiling reset - clear profile data when profiler is stopped profile data is accumulated and resumed after start.
... use reset to start a new recording.
Profiling with Xperf
for 64-bit windows 7 or vista, you'll need to do a registry tweak and then restart to enable stack walking: reg add "hklm\system\currentcontrolset\control\session manager\memory management" -v disablepagingexecutive -d 0x1 -t reg_dword -f symbol server setup with the latest versions of the windows performance toolkit, you can modify the symbol path directly from within the program via the trace menu.
... just make sure you set the symbol paths before enabling "load symbols" and before opening a summary view.
...capturing heap data the "-heap" option is used to set up heap tracing.
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.
... note that if you do change this file, its contents may reset when the machine is next rebooted.
...a warning is given if you set it below 50 because that is likely to lead to inaccurate estimates.
Profile Manager
firefox and other xulrunner applications store user settings and data in special folders, called profiles.
... ability to copy certain assets (e.g., bookmarks) between profiles.
... ability to reset a profile (return it to a default state excluding bookmarks and passwords).
Introduction to NSPR
these resources include the thread stack and the cpu register set (including pc).
... setting thread priorities preempting threads interrupting threads for reference information on the nspr api used for thread scheduling, see threads.
... setting thread priorities the host operating systems supported by nspr differ widely in the mechanisms they use to support thread priorities.
NSPR Error Handling
this chapter describes the functions for retrieving and setting errors and the error codes set by nspr.
... error type prerrorcode error functions pr_seterror pr_seterrortext pr_geterror pr_getoserror pr_geterrortextlength pr_geterrortext error codes error codes defined in prerror.h: pr_out_of_memory_error insufficient memory to perform request.
... pr_connect_reset_error the (tcp) connection has been reset by the peer.
PRIOMethods
o64fn fileinfo64; prwritevfn writev; prconnectfn connect; pracceptfn accept; prbindfn bind; prlistenfn listen; prshutdownfn shutdown; prrecvfn recv; prsendfn send; prrecvfromfn recvfrom; prsendtofn sendto; prpollfn poll; pracceptreadfn acceptread; prtransmitfilefn transmitfile; prgetsocknamefn getsockname; prgetpeernamefn getpeername; prgetsockoptfn getsockopt; prsetsockoptfn setsockopt; }; typedef struct priomethods priomethods; parameters file_type type of file represented (tos).
... getsockopt get current setting of specified socket option.
... setsockopt set value of specified socket option.
PR_LocalTimeParameters
returns the time zone offset information that maps the specified prexplodedtime to local time.
... 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.
... returns a time parameters structure that expresses the time zone offsets at the specified time.
Encrypt Decrypt MAC Keys As Session Objects
f(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_trun...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } ...
... rv = encryptfile(slot, dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, ...
Encrypt and decrypt MAC using token
f(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_trun...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } ...
... rv = encryptfile(slot, dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, ...
NSS 3.12.5 release_notes
if an application depends on renegotiation feature, it can be enabled by setting the environment variable nss_ssl_enable_renegotiation to 1.
... by setting this environmental variable, the fix provided by these patches will have no effect and the application may become vulnerable to the issue.
... this default setting can also be changed within the application by using the following existing api functions: secstatus ssl_optionset(prfiledesc *fd, print32 option, prbool on) secstatus ssl_optionsetdefault(print32 option, prbool on) there is now a new value for "option", which is: ssl_enable_renegotiation the corresponding new values for ssl_enable_renegotiation are: ssl_renegotiate_never: never renegotiate at all (default).
NSS 3.15.4 release notes
new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post.
... updated the set of root ca certificates (version 1.96).
...in addition to enabling the ssl_enable_false_start option, an application must now register a callback using the ssl_setcanfalsestartcallback function.
NSS 3.15 release notes
tls client applications may enable this via a call to ssl_optionsetdefault(ssl_enable_ocsp_stapling, pr_true); added function secitem_reallocitemv2.
... ssl_setstapledocspresponses - set's a stapled ocsp response for a tls server socket to return when clients send the status_request extension.
... new macros in ssl.h ssl_enable_ocsp_stapling - used with ssl_optionset to configure tls client sockets to request the certificate_status extension (eg: ocsp stapling) when set to pr_true notable changes in nss 3.15 secitem_reallocitem is now deprecated.
NSS 3.22 release notes
pk11_createpbev2algorithmid() now supports sec_oid_pkcs5_pbkdf2 with cipheralgtag and prfalgtag set to sec_oid_hmac_sha256, sec_oid_hmac_sha224, sec_oid_hmac_sha384, or sec_oid_hmac_sha512.
... in ssl.h ssl_peersignedcerttimestamps - get signed_certificate_timestamp tls extension data ssl_setsignedcerttimestamps - set signed_certificate_timestamp tls extension data new types in secoidt.h the following are added to secoidtag: sec_oid_aes_128_gcm sec_oid_aes_192_gcm sec_oid_aes_256_gcm sec_oid_idea_cbc sec_oid_rc2_40_cbc sec_oid_des_40_cbc sec_oid_rc4_40 sec_oid_rc4_56 sec_oid_null_cipher sec_oid_hmac_md5 sec_o...
... set the nss_disable_gtests variable to 1 to disable building these tests.
NSS 3.28 release notes
ssl_signatureschemeprefset allows an application to set which signature schemes should be supported in tls and to specify the preference order of those schemes.
... new functions to configure signature schemes are provided: ssl_signatureschemeprefset, ssl_signatureschemeprefget.
... the old ssl_signatureprefset and ssl_signatureprefset functions are now deprecated.
NSS 3.48 release notes
because using an iteration count higher than 1 with the legacy dbm (key3.db) storage creates files that are incompatible with previous versions of nss, applications that wish to enable it for key3.db are required to set environment variable nss_allow_legacy_dbm_iteration_count=1.
... applications may set environment variable nss_min_mp_pbe_iteration_count to request a higher iteration count than the library's default, or nss_max_mp_pbe_iteration_count to request a lower iteration count for test environments.
...a::pkix gtests in nss ci bug 1591315 - update nsc_decrypt length in constant time bug 1562671 - increase nss mp kdf default iteration count, by default for modern key4 storage, optionally for legacy key3.db storage bug 1590972 - use -std=c99 rather than -std=gnu99 bug 1590676 - fix build if arm doesn't support neon bug 1575411 - enable tls extended master secret by default bug 1590970 - ssl_settimefunc has incomplete coverage bug 1590678 - remove -wmaybe-uninitialized warning in tls13esni.c bug 1588244 - nss changes for delegated credential key strength checks bug 1459141 - add more cbc padding tests that missed nss 3.47 bug 1590339 - fix a memory leak in btoa.c bug 1589810 - fix uninitialized variable warnings from certdata.perl bug 1573118 - enable tls 1.3 by default in nss th...
NSS 3.53 release notes
at that time, users will need to set the compile-time flag (bug 1622033) to disable that deprecation in order to use the algorithm.
... several root certificates in the mozilla program now set the cka_nss_server_distrust_after attribute, which nss consumers can query to further refine trust decisions.
... bugs fixed in nss 3.53 bug 1640260 - initialize pbe params (asan fix) bug 1618404 - set cka_nss_server_distrust_after for symantec root certs bug 1621159 - set cka_nss_server_distrust_after for consorci aoc, grca, and sk id root certs bug 1629414 - ppc64: correct compilation error between vmx vs.
Enc Dec MAC Output Public Key as CSR
name, ascii); if (rv) { rv = secfailure; goto cleanup; } certreq = (certcertificaterequest*) port_arenazalloc (arena, sizeof(certcertificaterequest)); if (!certreq) { rv = secfailure; goto cleanup; } certreq->arena = arena; /* since cert request is a signed data, must decode to get the inner data */ port_memset(&signeddata, 0, sizeof(signeddata)); rv = sec_asn1decodeitem(arena, &signeddata, sec_asn1_get(cert_signeddatatemplate), &reqder); if (rv) { rv = secfailure; goto cleanup; } rv = sec_asn1decodeitem(arena, certreq, sec_asn1_get(cert_certificaterequesttemplate), &signeddata.data); if (rv) { rv = secfa...
...intf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* wrap mac key */ rv = wrapkey(mackey, pubkey, &wrappedmackey); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping mac key\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_trun...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } switch (cmd) { case gen_csr: /* validate command for generate csr */ if (!ce...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
ame, ascii); if (rv) { rv = secfailure; goto cleanup; } certreq = (certcertificaterequest*) port_arenazalloc (arena, sizeof(certcertificaterequest)); if (!certreq) { rv = secfailure; goto cleanup; } certreq->arena = arena; /* since cert request is a signed data, must decode to get the inner data */ port_memset(&signeddata, 0, sizeof(signeddata)); rv = sec_asn1decodeitem(arena, &signeddata, sec_asn1_get(cert_signeddatatemplate), &reqder); if (rv) { rv = secfailure; goto cleanup; } rv = sec_asn1decodeitem(arena, certreq, sec_asn1_get(cert_certificaterequesttemplate), &signeddata.data); if (rv) { ...
...pr_fprintf(pr_stderr, "unable to retrieve key %s\n", issuernickname); goto cleanup; } } arena = cert->arena; algid = sec_getsignaturealgorithmoidtag(privkey->keytype, hashalgtag); if (algid == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type for issuer.\n"); goto cleanup; } rv = secoid_setalgorithmid(arena, &cert->signature, algid, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not set signature algorithm id.\n%s\n", port_errortostring(rv)); goto cleanup; } /* we only deal with cert v3 here */ *(cert->version.data) = 2; cert->version.len = 1; der.len = 0; der.data = null; dummy = sec_asn1encodei...
... pl_destroyoptstate(optstate); if (cmd == unknown || !dbdir) usage(progname); /* open db for read/write and authenticate to it */ pr_init(pr_user_thread, pr_priority_normal, 0); initialized = pr_true; rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } switch (cmd) { case gene...
Encrypt Decrypt_MAC_Using Token
f(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc.
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } ...
...*/ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr,...
NSS Sample Code Sample_2_Initialization of NSS
try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(output); return p0; } /* change the password */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, char *oldpwfile, char *newpwfile) { secstatus rv; secupwdata pwdata; secupwdata newpwdata; char *oldpw = null; char *newpw = null; if (oldpass)...
... try again.\n"); } else { pr_fprintf(pr_stderr, "invalid password.\n"); port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); return secfailure; } } else { break; } port_free(oldpw); } newpw = initslotpassword(slot, pr_false, &newpwdata); if (pk11_changepw(slot, oldpw, newpw) != secsuccess) { pr_fprintf(pr_stderr, "failed to change...
... password.\n"); return secfailure; } port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); pr_fprintf(pr_stdout, "password changed successfully.\n"); } port_memset(newpw, 0, pl_strlen(newpw)); port_free(newpw); return secsuccess; } /* * this example illustrates initialization of the nss database.
NSS Sample Code Sample_3_Basic Encryption and MACing
f(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_trun...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } ...
... rv = encryptfile(slot, dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, ...
NSS Sample Code Utilities_1
info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size) { return secsuccess; } } secitem_freeitem(dst, pr_false); dst->data = null; return secfailure; } /* * echooff */ static void echooff(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag &= ~echo; tcsetattr(fd, tcsaflush, &tio); } } /* * echoon */ static void echoon(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag |= echo; tcsetattr(fd, tcsaflush, &tio); } } /* * checkpassword */ prbool checkpassword(char *cp) { int len; char *end; len = port_strlen(cp); if (len < 8) { return pr_false; } en...
...ull:\n\n"); fprintf(stderr, "%s", meter); fprintf(stderr, "\r|"); /* turn off echo on stdin & return on 1 char instead of nl */ fd = fileno(stdin); tcgetattr(fd, &tio); orig_lflag = tio.c_lflag; orig_cc_min = tio.c_cc[vmin]; orig_cc_time = tio.c_cc[vtime]; tio.c_lflag &= ~echo; tio.c_lflag &= ~icanon; tio.c_cc[vmin] = 1; tio.c_cc[vtime] = 0; tcsetattr(fd, tcsaflush, &tio); /* get random noise from keyboard strokes */ count = 0; while (count < rsize) { c = getc(stdin); if (c == eof) { rv = secfailure; break; } *(rbuf + count) = c; if (count == 0 || c != *(rbuf + count -1)) { count++; fprintf(stderr, "*"); } } rbuf[count] = '\0...
... press enter to continue: "); while ((c = getc(stdin)) != '\n' && c != eof) ; if (c == eof) rv = secfailure; fprintf(stderr, "\n"); /* set back termio the way it was */ tio.c_lflag = orig_lflag; tio.c_cc[vmin] = orig_cc_min; tio.c_cc[vtime] = orig_cc_time; tcsetattr(fd, tcsaflush, &tio); return rv; } /* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf...
NSS Sample Code sample3
functions, which does not * require a nss database to exist */ nss_nodb_init("."); /* get a slot to use for the crypto operations */ slot = pk11_getinternalkeyslot(); if (!slot) { cout << "getinternalkeyslot failed" << endl; status = 1; goto done; } /* * part 1 - simple hashing */ cout << "part 1 -- simple hashing" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a context for hashing (digesting) */ context = pk11_createdigestcontext(sec_oid_md5); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "d...
... s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 2 - hashing with included secret key */ cout << "part 2 -- hashing with included secret key" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key failed" << endl; goto done; } cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data = 0; noparams.len = 0...
...<< endl; goto done; } s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 3 - mac (with secret key) */ cout << "part 3 -- mac (with secret key)" << endl; /* initialize data */ memset(data, 0xbc, sizeof data); context = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, key, &noparams); if (!context) { cout << "createcontextbysymkey failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout << "digestop failed" <<...
NSS Sample Code sample4
nss sample code 4: pki encryption /* example code to illustrate pki crypto ops (encrypt with public key, * decrypt with private key) * * code assumes that you have set up a nss database with a certificate * and a private key.
...-1 -2 -5 * * there are many ways to setup a public/private key to use - this * example shows one of them.
...ommunication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; certcertificate *cert = null; seckeypublickey *pubkey = null; seckeyprivatekey *pvtkey = null; int modulus_len, i, outlen; char *buf1 = null; char *buf2 = null; /* initialize nss */ pk11_setpasswordfunc(passwdcb); rv = nss_init("."); if (rv != secsuccess) { fprintf(stderr, "nss initialization failed (err %d)\n", pr_geterror()); goto cleanup; } cert = pk11_findcertfromnickname("testca", null); if (cert == null) { fprintf(stderr, "couldn't find cert testca in nss db (err %d)\n", pr_geterror()); goto cleanup; } pubkey = cert_ex...
Initialize NSS database - sample 2
try again.\n"); } /* clear out the duplicate password string */ if (p1) { port_memset(p1, 0, port_strlen(p1)); port_free(p1); } fclose(input); fclose(output); return p0; } /* * changepw */ secstatus changepw(pk11slotinfo *slot, char *oldpass, char *newpass, char *oldpwfile, char *newpwfile) { secstatus rv; secupwdata pwdata; secupwdata newpwdata; char *oldpw = null; char *newpw = null; if (oldpass) { pwdat...
... try again.\n"); } else { pr_fprintf(pr_stderr, "invalid password.\n"); port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); return secfailure; } } else { break; } port_free(oldpw); } newpw = initslotpassword(slot, pr_false, &newpwdata); if (pk11_changepw(slot, oldpw, newpw) != secsuccess) { pr_fprintf(pr_stderr, "failed to change...
... password.\n"); return secfailure; } port_memset(oldpw, 0, pl_strlen(oldpw)); port_free(oldpw); pr_fprintf(pr_stdout, "password changed successfully.\n"); } port_memset(newpw, 0, pl_strlen(newpw)); port_free(newpw); return secsuccess; } /* * this example illustrates initialization of the nss database.
EncDecMAC using token object - sample 3
_id */ rv = gathercka_id(enckey, &encckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "error while wrapping encrypt key\n"); goto cleanup; } /* get the mac key cka_id */ rv = gathercka_id(mackey, &macckaid); if (rv != secsuccess) { pr_fprintf(pr_stderr, "can't get the mac key cka_id.\n"); goto cleanup; } if (noisefilename) { rv = seedfromnoisefile(noisefilename); if (rv != secsuccess) { port_seterror(pr_end_of_file_error); return secfailure; } rv = pk11_generaterandom(iv, blocksize); if (rv != secsuccess) { goto cleanup; } } else { /* generate a random value to use as iv for aes cbc */ generaterandom(iv, blocksize); } headerfile = pr_open(headerfilename, pr_create_file | pr_truncate | pr_rdwr, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", header...
...*/ rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = encryptfile(slot, dbdir, infilename, headerfilename, encryptedfilename, noisefilename, &pwdata, ascii); if (rv != secsucc...
...ess) { pr_fprintf(pr_stderr, "encryptfile : failed\n"); return secfailure; } break; case decrypt: /* open db read only, authenticate to it */ pk11_setpasswordfunc(getmodulepassword); rv = nss_init(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_init failed\n"); return secfailure; } slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } rv = decryptfile(slot, dbdir, outfilename, headerfilename, encryptedfilename, &pwdata, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "decryptfile : failed\n"); return secfailure; } break; } cleanup: rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess) { ...
Utilities for nss samples
info.size)) { numbytes = pr_read(src, dst->data, info.size); if (numbytes == info.size) { return secsuccess; } } secitem_freeitem(dst, pr_false); dst->data = null; return secfailure; } /* * echooff */ static void echooff(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag &= ~echo; tcsetattr(fd, tcsaflush, &tio); } } /* * echoon */ static void echoon(int fd) { if (isatty(fd)) { struct termios tio; tcgetattr(fd, &tio); tio.c_lflag |= echo; tcsetattr(fd, tcsaflush, &tio); } } /* * checkpassword */ prbool checkpassword(char *cp) { int len; char *end; len = port_strlen(cp); if (len < 8) { return pr_false; } en...
...ull:\n\n"); fprintf(stderr, "%s", meter); fprintf(stderr, "\r|"); /* turn off echo on stdin & return on 1 char instead of nl */ fd = fileno(stdin); tcgetattr(fd, &tio); orig_lflag = tio.c_lflag; orig_cc_min = tio.c_cc[vmin]; orig_cc_time = tio.c_cc[vtime]; tio.c_lflag &= ~echo; tio.c_lflag &= ~icanon; tio.c_cc[vmin] = 1; tio.c_cc[vtime] = 0; tcsetattr(fd, tcsaflush, &tio); /* get random noise from keyboard strokes */ count = 0; while (count < rsize) { c = getc(stdin); if (c == eof) { rv = secfailure; break; } *(rbuf + count) = c; if (count == 0 || c != *(rbuf + count -1)) { count++; fprintf(stderr, "*"); } } rbuf[count] = '\0...
... press enter to continue: "); while ((c = getc(stdin)) != '\n' && c != eof) ; if (c == eof) rv = secfailure; fprintf(stderr, "\n"); /* set back termio the way it was */ tio.c_lflag = orig_lflag; tio.c_cc[vmin] = orig_cc_min; tio.c_cc[vtime] = orig_cc_time; tcsetattr(fd, tcsaflush, &tio); return rv; } /* * seedfromnoisefile */ secstatus seedfromnoisefile(const char *noisefilename) { char buf[2048]; prfiledesc *fd; print32 count; fd = pr_open(noisefilename, pr_rdonly, 0); if (!fd) { fprintf(stderr, "failed to open noise file."); return secfailure; } do { count = pr_read(fd,buf,sizeof(buf)); if (count > 0) { pk11_randomupdate(buf...
sample2
if (arena == null) { rv = secfailure; goto cleanup; } rv = readderfromfile(&reqder, infilename, ascii); if (rv) { rv = secfailure; goto cleanup; } certreq = (certcertificaterequest*) port_arenazalloc (arena, sizeof(certcertificaterequest)); if (!certreq) { rv = secfailure; goto cleanup; } certreq->arena = arena; /* since cert request is a signed data, must decode to get the inner data */ port_memset(&signeddata, 0, sizeof(signeddata)); rv = sec_asn1decodeitem(arena, &signeddata, sec_asn1_get(cert_signeddatatemplate), &reqder); if (rv) { rv = secfailure; goto cleanup; } rv = sec_asn1decodeitem(arena, certreq, sec_asn1_get(cert_certificaterequesttemplate), &signeddata.data); if (rv) { rv = secfailure; goto cleanup; } rv = cert_verifysigneddatawithpublickeyinfo(&signeddata, &certreq->subjectpub...
..._findkeybyanycert(issuer, pwarg); cert_destroycertificate(issuer); if (caprivatekey == null) { pr_fprintf(pr_stderr, "unable to retrieve key %s\n", issuernickname); goto cleanup; } } arena = cert->arena; algid = sec_getsignaturealgorithmoidtag(privkey->keytype, hashalgtag); if (algid == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type for issuer.\n"); goto cleanup; } rv = secoid_setalgorithmid(arena, &cert->signature, algid, 0); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not set signature algorithm id.\n%s\n", port_errortostring(rv)); goto cleanup; } /* we only deal with cert v3 here */ *(cert->version.data) = 2; cert->version.len = 1; der.len = 0; der.data = null; dummy = sec_asn1encodeitem (arena, &der, cert, sec_asn1_get(cert_certificatetemplate)); if (!dummy) {...
... 'v': sigverify = pr_true; break; default: usage(progname); break; } } pl_destroyoptstate(optstate); if (cmd == unknown || !dbdir) usage(progname); /* open db for read/write and authenticate to it */ pr_init(pr_user_thread, pr_priority_normal, 0); initialized = pr_true; rv = nss_initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); goto cleanup; } } switch (cmd) { case generate_csr: validategeneratecsrcommand(progname, dbdir, subject, subjectstr, certreqfilename); /* genera...
NSS Tools sslstrength
firstly, you can set policy to be either domestic or export.
... this restricts the available ciphers to the same set used by communicator.
... policy=export or policy=domestic will set your policies appropriately.
Migration to HG
most parts of the nss build instructions remain valid, especially the instructions about setting environment variables.
... updated instructions for building nss with nspr can be found at: /docs/nss_reference/building_and_installing_nss/build_instructions it's best to refer to the above document to learn about the various environment variables that you might have to set to build on your platform (this part hasn't changed).
... however, below is a brief summary that shows how to checkout the source code and build both nspr and nss: mkdir workarea cd workarea hg clone https://hg.mozilla.org/projects/nspr hg clone https://hg.mozilla.org/projects/nss cd nss # set use_64=1 on 64 bit architectures # set build_opt=1 to get an optimized build make nss_build_all note that the jss project has been given a private copy of the former mozilla/security/coreconf directory, allowing it to remain stable, and only update its build system as necessary.
FC_InitPIN
ppin[input] pointer to the pin being set.
...the module only allows the pkcs #11 so to log in if the normal user's pin has not yet been set or has been reset.
... see also nsc_initpin, fc_setpin ...
NSS tools : cmsutil
-d dbdir specify the key/certificate database directory (default is ".") -e envfile specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message.
... if this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only).
...-u certusage set type of cert usage (default is certusageemailsigner).
sslcrt.html
some of the pk11 functions require a pin argument (see ssl_setpkcs11pinarg for details), which must be specified in the wincx parameter.
...when you call cert_destroycertificate or seckey_destroyprivatekey, the function decrements the reference count and, if the reference count reaches zero as a result, both frees the memory and sets all the bits to zero.
...some of the pk11 functions require a pin argument (see ssl_setpkcs11pinarg for details), which must be specified in the wincx parameter.
S/MIME functions
getbulkkey mxr 3.2 and later nss_cmscontentinfo_getbulkkeysize mxr 3.2 and later nss_cmscontentinfo_getcontent mxr 3.2 and later nss_cmscontentinfo_getcontentencalgtag mxr 3.2 and later nss_cmscontentinfo_getcontenttypetag mxr 3.2 and later nss_cmscontentinfo_setbulkkey mxr 3.2 and later nss_cmscontentinfo_setcontent mxr 3.2 and later nss_cmscontentinfo_setcontent_data mxr 3.2 and later nss_cmscontentinfo_setcontentencalg mxr 3.2 and later nss_cmscontentinfo_setcontent_digesteddata mxr 3.2 and later nss_cmscontentinfo...
..._setcontent_encrypteddata mxr 3.2 and later nss_cmscontentinfo_setcontent_envelopeddata mxr 3.2 and later nss_cmscontentinfo_setcontent_signeddata mxr 3.2 and later nss_cmsdecoder_cancel mxr 3.2 and later nss_cmsdecoder_finish mxr 3.2 and later nss_cmsdecoder_start mxr 3.2 and later nss_cmsdecoder_update mxr 3.2 and later nss_cmsdigestcontext_cancel mxr 3.2 and later nss_cmsdigestcontext_finishmultiple mxr 3.2 and later nss_cmsdigestcontext_finishsingle mxr 3.2 and later nss_cmsdigestcontext_startmultiple mxr ...
...cmssigneddata_getcontentinfo mxr 3.2 and later nss_cmssigneddata_getdigestalgs mxr 3.2 and later nss_cmssigneddata_getsignerinfo mxr 3.2 and later nss_cmssigneddata_hasdigests mxr 3.2 and later nss_cmssigneddata_importcerts mxr 3.2 and later nss_cmssigneddata_setdigests mxr 3.2 and later nss_cmssigneddata_setdigestvalue mxr 3.4 and later nss_cmssigneddata_signerinfocount mxr 3.2 and later nss_cmssigneddata_verifycertsonly mxr 3.2 and later nss_cmssigneddata_verifysignerinfo mxr 3.2 and later nss_cmssignerinfo_addmssmi...
NSS Tools cmsutil
-d dbdir specify the key/certificate database directory (default is ".") -e envfile specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message.
... if this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only).
... -u certusage set type of cert usage (default is <tt>certusageemailsigner)</tt>.
NSS Tools sslstrength
firstly, you can set policy to be either domestic or export.
... this restricts the available ciphers to the same set used by communicator.
... policy=export or policy=domestic will set your policies appropriately.
NSS tools : cmsutil
MozillaProjectsNSStoolscmsutil
-d dbdir specify the key/certificate database directory (default is ".") -e envfile specify a file containing an enveloped message for a set of recipients to which you would like to send an encrypted message.
... if this is the first encrypted message for that set of recipients, a new enveloped message will be created that you can then use for future messages (encrypt only).
... -u certusage set type of cert usage (default is certusageemailsigner).
Installing Pork
install the pork stack pork is a set of tools written at mozilla for refactoring c++.
... index: src/set_mcpp.sh =================================================================== --- src/set_mcpp.sh (revision 78) +++ src/set_mcpp.sh (working copy) @@ -35,14 +35,14 @@ echo " cd ${inc_dir}/mcpp-gcc" cd ${inc_dir}/mcpp-gcc if test !
...' *#define *_' \ > gxx${gcc_maj_ver}${gcc_min_ver}_predef_std.h - ${cxx} -e -xc++ -dm /dev/null | sort | grep -e ' *#define *[a-za-z]+' \ + ${cxx} ${cppflags} -e -xc++ -dm /dev/null | sort | grep -e ' *#define *[a-za-z]+' \ > gxx${gcc_maj_ver}${gcc_min_ver}_predef_old.h fi if test ${host_system} = sys_cygwin; then if you don't do this, mcpp will get the wrong set of automatic definitions and you'll end up with an unpleasant hybrid x86-64/i686 build system.
The JavaScript Runtime
instead, every property accessor method in scriptable (has, get, set, remove, getattributes, and setattributes) has overloaded forms that take either a string or an int argument.
...this method defines a set of javascript objects using a java class.
...multiple threads (with multiple associated contexts) may act upon the same set of objects.
Rhino shell
-continuations enable experimental support for continuations and set the optimization level to -1 to force interpretation mode.
... note if the shell is invoked with the system property rhino.use_java_policy_security set to true and with a security manager installed, the shell restricts scripts permissions based on their urls according to java policy settings.
... version([number]) get or set javascript version number.
Shumway
it is currently available as an extension and as a component in firefox's nightly builds that can be enabled through about:config (you need to find the shumway.disabled preference and set it to false).
... the user has adobe flash player disabled (or set to "click-to-enable") for performance or security reasons.
...the simple method is to install the shumway extension (or run a browser version with shumway included and enabled) and browse to your flash content with adobe flash player set "ask to activate" or "never activate" in firefox's add-ons menu (this will be listed as "shockwave flash" under the plugins tab).
64-bit Compatibility
for example, this code will not load a native integer correctly on a 64-bit machine: struct object { void *data; }; lir->insload(lir_ld, objins, ins->insimm(offsetof(object, data))); lir_ld is 32-bit.
...luckily there is an alias that will choose the right opcode for you - lir_ldp: struct object { void *data; }; lir->insload(lir_ldp, objins, ins->insimm(offsetof(object, data))); when you use lirwriter::insstore, the correct size is chosen for you automatically, based on the size of the input operands.
... stobj_get_fslot - returns jsval-width lins stobj_get_dslot - returns jsval-width lins stobj_set_dslot - stores jsval-width lins stobj_set_fslot - stores jsval-width lins box_jsval - returns jsval-width lins unbox_jsval - expects jsval-width lins ...
JS::Add*Root
this article covers features introduced in spidermonkey 31 register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection.
... description the js::add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable.
... an entry for rp is added to the garbage collector's root set for the jsruntime associated with cx (or, in js::addnamedvaluerootrt, the runtime rt).
JS::Value
the data in a js::value can be accessed using these member functions: js type js::value type tests constructor accessors mutators null val.isnull() js::nullvalue() n/a val.setnull() undefined val.isundefined() js::undefinedvalue() n/a val.setundefined() boolean val.isboolean(), val.istrue(), val.isfalse() js::booleanvalue(bool), js::truevalue(), js::falsevalue() val.toboolean() val.setboolean(bool) number val.isint32(), val.isdouble(), val.isnumber() js::numbervalue(any number type), js::int32value(int32_t), js::...
...doublevalue(double), js::float32value(float) val.toint32(), val.todouble(), val.tonumber() val.setint32(int32_t), val.setnumber(uint32_t), val.setnumber(double) string val.isstring() js::stringvalue(jsstring*) val.tostring() val.setstring(jsstring *) object val.isobject() js::objectvalue(jsobject&amp;), js::objectornullvalue(jsobject*) val.toobject() val.setobject(jsobject &) symbol val.issymbol() js::symbolvalue(js::symbol*) val.tosymbol() val.setsymbol(js::symbol &) numbers are stored in a js::value either as a double or as an int32_t.
... val.setobjectornull(jsobject *) sets the given value to the specified object, or to null if the pointer was null.
JSCheckAccessOp
(it is also the type of the callback set by js_setcheckobjectaccesscallback.) syntax typedef jsbool (* jscheckaccessop)(jscontext *cx, jsobject *obj, jsval id, jsaccessmode mode, jsval *vp); name type description cx jscontext * the js context in which the property access attempt is occurring.
...on success, the callback must set *vp to the stored value of the property.
... if a class leaves the checkaccess field null, a runtime-wide object access callback is called instead; see js_setcheckobjectaccesscallback.
JSNative
on success, the callback must set js::callargs::rval() or call js_set_rval (at least once) and return true.
...js_reporterror or js_reportoutofmemory) or raise an exception (using js_setpendingexception), and the callback must return false.
... see also mxr id search for jsnative js::callargs js_reporterror js_reportoutofmemory js_setpendingexception ...
JSObjectOps.defineProperty
syntax jsbool (*jsdefinepropop)(jscontext *cx, jsobject *obj, jsid id, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); name type description cx jscontext * pointer to the js context in which the property is being defined.
... setter jspropertyop the setter for the new property.
... description define obj[id], an own property of obj named id, having the given initial value, with the specified getter, setter, and attributes.
JSProtoKey
jsproto_float64array float64array mxr search for jsproto_float64array jsproto_uint8clampedarray uint8clampedarray mxr search for jsproto_uint8clampedarray jsproto_proxy proxy mxr search for jsproto_proxy jsproto_weakmap weakmap mxr search for jsproto_weakmap jsproto_map map mxr search for jsproto_map jsproto_set set mxr search for jsproto_set jsproto_dataview dataview mxr search for jsproto_dataview jsproto_symbol symbol added in spidermonkey 38 mxr search for jsproto_symbol jsproto_sharedarraybuffer sharedarraybuffer (nightly only) mxr search for jsproto_sharedarraybuffer jsproto_intl intl mxr search for jsproto_intl js...
...proto_typedobject typedobject (nightly only) mxr search for jsproto_typedobject jsproto_generatorfunction generatorfunction added in spidermonkey 31 mxr search for jsproto_generatorfunction jsproto_simd simd (nightly only) mxr search for jsproto_simd jsproto_weakset weakset added in spidermonkey 38 mxr search for jsproto_weakset jsproto_sharedint8array sharedint8array (nightly only) mxr search for jsproto_sharedint8array jsproto_shareduint8array shareduint8array (nightly only) mxr search for jsproto_shareduint8array jsproto_sharedint16array sharedint16array (nightly only) mxr search for jsproto_sharedint16array jsproto_shareduint16array shareduint16array (nightly only) ...
... see also bug 789635 bug 645416 - added jsproto_symbol bug 769872 - added jsproto_intl bug 792439 - added jsproto_weakset bug 896116 - added jsproto_typedarray bug 904701 - added jsproto_generatorfunction bug 914220 - added jsproto_typedobject bug 933001 - added jsproto_sharedarraybuffer bug 946042 - added jsproto_simd bug 1054882 - added jsproto_shared*arrays ...
JS_AddFinalizeCallback
syntax bool js_addfinalizecallback(jsruntime *rt, jsfinalizecallback cb, void *data); // added in spidermonkey 38 (jsapi 32) void js_removefinalizecallback(jsruntime *rt, jsfinalizecallback cb); // added in spidermonkey 38 (jsapi 32) void js_setfinalizecallback(jsruntime *rt, jsfinalizecallback cb); // obsolete since jsapi 32 name type description rt jsruntime * the jsruntime for which to set the finalization callback.
... obsolete since jsapi 32 js_setfinalizecallback sets a new callback function.
... see also mxr id search for js_addfinalizecallback mxr id search for js_removefinalizecallback mxr id search for jsfinalizestatus mxr id search for jsfinalize_group_start mxr id search for jsfinalize_group_end mxr id search for jsfinalize_collection_end mxr id search for jsfinalizecallback jsfreeop js_setgccallback bug 723286 - separated from js_setgccallback as js_setfinalizecallback bug 996785 - replaced with js_addfinalizecallback ...
JS_Add*Root
register a variable as a member of the garbage collector's root set, to protect anything the root points at from garbage collection.
... description the js_add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable.
... an entry for rp is added to the garbage collector's root set for the jsruntime associated with cx (or, in js_addnamedrootrt, the runtime rt).
JS_AlreadyHasOwnProperty
*foundp is set to true only if lookupproperty reports that the property was found on obj itself and not on some other object (even the corresponding outer object, if any).
... if the property is found on obj, this sets *foundp to true and returns true.
... if the property is not found on obj, this sets *foundp to false and returns true (to indicate that no error occurred).
JS_DefineOwnProperty
descriptor is supposed to be a property descriptor, this means you need to create an object with properties such as value, writable, get or set.
...a getter or setter defined with this functions will be observable from js code.
... see also js_setproperty js_getpropertydescriptorbyid object.defineproperty bug 1017323 ...
JS_EncodeCharacters
if spidermonkey was built with js_c_strings_are_utf8 defined or js_setcstringsareutf8 was called, the string is converted to utf-8.
...*/ js_free(cx, dst); return js_true; on success, js_encodecharacters sets *dstlenp to the real result length and returns js_true.
...to obtain a null-terminated string, allocate an extra byte for the null character and set it manually.
JS_GetCompartmentPrivate
syntax void js_setcompartmentprivate(jscompartment *compartment, void *data); void * js_getcompartmentprivate(jscompartment *compartment); name type description compartment jscompartment * any compartment data void * (in js_setcompartmentprivate) pointer to application-defined data to be associated with the compartment.
...js_getcompartmentprivate gets this field and js_setcompartmentprivate sets it.
... see also mxr id search for js_setcompartmentprivate mxr id search for js_getcompartmentprivate js_getruntimeprivate js_setruntimeprivate js_getprivate js_setprivate js_getinstanceprivate js_getcontextprivate js_setcontextprivate js_getcontextprivate js_setsecondcontextprivate bug 563106 ...
JS_GetElement
if the element exists, js_getelement sets *vp to the element's current value.
... if not, it sets *vp to undefined and returns true (to indicate no error occurred).
...see also mxr id search for js_getelement js_defineelement js_deleteelement js_getarraylength js_isarrayobject js_lookupelement js_newarrayobject js_setarraylength js_setelement ...
JS_GetFunctionCallback
returns the callback currently configured to be called when javascript functions are invoked or exited, as established by a prior call to js_setfunctioncallback.
... description js_getfunctioncallback returns the current function invocation callback, or null if there isn't one set up.
... see also mxr id search for js_getfunctioncallback js_setfunctioncallback jsfunctioncallback bug 1103269 ...
JS_GetGlobalObject
second, the context's global object is used as a default value of last resort by functions that need a default parent object (see js_setparent for details) and by js_getscopechain.
... use js_setglobalobject to replace the global object.
... someone should document common use case "giving the global object a name", which can be done with js_getglobalobject and js_setproperty see also mxr id search for js_getglobalobject js_getglobalforobject js_getglobalforscopechain js::currentglobalornull bug 868110 ...
JS_HasElement
if the element exists, js_haselement sets *foundp to true.
... if not, it sets *foundp to false and returns true (to indicate no error occurred).
... see also mxr id search for js_haselement js_defineelement js_deleteelement js_getarraylength js_getelement js_isarrayobject js_lookupelement js_newarrayobject js_setarraylength js_setelement ...
JS_LookupElement
if the property obj[index] exists, js_lookupelement sets *vp to the property's stored value and returns true.
... if no such property exists, js_lookupelement sets *vp to undefined and returns true (to indicate that no error occurred).
... see also js_defineelement js_deleteelement js_getarraylength js_getelement js_isarrayobject js_newarrayobject js_setarraylength js_setelement bug 1094176 ...
JS_PropertyStub
js_strictpropertystub is of type jsstrictpropertyop, the type of setter callback.
... it can be used in jsclass.setproperty.
... js_deletepropertystub is of type jsdeletepropertyop, the type of setter callback.
Stored value
the javascript engine sets aside a field of type jsval for the stored value of most object properties, even properties that have getters.
... the stored value is updated each time the program gets or sets the property.
... the new stored value is the result of getting or setting the property, after the getter or setter, if any, is called.
JSDBGAPI
breakpoints js_settrap js_gettrapopcode js_cleartrap js_clearscripttraps js_clearalltraps js_handletrap js_setinterrupt js_clearinterrupt watchpoints js_setwatchpoint js_clearwatchpoint js_clearwatchpointsforobject js_clearallwatchpoints inspecting the stack js_pctolinenumber js_linenumbertopc js_getfunctionscript js_getfunctionnative js_getfunctionfastnative js_getscriptprincipals typedef jsstackframe js_frameiterator js_getframescript js_getframepc js_getscriptedcaller js_stackframeprincipals js_evalframeprincipals js_getframeannotation js_setframeannotation js_getframeprincipalarray js_isnativeframe js_getframeobject js_getframescopechain js_getframecallobj...
...ect js_getframethis js_getframefunction js_getframefunctionobject js_isconstructorframe js_isdebuggerframe js_getframereturnvalue js_setframereturnvalue js_getframecalleeobject js_getscriptfilename js_getscriptbaselinenumber js_getscriptlineextent js_getscriptversion js_gettopscriptfilenameflags js_getscriptfilenameflags js_flagscriptfilenameprefix jsfilename_null jsfilename_system jsfilename_protected evaluating debug code js_evaluateinstackframe examining object properties typedef jspropertydesc jspd_enumerate jspd_readonly jspd_permanent jspd_alias jspd_argument jspd_variable jspd_exception jspd_error typedef jspropertydescarray js_propertyiterator js_getpropertydesc js_getpropertydescarray js_putpropertydescarray hooks js_set...
...debuggerhandler js_setsourcehandler js_setexecutehook js_setcallhook js_setobjecthook js_setthrowhook js_setdebugerrorhook js_setnewscripthook js_setdestroyscripthook js_getglobaldebughooks js_setcontextdebughooks memory usage js_getobjecttotalsize js_getfunctiontotalsize js_getscripttotalsize system objects js_issystemobject js_newsystemobject profiling these functions can be used to profile a spidermonkey application using the mac profiler, shark.
Parser API
interface property <: node { type: "property"; key: literal | identifier; value: expression; kind: "init" | "get" | "set"; } a literal property in an object expression can have either a string or number as its value.
... ordinary property initializers have a kind value "init"; getters and setters have the kind values "get" and "set", respectively.
... property(kind, key, val[, loc]) kind: "init" | "get" | "set" key: customliteral | customidentifier val: customexpression loc: sourcelocation returns: customobjectproperty callback to produce a custom object property initializer node.
SpiderMonkey 24
typedef changes the fixed-size integer types introduced in spidermonkey 17 are defined in one of the following ways (xxx update for msvc<10 deprecation): if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types.
... deleted apis js_get_class (use js_getclass instead) js_enumerateresolvedstandardclasses js_getglobalobject js_setcstringsareutf8 ...list other deleted apis...
... js_setversion has been removed, js version is now set on the compartment instead of context.
Mozinfo
mozinfo is a bridge interface, making the underlying (complex) plethora of os and architecture combinations conform to a subset of values of relevance to mozilla software.
...downloading the software and running python setup.py develop will allow you to do import mozinfo from python.
... example output: os: linux version: ubuntu 10.10 bits: 32 processor: x86 three of these fields, os, bits, and processor, have a finite set of choices.
Gecko Roles
role_combobox represents a combo box; an edit control with an associated list box that provides a set of predefined choices.
... role_dial represents a dial or knob whose purpose is to allow a user to set a value.
... role_slider represents a slider, which allows the user to adjust a setting in given increments between minimum and maximum values.
Gecko states
graphics that are occasionally animated are described as role_graphic with the state property set to state_animated.
...however, if client applications find an object with this state, they should check to see if state_offscreen is also set.
...for example, a list box can have both state_invisible and state_offscreen set.
Embedded Dialog API
however note that the complete set of all dialogs is implemented in several different components, so an application need not override every single dialog in gecko to override some.
...(testgtkembed doesn't override promptservice; it uses the default dialogs.) both are source for a library set up as a mozilla component and factory.
...other sets of dialogs and alerts, implemented in other components,can be overridden in exactly the same fashion.
Manipulating bookmarks using Places
the item title to change the title of a bookmark or bookmark folder, you use the nsinavbookmarksservice.setitemtitle() method.
... bmsvc.setitemtitle(newbkmkid, "new title"); this sets the title of the item referenced by the id newbkmkid to "new title".
... var parentfolderid = bmsvc.getfolderidforitem(newbkmkid); observing changes to bookmarks and tags to set up an observer to listen for changes related to bookmarks, you will need to create an nsinavbookmarkobserver object and use the nsinavbookmarksservice.addobserver() and nsinavbookmarksservice.removeobserver() methods.
Using the Places favicon service
this time is used by nsifaviconservice.setandloadfaviconforpage() to determine if the data is fresh or needs reloading from the server.
...otherwise, nsifaviconservice.setandloadfaviconforpage() will use the default expiration time.
... currently, the default expiration time is set to one day in the future.
extISessionStorage
return type method boolean has(in astring aname) void set(in astring aname, in nsivariant avalue) nsivariant get(in astring aname, in nsivariant adefaultvalue) attributes attribute type description events readonly attribute extievents the events object for the storage supports: "change" methods has() determines if a storage item exists with the given name.
... set() sets the value of a storage item with the given name.
... void set(in astring aname, in nsivariant avalue) parameters aname the name of an item return value get() gets the value of a storage item with the given name.
Generic factory
*/ ns_imethod setconstructor(constructorprocptr constructor) = 0; }; using nsigenericfactory is simple.
...define a constructor function that matches the constructorprocptr prototype, and call nsigenericfactory::setconstructor with a pointer to that function.
...ns_imethod dosomething(); }; to create a factory for this class, simply write the following: nsifactory* newcomponentfactory(nsirepository* repository) { nsigenericfactory* factory = null; nscid kgenericfactorycid = ns_genericfactory_cid; nsresult res = repository->createinstance(kgenericfactorycid, null, nsigenericfactory::iid(), &factory); if (res == ns_ok) { factory->setconstructor(&mycomponent::create); } return factory; } this example assumes that the xpcom repository is available as an interface (which it soon will be).
How to build an XPCOM component in JavaScript
depth = @depth@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ vpath = @srcdir@ include $(depth)/config/autoconf.mk # module specifies where header files from this makefile are installed # use dom if your component implements a dom api module = dom # name of the typelib xpidl_module = dom_apps # set to 1 if the module should be part of the gecko runtime common to all applications gre_module = 1 # the idl sources xpidlsrcs = \ helloworld.idl \ $(null) include $(topsrcdir)/config/rules.mk xpidl_flags += \ -i$(topsrcdir)/dom/interfaces/base \ -i$(topsrcdir)/dom/interfaces/events \ $(null) creating the component using xpcomutils in firefox 3 and later you can use import xpcomutils.jsm...
...to begin, include a line at the top of your interface to import the xpcomutils library: components.utils.import("resource://gre/modules/xpcomutils.jsm"); then implement your interface the same way you did above, except with a few modifications so that xpcomutils can set it up properly: /*********************************************************** class definition ***********************************************************/ //class constructor function helloworld() { // if you only need to access your component from javascript, uncomment the following line: //this.wrappedjsobject = this; } // class definition helloworld.prototype = { // properties required f...
...when set to true, and only if 'value' is not // specified, the concatenation of the string "service," and the object's contractid // is passed as avalue parameter of addcategoryentry.
Component Internals
a set of default libraries stored in this components directory makes up a typical gecko installation, providing functionality that consists of networking, layout, composition, a cross-platform user interface, and others.
... the string classes that implement these abstract classes are another set of helpful, unfrozen classes in xpcom.
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
Creating the Component Code
what we'll be working on the component we'll be working on in this book controls a special mode in your browser that prevents users from leaving the current domain or a set of safe domains.
...it is only called once, which gives you a chance to add any one time setup functionality.
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
Finishing the Component
the two nsnull parameters passed to newuri are used to specify the charset of the string and any base uri to use, respectively.
... we are assuming here that the charset of the url string is utf-8, and also assuming that every url string is absolute.
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
Creating XPCOM components
declaration macros representing return values in xpcom xpidl code generation getting the weblock service from a client implementing the iweblock interface the directory service modifying paths with nsifile manipulating files with nsifile using nsilocalfile for reading data processing the white list data iweblock method by method lock and unlock addsite removesite setsites getnext getsites hasmoreelements finishing the component using frozen interfaces copying interfaces into your build environment implementing the nsicontentpolicy interface receiving notifications implementing the nsicontentpolicy uniform resource locators checking the white list creating nsiuri objects building the weblock ui user interface packa...
... code overview xul the xul document the locking ui site adding ui weblock.xul overlaying new user interface into mozilla weblockoverlay.xul other resources weblock.css image resources packaging weblock component installation overview archiving resources the weblock installation script the weblock trigger script distributing your component appendix a - setting up the gecko sdk downloading and setting the sdk building a microsoft visual cpp project creating a new project adding the gecko sdk to the project settings building a windows project a makefile for unix appendix b - resources weblock resources gecko resources xpcom resources general development resources next » copyright (c) 2003 by doug turner and ian oesch...
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
Components.utils.evalInWindow
even so, while the code is being evaluated it is in the content's context, so the caller has to be prepared for the possibility that the content could have redefined behavior (for example, a setter in the script may have been redefined to do something unexpected).
... this function is made available as a global in sandboxes which have the wantexporthelpers option set in the sandbox() constructor.
...iable", contentwindow); console.log(result); // {"name":"selection1","node":{}} the add-on code can modify the variable as well, of course: // add-on-script.js components.utils.evalinwindow("somelocalvariable.newprop = 42", contentwindow); // page-script.js console.log(window.somelocalvariable.newprop); // 42 but note that the add-on script must trust that the page script has not redefined the setter on somelocalvariable: unlike xraywrappers, evalinwindow() does not provide x-ray vision.
Components.utils
setwantxrays() to be called from js only.
... setgczeal() sets the level of garbage collection level for full garbage collection.
... see js_setgczeal for details; this method calls through to that with the specified value as the zeal value.
XPCshell Test Manifest Expressions
there are a fixed set of variables provided by the test harness via mozinfo.py, with many of the values initialized at configure time by writemozinfo.py which writes mozinfo.json into the root of the build directory.
... see also the official docs for this set of variables.
...' os_version - the version of the operating system on which the test is being run toolkit - the graphics toolkit used by this build one of: 'windows', 'cocoa', 'gtk2', 'android' processor - the cpu which the code is compiled for one of: 'x86', 'x86_64', 'arm' bits - the pointer size of the cpu architecture, in bits one of 32, 64, possibly unknown debug - set to true if this build is a debug build, false otherwise crashreporter - set to true if this build has crash reporting code enabled, false otherwise.
Insert
aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
...aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
...aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
nsACString
index_type [pruint32] type used to represent an offset into the string.
... assign the assign family of functions sets the value of a string's internal buffer.
... replace the replace family of functions sets the value of a string's internal buffer.
Insert
aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
...aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
...aposition [in] an offset into the string's internal buffer specifying where to place the given characters.
nsAString
index_type [pruint32] type used to represent an offset into the string.
... assign the assign family of functions sets the value of a string's internal buffer.
... replace the replace family of functions sets the value of a string's internal buffer.
nsCStringEncoding
« xpcom api reference summary the nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.
...ns_cstring_encoding_native_filesystem conversion from utf-16 to the native filesystem charset may result in a loss of information.
...the native filesystem charset applies to strings passed to the "native" method variants on nsifile and nsilocalfile.
mozISpellCheckingEngine
note: setting this value to a value that doesn't match an existing dictionary throws a ns_error_file_not_found exception.
...if the dictionary was set to "no dictionary" (that is, by specifying an empty string), the observer may select another dictionary before returning.
...the dictionary attribute can be set to one of these.
mozIStorageFunction
let stmt = dbconn.createstatement("select square(value) from some_table"); try { while (stmt.executestep()) { // handle the results } } finally { stmt.reset(); } in earlier versions of gecko, however, you'll need to actually create an object containing the onfunctioncall method.
...let stmt = dbconn.createstatement("select square(value) from some_table"); try { while (stmt.executestep()) { // handle the results } } finally { stmt.reset(); } c++ // first, create our class that will represent our function.
...gefunction { public: ns_imethod onfunctioncall(mozistoragevaluearray *aarguments, nsivariant **_result) { print32 value; nsresult rv = aarguments->getint32(&value); ns_ensure_success(rv, rv); nscomptr<nsiwritablevariant> result = do_createinstance("@mozilla.org/variant;1"); ns_ensure_true(result, ns_error_out_of_memory); rv = result->setasint64(value * value); ns_ensure_success(rv, rv); ns_addref(*_result = result); return ns_ok; } }; // now, register our function with the database connection.
nsIAccessible
the accessible tree is a subset of nodes in the dom tree -- such as documents, focusable elements and text.
...to select an accessible you can use nsiaccessible.setselected(), nsiaccessible.takeselection() and nsiaccessible.extendselection().
... setselected this method adds or remove this accessible to the current selection.
nsIAccessibleRole
role_combobox 46 represents a combo box; an edit control with an associated list box that provides a set of predefined choices.
... role_dial 49 represents a dial or knob whose purpose is to allow a user to set a value.
... role_slider 51 represents a slider, which allows the user to adjust a setting in given increments between minimum and maximum values.
nsIAccessibleStates
graphics that are occasionally animated are described as role_graphic (see nsiaccessiblerole.constants) with the state property set to state_animated.
...however, if client applications find an object with this state, they should check to see if state_offscreen is also set.
...for example, a list box can have both state_invisible and state_offscreen set.
nsIAccessibleValue
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview boolean setcurrentvalue(in double value); obsolete since gecko 1.9 attributes attribute type description currentvalue double maximumvalue double read only.
... methods setcurrentvalue() obsolete since gecko 1.9 (firefox 3) return a success condition of the value getting set.
...boolean setcurrentvalue( in double value ); parameters value new value for current value.
nsIAuthInformation
after the user entered the authentication information, it should set the attributes of this object to indicate to the caller what was entered by the user.
...it is possible that neither #auth_host nor #auth_proxy are set.
...this field can only be changed if the #only_password flag is not set.
nsIBidiKeyboard
a user is a bidirectional writer if they have keyboard layouts in both left-to-right and right-to-left directions (that is users who use arabic, iranian (persian), or israel (hebrew) keyboard layout, beside an us (english) layout.) inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) method overview boolean islangrtl(); void setlangfrombidilevel(in pruint8 alevel); attributes attribute type description havebidikeyboards boolean indicates whether or not the system has at least one keyboard for each direction (left-to-right and right-to-left) installed.
... setlangfrombidilevel() sets the keyboard language to left-to-right or right-to-left.
... (supported on: win32) void setlangfrombidilevel( in pruint8 alevel ); parameters alevel if odd set the keyboard to right-to-left, if even set left-to-right.
nsIBinaryOutputStream
inherits from: nsioutputstream last changed in gecko 1.7 method overview void setoutputstream(in nsioutputstream aoutputstream); void write8(in pruint8 abyte); void write16(in pruint16 a16); void write32(in pruint32 a32); void write64(in pruint64 a64); void writeboolean(in prbool aboolean); void writebytearray([array, size_is(alength)] in pruint8 abytes, in pruint32 alength); void writebytes(alength)] in string astring, in pruint32 alength); void writedouble(in...
... double adouble); void writefloat(in float afloat); void writestringz(in string astring); void writeutf8z(in wstring astring); void writewstringz(in wstring astring); methods setoutputstream() sets the stream to which output is directed.
... void setoutputstream( in nsioutputstream aoutputstream ); parameters aoutputstream instance of the nsioutputstream object to which output should be directed.
nsIChannelEventSink
if this flag is not set, this is a temporary redirect.
...one of redirect_temporary and redirect_permanent will always be set.
...one of redirect_temporary and redirect_permanent will always be set.
nsIConsoleService
ize_is(count)] out nsiconsolemessage messages, out uint32_t count);obsolete since gecko 19 void getmessagearray([optional] out uint32_t count, [retval, array, size_is(count)] out nsiconsolemessage messages); void logmessage(in nsiconsolemessage message); void logstringmessage(in wstring message); void registerlistener(in nsiconsolelistener listener); void reset(); void unregisterlistener(in nsiconsolelistener listener); methods getmessagearray() to obtain an array of all logged messages.
... reset() to clear the message buffer (for example, for privacy reasons): void reset(); parameters none.
... note: console listeners expect you to log an empty string message before calling reset, so they too can clear their message buffers.
nsIContentPrefObserver
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void oncontentprefremoved(in astring agroup, in astring aname); void oncontentprefset(in astring agroup, in astring aname, in nsivariant avalue); methods oncontentprefremoved() called when a content preference is removed.
... oncontentprefset() called when the value of a preference is set (either by changing its current value or by creating the preference).
... void oncontentprefset( in astring agroup, in astring aname, in nsivariant avalue ); parameters agroup the group to which the preference belongs; this may be the uri of a web site.
nsIContentSecurityPolicy
equestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra); short shouldprocess(in unsigned long acontenttype, in nsiuri acontentlocation, in nsiuri arequestorigin, in nsisupports acontext, in acstring amimetype, in nsisupports aextra); attributes attribute type description allowseval boolean whether this policy allows eval and eval-like functions such as settimeout("code string", time).
... isinitialized boolean set to true when the content security policy has been read in and parsed and is ready to enforce.
... reportonlymode boolean when set to true, content load-blocking and fail-closed are disabled: content security policy will only send reports, and not modify behavior.
nsIContentSniffer
especially, they should not attempt to set the content type property that subclasses of nsirequest might offer.
... let charset = "iso-8859-1"; try { // this pref has been removed, see bug 910192 charset = services.prefs.getcomplexvalue("intl.charset.default", ci.nsipreflocalizedstring).data; } catch (e) { } let conv = cc["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(ci.nsiscriptableunicodeconv...
...erter); conv.charset = charset; try { let str = conv.convertfrombytearray(adata, alength); if (str.substring(0, 5) == "%pdf-") return "application/pdf"; // we detected a pdf file } catch (e) { // try to get information from arequest } ...
nsICookieStorage
last changed in gecko 1.7 inherits from: nsisupports method overview void getcookie(in string acookieurl, in voidptr acookiebuffer, in pruint32ref acookiesize); void setcookie(in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize); methods getcookie() retrieves a cookie from the browser's persistent cookie store.
... setcookie() stores a cookie in the browser's persistent cookie store.
... void setcookie( in string acookieurl, in constvoidptr acookiebuffer, in unsigned long acookiesize ); parameters acookieurl url string to look up cookie with..
nsIDOMHTMLTimeRanges
the nsidomhtmltimeranges interface represents a set of time ranges in media; it's primarily used by the nsidomhtmlmediaelement interface, and implements the dom timeranges interface.
... methods end() returns the time offset to the end of the specified time range.
... start() returns the time offset to the start of the specified time range.
nsIDOMMozNetworkStatsManager
constants constant type description wifi long constant for wifi, set to 0 mobile long constant for mobile, set to 1 methods getsamples() asynchronously queries network interface statistics.
... browsingtrafficonly a boolean set to filter network stats by browsing traffic.
...if false or not set, the total traffic, which is generated from both the mozapp and mozbrowser iframe elements, is returned.
nsIDOMStorage2
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage.
... setitem() sets the value corresponding to a given key.
...void setitem( in domstring key, in domstring data ); parameters key the key for which data should be set.
nsIDOMUserDataHandler
dom/interfaces/core/nsidomuserdatahandler.idlscriptable the callback function for the setuserdata method.
...key the key that was used to set the user data.
... data the data that was set on the original node.
nsIDictionary
method overview boolean haskey(in string key); void getkeys(out pruint32 count, [retval, array, size_is(count)] out string keys); nsisupports getvalue(in string key); void setvalue(in string key, in nsisupports value); nsisupports deletevalue(in string key); void clear(); methods haskey() check if a given key is present in the dictionary.
...setvalue() add the key-value pair to the dictionary.
... void setvalue( in string key, in nsisupports value ); parameters key the key by which the value can be accessed.
nsIDragService
if this is supplied, the aimagex and aimagey arguments specify the offset within the image where the cursor would be positioned.
... that is, when the image is drawn, it is offset up and left the amount so that the cursor appears at that location within the image.
... if aimage is null, aimagex and aimagey are not used and the image is instead determined from the source node adomnode, and the offset calculated so that the initial location for the image appears in the same screen position as where the element is located.
nsIExternalProtocolService
getapplicationdescription(in autf8string ascheme); nsihandlerinfo getprotocolhandlerinfo(in acstring aprotocolscheme); nsihandlerinfo getprotocolhandlerinfofromos(in acstring aprotocolscheme, out boolean afound); boolean isexposedprotocol(in string aprotocolscheme); void loaduri(in nsiuri auri, [optional] in nsiinterfacerequestor awindowcontext); void loadurl(in nsiuri aurl); void setprotocolhandlerdefaults(in nsihandlerinfo ahandlerinfo, in boolean aoshandlerexists); methods externalprotocolhandlerexists() check whether a handler for a specific protocol exists.
... setprotocolhandlerdefaults() set some sane defaults for a protocol handler object.
... void setprotocolhandlerdefaults( in nsihandlerinfo ahandlerinfo, in boolean aoshandlerexists ); parameters ahandlerinfo an nsihandlerinfo object, as returned by getprotocolhandlerinfofromos().
nsIFileStreams
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed.
... close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached.
... reopen_on_rewind 1<<3 if this is set, the file will be reopened whenever seek(0) occurs.
nsIGlobalHistory2
inherits from: nsisupports last changed in gecko 1.7 this interface replaces and deprecates nsiglobalhistory method overview void adduri(in nsiuri auri, in boolean aredirect, in boolean atoplevel, in nsiuri areferrer); boolean isvisited(in nsiuri auri); void setpagetitle(in nsiuri auri, in astring atitle); methods adduri() add a uri to global history.
...setpagetitle() set the page title for the given uri.
...void setpagetitle( in nsiuri auri, in astring atitle ); parameters auri the nsiuri for which to set to the title.
nsIGlobalHistory3
method overview void adddocumentredirect(in nsichannel aoldchannel, in nsichannel anewchannel, in print32 aflags, in boolean atoplevel); unsigned long geturigeckoflags(in nsiuri auri); void seturigeckoflags(in nsiuri auri, in unsigned long aflags); methods adddocumentredirect() notifies the history system that the page loading via aoldchannel redirected to anewchannel.
...seturigeckoflags() set the gecko flags for this uri.
...void seturigeckoflags( in nsiuri auri, in unsigned long aflags ); parameters auri the nsiuri to add flags for.
nsIJSON
void encodetostream(in nsioutputstream stream, in string charset, in boolean writebom, in jsobject value); jsval legacydecode(in astring str); deprecated since gecko 2.0 jsval legacydecodefromstream(in astring str); deprecated since gecko 2.0 jsval legacydecodetojsval(in astring str, in jscontext cx); native code only!
... void encodetostream( in nsioutputstream stream, in string charset, in boolean writebom in jsobject value ); parameters stream the nsioutputstream to which to write the json string.
... charset the string encoding to use.
nsILocaleService
return value the user's os setting for preferred locale.
...return value the user's os setting for preferred locale in the format described in nsilocale.
...return value the user's os setting for preferred locale.
nsINavHistoryContainerResultNode
this is false for bookmark folder nodes unless the setfolderreadonly() method has been called to specifically make the folder read-only.
... containeropen boolean set this to true to allow descent into this container.
...when you're done reading the container's children, set this to false.
nsINavHistoryQueryResultNode
method overview void getqueries([optional] out unsigned long querycount, [retval,array,size_is(querycount)] out nsinavhistoryquery queries); attributes attribute type description folderitemid long long for both simple folder nodes and simple-folder-query nodes, this is set to the concrete itemid of the folder.
... otherwise, this is set to -1.
...queries an array of nsinavhistoryquery objects describing the set of queries that build the node's children.
nsIPrefLocalizedString
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void setdatawithlength(in unsigned long length, [size_is(length)] in wstring data); wstring tostring(); attributes attribute type description data wstring provides access to string data stored in this property.
... methods setdatawithlength() used to set the contents of this object.
... void setdatawithlength( in unsigned long length, [size_is(length)] in wstring data ); parameters length the length of the string.
nsIProperties
to get an instance, use: var properties = components.classes["@mozilla.org/file/directory_service;1"] .getservice(components.interfaces.nsiproperties); method overview void get(in string prop, in nsiidref iid, [iid_is(iid),retval] out nsqiresult result); void getkeys(out pruint32 count, [array, size_is(count), retval] out string keys); boolean has(in string prop); void set(in string prop, in nsisupports value); void undefine(in string prop); methods get() gets the xpcom object associated with a particular name.
...set() sets the xpcom object associated with a particular name.
... void set( in string prop, in nsisupports value ); parameters prop the property name.
nsIRadioInterfaceLayer
unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
...requestid missing description processid missing description setupdatacall() pdp apis.
... void setupdatacall( in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype ); parameters radiotech missing description apn missing description user missing description passwd missing description chappap missing description pdptype missing description exceptions thrown missing exception missing description starttone() void starttone( in domstring dtmfchar ); parameters dtmfchar missing description exceptions thrown missing exception missing description stoptone() void stoptone(); parameters none.
nsIRequest
for https, this flag is set automatically.
... the following flags control the frequency of cached content validation when neither load_bypass_cache or load_from_cache are set.
... constant value description load_anonymous 1 << 14 when set, this flag indicates that no user-specific data should be added to the request when opened.
nsIResumableChannel
methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the specified offset.
...startpos the starting offset, in bytes, to use to download.
...void resumeat( in unsigned long long startpos, in acstring entityid ); parameters startpos the starting offset, in bytes, to use to download.
nsISelection2
method overview void getrangesforinterval(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results); void getrangesforintervalcomarray(in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results); native code only!
... void getrangesforinterval( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, out pruint32 resultcount, [retval, array, size_is(resultcount)] out nsidomrange results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
... native code only!getrangesforintervalcomarray void getrangesforintervalcomarray( in nsidomnode beginnode, in print32 beginoffset, in nsidomnode endnode, in print32 endoffset, in prbool allowadjacent, in rangearray results ); parameters beginnode beginoffset endnode endoffset these four parameters represent the range to compare against the selection.
nsISelectionImageService
inherits from: nsisupports last changed in gecko 1.7 method overview void getimage(in short selectionvalue, out imgicontainer container); void reset(); methods getimage() retrieve the image for alpha blending.
... void getimage( in short selectionvalue, out imgicontainer container ); parameters selectionvalue container reset() the current image is marked as invalid.
... void reset(); parameters none.
nsIStreamListener
method overview void ondataavailable(in nsirequest arequest, in nsisupports acontext, in nsiinputstream ainputstream, in unsigned long aoffset, in unsigned long acount); methods ondataavailable() this method is called when the next chunk of data for the ongoing request may be read without blocking the calling thread.
...void ondataavailable( in nsirequest arequest, in nsisupports acontext, in nsiinputstream ainputstream, in unsigned long aoffset, in unsigned long acount ); parameters arequest an nsirequest indicating the source of the data.
...aoffset number of bytes that were sent in previous ondataavailable() calls for this request.
nsITXTToHTMLConv
method overview void preformathtml(in boolean value); void settitle(in wstring text); prior versions of the interface named the methods using the initialcaps style instead of the intercaps style.
... settitle() sets the title to use on the resulting html document.
... void settitle( in wstring text ); parameters text title to set for the html document.
nsITaskbarProgress
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void setprogressstate(in nstaskbarprogressstate state, in unsigned long long currentvalue optional, in unsigned long long maxvalue optional); constants constant value description state_no_progress 0 stop displaying progress on the taskbar button.
... methods setprogressstate() sets the taskbar progress state and value for this window.
...void setprogressstate( in nstaskbarprogressstate state, in unsigned long long currentvalue, optional in unsigned long long maxvalue optional ); parameters state one of the state constants.
nsITimer
note: re-setting the delay on a one-shot timer that has already fired doesn't restart the timer.
...this target must be set before calling any of the initialization methods.
...the subject is set to the nsitimer object which fired, the topic is equal to "timer-callback" and data is always set to null.
nsIUploadChannel2
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void explicitsetuploadstream(in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders); methods explicitsetuploadstream() sets a stream to be uploaded by this channel with the specified content-type and content-length header values.
... void explicitsetuploadstream( in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheaders ); parameters astream the stream to be uploaded by this channel.
...amethod the http request method to set on the stream.
nsIVariant
return value the value is converted to an 8-bit string in the iso-8859-1 character set.
...return value the value is converted to an 8-bit string in the iso-8859-1 character set.
... str the value is converted to an 8-bit string in the iso-8859-1 character set.
nsIWebBrowserFind
to change this behavior, and to explicitly set the frame to search, queryinterface to nsiwebbrowserfindinframes.
... note: that you can control whether the search propagates into child or parent frames explicitly using nsiwebbrowserfindinframes, but if one, but not both, of searchsubframes and searchparentframes are set, this returns false.
... methods findnext() finds, highlights, and scrolls into view the next occurrence of the search string, using the current search settings.
nsIWebContentHandlerRegistrar
can bypass this by opening about:config and setting preference of gecko.handlerservice.allowregisterfromdifferenthost to true.
...to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler'permission denied to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler' when calling method: [nsiwebcontenthandlerregistrar::registerprotocolhandler] if the host names do match then a confirmation like this will be seen: this domain check can be bypassed by setting the preference of gecko.handlerservice.allowregisterfromdifferenthost to true as in this code here: var {classes: cc, interfaces: ci, utils: cu} = components; cu.import("resource://gre/modules/services.jsm"); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var allowregisterfromdifferenthost ...
...= services.prefs.getboolpref('gecko.handlerservice.allowregisterfromdifferenthost'); if (!allowregisterfromdifferenthost) { services.prefs.setboolpref('gecko.handlerservice.allowregisterfromdifferenthost', true); } var htmlcontentwindow = services.wm.getmostrecentwindow('navigator:browser'); //because we set the preference to true above, we need any window that has a browser, just pass the domwindow and the registerprotocolhandler will get the contentwindow from it nsiwchr.registerprotocolhandler("mailto", "http://mail.live.com/secure/start?action=compose&to=%s", "outlook.com live mail", htmlcontentwindow); if (!allowregisterfromdifferenthost) { //it this variable is false, than we had set the pref to true obviously.
nsIWindowsShellService
inherits from: nsishellservice last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview string getregistryentry(in long ahkeyconstant, in string asubkeyname, in string avaluename); obsolete since gecko 1.8 void restorefilesettings(in boolean aforallusers); obsolete since gecko 1.9 void shortcutmaintenance(); attributes attribute type description desktopbackgroundcolor unsigned long the desktop background color, visible when no background image is used, or if the background image is centered and does not fill the entire screen.
... restorefilesettings() obsolete since gecko 1.9 (firefox 3) restores system settings to what they were before firefox modified them.
... void restorefilesettings( in boolean aforallusers ); parameters aforallusers whether or not firefox should restore settings for all users on a multi-user system.
nsIXMLHttpRequest
the most obvious benefit is that we can set nsirequest - constants in the xhr.channel.loadflags.
... using event handlers from native code (not sure if it's up-to-date) from native code, the way to set up onload and onerror handlers is a bit different.
... ':' + xhr.status + ']'); break; } }; let evf = f => ['load', 'error', 'abort'].foreach(f); evf(m => xhr.addeventlistener(m, handler, false)); xhr.mozbackgroundrequest = true; xhr.open('get', url, true); xhr.channel.loadflags |= ci.nsirequest.load_anonymous | ci.nsirequest.load_bypass_cache | ci.nsirequest.inhibit_persistent_caching; xhr.responsetype = "arraybuffer"; //dont set it, so it returns string, you dont want arraybuffer.
nsMsgFolderFlagType
exactly one will be set.
... */ const nsmsgfolderflagtype elided = 0x00000010; /// whether this is a virtual search folder const nsmsgfolderflagtype virtual = 0x00000020; /** @name news folder flags * these flags only occur in folders which have * the nsmsgfolderflags::newsgroup bit set, and do * not have the nsmsgfolderflags::directory or * nsmsgfolderflags::elided bits set.
... const nsmsgfolderflagtype unused2 = 0x00000080; /** @} */ /** @name mail folder flags * these flags only occur in folders which have * the nsmsgfolderflags::mail bit set, and do * not have the nsmsgfolderflags::directory or * nsmsgfolderflags::elided bits set.
nsPIPromptService
this interface defines the meaning of each indexes of getint(), setint(), getstring() and setstring() of the nsidialogparamblock interface but they are defined on in c++.
... the indexes for getstring() and setstring() are: emsg the value is 0.
... the indexes for getint() and setint() are: ebuttonpressed the value is 0.
NS_CStringAppendData
remarks this function is defined inline as a wrapper around ns_cstringsetdatarange.
... example nscstringcontainer str; ns_cstringcontainerinit(str); ns_cstringsetdata(str, "hello"); ns_cstringappenddata(str, " world"); const char* data; ns_cstringgetdata(str, &data); printf("%s\n", data); // prints out "hello world" ns_cstringcontainerfinish(str); history this function was frozen for mozilla 1.7.
... see also ns_cstringsetdatarange, nsacstring ...
NS_CStringCutData
remarks this function is defined inline as a wrapper around ns_cstringsetdatarange .
... example code nscstringcontainer str; ns_cstringcontainerinit(str); ns_cstringsetdata(str, "hello world"); // remove " world" portion of string ns_cstringcutdata(str, 5, pr_uint32_max); const char* data; ns_cstringgetdata(str, &data); printf("%s\n", data); // prints out "hello" ns_cstringcontainerfinish(str); history this function was frozen for mozilla 1.7.
... see also ns_cstringsetdatarange , nsacstring ...
NS_StringAppendData
remarks this function is defined inline as a wrapper around ns_stringsetdatarange note: gcc requires the -fshort-wchar option to compile this example since prunichar is an unsigned short.
... example code nsstringcontainer str; ns_stringcontainerinit(str); ns_stringsetdata(str, l"hello"); ns_stringappenddata(str, l" world"); const prunichar* data; ns_stringgetdata(str, &data); // data now points to the string: l"hello world" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7.
... see also ns_stringsetdatarange, nsastring ...
NS_StringCutData
remarks this function is defined inline as a wrapper around ns_stringsetdatarange.
... example code nsstringcontainer str; ns_stringcontainerinit(str); ns_stringsetdata(str, l"hello world"); // remove " world" portion of string ns_stringcutdata(str, 5, pr_uint32_max); const prunichar* data; ns_stringgetdata(str, &data); // data now ponts to the string: l"hello" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7.
... see also ns_stringsetdatarange, nsastring ...
nsIMsgCloudFileProvider
settingsurl acstring readonly: a chrome url for an xhtml page displayed in the account setup dialog window, used for displaying and setting provider-specific settings.
... managementurl acstring readonly: a chrome url for an xhtml page displayed within the filelink preferences dialog, used for displaying and setting provider-specific settings once the account has already been set up.
...this might change in the future, but as it stands, this function can simply return ns_error_not_implemented unless there are plans to call createnewaccount from the management or settings xhtml files.
Building a Thunderbird extension 6: Adding JavaScript
window.addeventlistener("load", function(e) { startup(); }, false); window.setinterval( function() { startup(); }, 60000); //update date every minute function startup() { var mypanel = document.getelementbyid("my-panel"); var date = new date(); var day = date.getday(); var datestring = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.label = "date: " + datestring; } the first part registers a new event listener that will be executed ...
...finally the label of our panel is set to "date: " and concatenated with the date string that contains the formatted date.
... we use the function window.setinterval to update the date in case thunderbird is left running for more than one day.
Activity Manager examples
rovided process.init("processing folder: " + folder.prettiestname, null); // note that we don't define a custom icon, default process icon // will be used process.contexttype = "account"; // group this activity by account process.contextobj = folder.server; // account in question gactivitymanager.addactivity(process); // step 2: showing some progress let percent = 50; process.setprogress(percent, "junk processing 25 of 50 messages", 25, 50); // step 3: removing the process and adding an event using process' attributes process.state = components.interfaces.nsiactivityprocess.state_completed; gactivitymanager.removeactivity(process.id); let event = components.classes["@mozilla.org/activity-event;1"].createinstance(nsiae); // localization is omitted, initiator is omitted ...
... // wrap copyservice in a nsvariant component nscomptr<nsiwritablevariant> initiator = do_createinstance(ns_variant_contractid); initiator->setasisupports(reinterpret_cast<nsisupports*>(copyservice)); // subject of the delete operation is the imap folder // wrap it in a nsvariant component nscomptr<nsiwritablevariant> srcfolder = do_createinstance(ns_variant_contractid); srcfolder->setasisupports(reinterpret_cast<nsisupports*>(imapfolder)); copyevent->addsubject(srcfolder); copyevent->init(ns_literal_string("message copy event"), ...
... initiator, ns_literal_string("completed successfully"), pr_now() / pr_usec_per_msec, // start time pr_now() / pr_usec_per_msec); // completion time // do not forget to increase the ref counter if needed copyevent->setundohandler(undohandler); //////////////////////////////////////////////////////////////// //// adding the event into activity manager nscomptr<nsiactivitymanager> activitymgr(do_getservice("@mozilla.org/activity-manager;1")); pruint32 id; activitymgr->addactivity(copyevent, &id); adding an activity with a custom context type this sample shows how to provide a custom context type for junk processing.
Using MAPI with Thunderbird's Windows 7 developer builds
the thunderbird installer sets the installed build as the default mapi/mail client.
... if you want to set a debug build as the default mail client, you need configure it manually: in the objdir/mozilla/dist/bin directory, copy mozmapi32.dll to mozmapi32_inuse.dll and mapiproxy to mapiproxy_inuse.dll.
... (be sure to copy - not move - these files.) in the uninstall sub-directory of the bin directory, run these two commands: helper.exe /setasdefaultappglobal helper.exe /setasdefaultappuser create an elevated shell and register the mapi proxy.dll as a com server.
Using the Mozilla symbol server
to use only the mozilla symbol server, add the following entry to your symbol path (note: you can replace c:\symcache\ with any writable directory on your computer, if you'd prefer a different location for downloaded symbols): srv*c:\symcache\*https://symbols.mozilla.org/ set this string as _nt_symbol_path in the environment, using the windbg menus, or by typing the .sympath command.
... troubleshooting: symbols will not download if symbols will not download no matter what you do, the problem may be that internet explorer has been set to the work offline mode.
...this is because microsoft uses internet explorer's internet & proxy settings to download the symbol files.
Flash Activation: Browser Comparison - Plugins
mozilla firefox google chrome microsoft edge setting name ask to activate html5 by default click-to-run 'application/x-shockwave-flash' in navigator.mimetypes by default when flash is inactive yes no no 'application/x-shockwave-flash' in navigator.mimetypes when user enables flash yes yes yes <object> with fallback content triggers ui yes, with exceptions no yes small/hidde...
...that function can then issue the call into the plugin, knowing that everything is set up and ready to go.
... first, set your up your html with a callback that calls the javascript function plugincreated(), like this: <object type="application/x-my-plugin" data="somedata.mytype" id="myplugin"> <param name="callback" value="plugincreated()"> </object> the plugincreated() function is then responsible for the setup of your script and any calls back into the plugin that you need to make: function plugincreated() { document.getelementbyid('myplugin').callpluginmethod(); } ...
Debug worker threads - Firefox Developer Tools
you can open the javascript file for the worker process and set breakpoints and logpoints just as you can with javascript code running on the main thread.
... setting breakpoints, etc.
... you can set a breakpoint (or logpoint) on any active worker thread: when execution is paused in a worker thread, the context of the debugger is updated to show the correct breakpoints, call stack, etc., just as you'd expect.
Debugger.Environment - Firefox Developer Tools
when true, getvariable returns an ordinary javascript object whose optimizedout property is true on all bindings, and setvariable throws a referenceerror.
... setvariable(name,value) storevalue as the value of the variable bound toname in this environment.name must be a string that is a valid ecmascript identifier name;value must be a debuggee value.
... source metadata generated from file: js/src/doc/debugger/debugger.environment.md watermark: sha256:3d6f67939e351803d5d7fe201ed38c4aaf766caf032f255e168df1f1c6fe73cb changeset: 7ae377917236 ...
Dominators view - Firefox Developer Tools
call stack in the toolbar at the top of the tool is a dropdown called "label by": by default, this is set to "type".
... however, you can set it instead to "call stack" to see exactly where in your code the objects are being allocated.
... taking a snapshot to see what it looks like in the dominators view: load the page enable the memory tool in the settings, if you haven't already open the memory tool check "record call stacks" press the button labeled "make monsters!" take a snapshot switch to the "dominators" view analyzing the dominators tree you'll see the three arrays as the top three gc roots, each retaining about 23% of the total memory usage: if you expand an array, you'll see the objects (monsters) it contains.
Reposition elements in the page - Firefox Developer Tools
if an element has its position property set to absolute, relative or fixed and one or more of the top, bottom , left or right properties, the box model view displays a button: if you click that button, two handles appear next to the element: you can use these handles to drag the element around the page.
... if the element is absolutely positioned, dashed lines are shown representing the offset parent.
...the offsets are indicated by a line and a tooltip for each side.
Work with animations - Firefox Developer Tools
each dot represents an entry for that property in the set of keyframes used for the animation.
...if you hover over a dot, you'll see the value assigned to that property at that point in the timeline: this is essentially a visual representation of the animation's keyframes: var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)' }, { filter: 'grayscale(100%)', offset: 0.333 }, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)' } ]; application to the example applying all this to our example, we can see that: the animation involved two elements, span#note and img#icon.
... the cubic bézier editor includes a number of presets, grouped under "ease-in", "ease-out", and "ease-in-out": ...
UI Tour - Firefox Developer Tools
html pane the inspector is split into two or three sections, depending on your settings.
...if the page includes any sections using either the flexbox display model or css grids, this view shows the flexbox or grid settings used on the page.
... to configure the set of browsers you want the compatibility view to check for, click settings at the bottom of the panel.
Waterfall - Firefox Developer Tools
javascript functions executed in the page are labeled with the reason the function was called: script tag setinterval settimeout requestanimationframe promise callback promise init worker javascript uri event handler stack call stack, with links to functions.
...spidermonkey uses a complex set of heuristics to determine when gc is needed, and when non-incremental gc in particular is needed.
... for example, consider code like this: var timerbutton = document.getelementbyid("timer"); timerbutton.addeventlistener("click", handleclick, false); function handleclick() { console.time("timer"); runtimer(1000).then(timerfinished); } function timerfinished() { console.timeend("timer"); console.log("ready!"); } function runtimer(t) { return new promise(function(resolve) { settimeout(resolve, t); }); } the waterfall will display a marker for the period between time() and timeend(), and if you select it, you'll see the async stack in the sidebar: timestamp markers timestamps enable you to mark an instant in the recording.
Taking screenshots - Firefox Developer Tools
to enable it: visit the settings page find the section labeled "available toolbox buttons" check the box labeled "take a screenshot of the entire page".
...just check the box in settings labeled "screenshot to clipboard": now, whenever you take a screenshot, the screenshot is also copied to the clipboard.
... taking screenshots with the web console if you need to specify a different device-pixel-ratio, set a delay before taking the screenshot, or specify your own file name, starting in firefox 62 you can use the :screenshot helper function in the web console.
The JavaScript input interpreter - Firefox Developer Tools
you get autocomplete suggestions for array elements, as well: you can enable or disable autocompletion via the settings ("gear") menu in the web console toolbar.
... you can enable or disable instant evaluation via the settings ("gear") menu in the web console toolbar.
...rame); you can pass a css selector that matches the iframe: cd("#frame1"); you can pass the iframe's global window object: var frame = document.getelementbyid("frame1"); cd(frame.contentwindow); to switch the context back to the top-level window, call cd() with no arguments: cd(); for example, suppose we have a document that embeds an iframe: <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <iframe id="frame1" src="static/frame/my-frame1.html"></iframe> </body> </html> the iframe defines a new function: <!doctype html> <html> <head> <meta charset="utf-8"> <script> function whoareyou() { return "i'm frame1"; } </script> </head> <body> </body> </html> you can switch context to the iframe like this: cd("#frame...
Animation.currentTime - Web APIs
the animation.currenttime property of the web animations api returns and sets the current time value of the animation in milliseconds, whether running or paused.
...at the start of the game, her height is set between the two extremes by setting her animation's currenttime to half her keyframeeffect's duration: alicechange.currenttime = alicechange.effect.timing.duration / 2; a more generic means of seeking to the 50% mark of an animation would be: animation.currenttime = animation.effect.getcomputedtiming().delay + animation.effect.getcomputedtiming().activeduration / 2; reduced time precision...
... to offer protection against timing attacks and fingerprinting, the precision of animation.currenttime might get rounded depending on browser settings.
Animation.playState - Web APIs
the animation.playstate property of the web animations api returns and sets an enumerated value describing the playback state of an animation.
...so they must be paused as soon as they are animated like so: // setting up the tear animations tears.foreach(function(el) { el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tear iterations: infinity, easing: 'cubic-bezier(0.6, 0.04, 0.98, 0.335)' }); el.pause(); }); // play the tears falling when the ending need...
... tears.foreach(function(el) { el.play(); }); // reset the crying tears animations and pause them.
Animation.playbackRate - Web APIs
the animation.playbackrate property of the web animations api returns or sets the playback rate of the animation.
... setting an animation’s playbackrate to 0 effectively pauses the animation (however, its playstate does not necessarily become paused).
...cake.addeventlistener("mousedown", growalice, false); cake.addeventlistener("touchstart", growalice, false); in another example, the red queen's race game, alice and the red queen are constantly slowing down: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.playbackrate *= .9; } }, 3000); but clicking or tapping on them causes them to speed up by multiplying their playbackrate: var gofaster = function() { redqueen_alice.playbackrate *= 1.1; } document.addeventlistener("click", gofaster); document.add...
AudioBufferSourceNode.loop - Web APIs
the loop property of the audiobuffersourcenode interface is a boolean indicating if the audio asset must be replayed when the end of the audiobuffer is reached.
... you can run the full example live (or view the source.) function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio...
... data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } specification specification status comment web audio apithe definition of 'loop' in that specification.
AudioBufferSourceNode.loopStart - Web APIs
syntax audiobuffersourcenode.loopstart = startoffsetinseconds; startoffsetinseconds = audiobuffersourcenode.loopstart; value a floating-point number indicating the offset, in seconds, into the audio buffer at which each loop should begin during playback.
...for example, if you set their values to 20 and 25, respectively, the audio will start to loop between 20 and 25 seconds in to the track.
... function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; songlength = buffer.duration; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; loopstartcontrol.setattribute('max', math.floor(songlength)); loopendcontrol.setattribute('max', math.floor(songlength)); }, function(e){"error with ...
AudioScheduledSourceNode.start() - Web APIs
syntax audioscheduledsourcenode.start([when [, offset [, duration]]]); parameters when optional the time, in seconds, at which the sound should begin to play.
... offset optional a floating-point number indicating the offset, in seconds, into the audio buffer where playback should begin.
...if no value is passed then the duration will be equal to the length of the audio buffer minus the offset value return value undefined exceptions invalidstatenode the node has already been started.
BiquadFilterNode - Web APIs
biquadfilternode.getfrequencyresponse() from the current filter parameter settings this method calculates the frequency response for frequencies specified in the provided array of frequencies.
... var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode...
....connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); specifications specification status comment web audio apithe definition of 'biquadfilternode' in that specification.
characteristic - Web APIs
full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
readValue() - Web APIs
full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
uuid - Web APIs
full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
value - Web APIs
full support 57notes disabled notes linux and versions of windows earlier than 10.disabled from version 57: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support ≤79notes disabled notes linux and versions of windows earlier than 10.disabled from version ≤79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
... full support 44notes disabled notes linux and versions of windows earlier than 10.disabled from version 44: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
CSSKeywordValue.CSSKeywordValue() - Web APIs
syntax var csskeywordvalue = new csskeywordvalue(val) parameters value sets or returns the value of the new csskeywordvalue.
... examples the following example resets the css display property to its defaults, setting the inline style attribute to style="display: initial" if viewed in the developer tools inspector.
... #myelement { display: flex; } <div id="myelement">check the developer tools to see the log in the console and to inspect the style attribute on this div.</div> let keyword = new csskeywordvalue('initial'); let myelement = document.getelementbyid('myelement').attributestylemap; myelement.set('display', keyword); console.log( myelement.get('display').value); // 'initial' console.dir( keyword ); specifications specification status comment css typed om level 1the definition of 'csskeywordvalue' in that specification.
CSSKeywordValue.value - Web APIs
the value property of the csskeywordvalue interface returns or sets the value of the csskeywordvalue.
... examples the following example resets the css display property to its defaults.
... let indicator = document.getelementbyid('indicator'); indicator.attributestylemap.set('display', new csskeywordvalue('initial')); indicator.attributestylemap.get('display').value // 'initial' specifications specification status comment css typed om level 1the definition of 'undefined' in that specification.
CSSKeywordValue - Web APIs
properties csskeywordvalue.value returns or sets the value of the csskeywordvalue.
... examples the following example resets the css display property to its defaults, setting the inline style attribute to style="display: initial" if viewed in the developer tools inspector.
... #myelement { display: flex; } <div id="myelement">check the developer tools to see the log in the console and to inspect the style attribute on this div.</div> let myelement = document.getelementbyid('myelement').attributestylemap; myelement.set('display', new csskeywordvalue('initial')); console.log( myelement.get('display').value); // 'initial' specifications specification status comment css typed om level 1the definition of 'csskeywordvalue' in that specification.
CSSPrimitiveValue - Web APIs
it may be used to determine the value of a specific style property currently set in a block or to set a specific style property explicitly within the block.
... cssprimitivevalue.setfloatvalue() a method to set the float value with a specified unit.
... cssprimitivevalue.setstringvalue() a method to set the string value with the specified unit.
CSSRule.cssText - Web APIs
WebAPICSSRulecssText
be aware that this property can no longer be set directly, as it is now specified to be functionally modify-only, and silently so.
... in other words, attempting to set it does absolutely nothing, and doesn't even omit a warning or error.
... furthermore, it has no settable sub-properties.
CSSStyleRule.selectorText - Web APIs
the cssrule.selectortext property gets the textual representation of the selector for the rule set.
... this is readonly in some browsers; to set stylesheet rules dynamically cross-browser, see using dynamic styling information.
...if set to a selector string which cannot be parsed, a syntaxerror is thrown.
CSSStyleValue.parse() - Web APIs
the parse() method of the cssstylevalue interface sets a specific css property to the specified values and returns the first value as a cssstylevalue object.
... syntax cssstylevalue.parse(property, csstext) parameters property a css property to set.
... example the code below parses a set of declarations for the transform property.
CSS Painting API - Web APIs
you can then apply these values to properties like background-image to set complex custom backgrounds on an element.
... paintrenderingcontext2d implements a subset of the canvasrenderingcontext2d api.
... dictionaries paintrenderingcontext2dsettings a dictionary providing a subset of canvasrenderingcontext2d settings.
Cache.delete() - Web APIs
WebAPICachedelete
if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
Cache - Web APIs
WebAPICache
var expectedcachenamesset = new set(object.values(current_caches)); event.waituntil( caches.keys().then(function(cachenames) { return promise.all( cachenames.map(function(cachename) { if (!expectedcachenamesset.has(cachename)) { // if this cache name isn't present in the set of "expected" cache names, then delete it.
... // it will return a normal response object that has the appropriate error code set.
... console.error(' error in fetch handler:', error); throw error; }); }) ); }); storing cookies in caches the fetch api requires set-cookie headers to be stripped before returning a response object from fetch().
CacheStorage.has() - Web APIs
WebAPICacheStoragehas
if so, we add a list of assets to it.
... if not then we run some kind of cache set-up function.
... caches.has('v1').then(function(hascache) { if (!hascache) { somecachesetupfunction(); } else { caches.open('v1').then(function(cache) { return cache.addall(myassets); }); } }).catch(function() { // handle exception here.
CacheStorage.match() - Web APIs
for example, if set to true, the ?value=bar part of http://foo.com/?value=bar would be ignored when performing a match.
... ignoremethod: a boolean that, when set to true, prevents matching operations from validating the request http method (normally only get and head are allowed.) it defaults to false.
... ignorevary: a boolean that, when set to true, tells the matching operation not to perform vary header matching.
CanvasRenderingContext2D.clearRect() - Web APIs
the canvasrenderingcontext2d.clearrect() method of the canvas 2d api erases the pixels in a rectangular area by setting them to transparent black.
... syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)).
...the dimensions of the cleared area are set to equal the <canvas> element's width and height attributes.
CanvasRenderingContext2D.filter - Web APIs
a drop shadow is effectively a blurred, offset version of the drawing's alpha mask drawn in a particular color, composited below the drawing.
... this function takes up to five arguments: <offset-x>: see <length> for possible units.
... <offset-y>: see <length> for possible units.
CanvasRenderingContext2D.getTransform() - Web APIs
we apply a transform to the first one's context using canvasrenderingcontext2d.settransform() and draw a square on it, then retrieve the matrix from it using gettransform().
... we then apply the retrieved matrix directly to the second canvas context by passing the dommatrix object directly to settransform(), and draw a circle on it.
... html <canvas width="240"></canvas> <canvas width="240"></canvas> css canvas { border: 1px solid black; } javascript const canvases = document.queryselectorall('canvas'); const ctx1 = canvases[0].getcontext('2d'); const ctx2 = canvases[1].getcontext('2d'); ctx1.settransform(1, .2, .8, 1, 0, 0); ctx1.fillrect(25, 25, 50, 50); let storedtransform = ctx1.gettransform(); console.log(storedtransform); ctx2.settransform(storedtransform); ctx2.beginpath(); ctx2.arc(50, 50, 50, 0, 2 * math.pi); ctx2.fill(); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.gettransform' in that specification.
CanvasRenderingContext2D.globalAlpha - Web APIs
values outside that range, including infinity and nan, will not be set, and globalalpha will retain its previous value.
...next, we set the globalalpha property to 0.2 (20% opaque); this alpha level will apply to all of our transparent shapes.
...vas id="canvas" width="150" height="150"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // draw background ctx.fillstyle = '#fd0'; ctx.fillrect(0, 0, 75, 75); ctx.fillstyle = '#6c0'; ctx.fillrect(75, 0, 75, 75); ctx.fillstyle = '#09f'; ctx.fillrect(0, 75, 75, 75); ctx.fillstyle = '#f30'; ctx.fillrect(75, 75, 75, 75); ctx.fillstyle = '#fff'; // set transparency value ctx.globalalpha = 0.2; // draw transparent circles for (let i = 0; i < 7; i++) { ctx.beginpath(); ctx.arc(75, 75, 10 + 10 * i, 0, math.pi * 2, true); ctx.fill(); } screenshotlive sample specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.globalalpha' in that specification.
CanvasRenderingContext2D.miterLimit - Web APIs
the canvasrenderingcontext2d.miterlimit property of the canvas 2d api sets the miter limit ratio.
... playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.beginpath(); ctx.moveto(0,0); ctx.linewidth = 15; ctx.lineto(100, 100); ctx.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("reset"); var edit = document.getelementbyid("e...
...dit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); screenshotlive sample specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.miterlimit' in that specification.
CanvasRenderingContext2D.shadowBlur - Web APIs
note: shadows are only drawn if the shadowcolor property is set to a non-transparent value.
... one of the shadowblur, shadowoffsetx, or shadowoffsety properties must be non-zero, as well.
...the shadowcolor property sets its color, and shadowblur sets its level of bluriness.
Manipulating video using canvas - Web APIs
this method's job is to prepare the variables needed by the chroma-key processing code, and to set up an event listener so we can detect when the user starts playing the video.
... processor.timercallback = function timercallback() { if (this.video.paused || this.video.ended) { return; } this.computeframe(); let self = this; settimeout(function() { self.timercallback(); }, 0); }, the first thing the callback does is check to see if the video is even playing; if it's not, the callback returns immediately without doing anything.
... the last thing the callback does is call settimeout() to schedule itself to be called again as soon as possible.
ChildNode - Web APIs
WebAPIChildNode
childnode.before() inserts a set of node or domstring objects in the children list of this childnode's parent, just before this childnode.
... childnode.after() inserts a set of node or domstring objects in the children list of this childnode's parent, just after this childnode.
... childnode.replacewith() replaces this childnode in the children list of its parent with a set of node or domstring objects.
Clients.matchAll() - Web APIs
WebAPIClientsmatchAll
syntax self.clients.matchall(options).then(function(clients) { // do something with your clients list }); parameters options optional an options object allowing you to set options for the matching operation.
... available options are: includeuncontrolled: a boolean — if set to true, the matching operation will return all service worker clients who share the same origin as the current service worker.
... type: sets the type of clients you want matched.
console - Web APIs
WebAPIConsole
the specifics of how it works varies from browser to browser, but there is a de facto set of features that are typically provided.
... console.countreset() resets the value of the counter with the given label.
...you should set it to for example display: inline-block.
ConstantSourceNode() - Web APIs
options a constantsourceoptions dictionary object defining the properties you want the constantsourcenode to have: offset: a read-only audioparam specifying the constant value generated by the source.
... example in this example, an audio context is created, then a constantsourcenode is established with its offset initialized to 0.5.
... let audiocontext = new audiocontext(); let myconstantsource = new constantsourcenode(audiocontext, { offset: 0.5 }); note: the new constantsourcenode created by the constructor has a channelcount of 2.
ConvolverNode.buffer - Web APIs
for example, if you want to model the reverb in your bathroom, you might set up a microphone near the door to record the sound of a balloon pop or synthesized impulse from the sink.
...at the time when this attribute is set, the buffer and the state of the attribute will be used to configure the convolvernode with this impulse response having the given normalization.
... // grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajaxrequest = new xmlhttprequest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
DOMMatrix - Web APIs
WebAPIDOMMatrix
the identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).
...if the matrix can't be inverted, its components are all set to nan, and is2d returns false.
... dommatrix.setmatrixvalue() replaces the contents of the matrix with the matrix described by the specified transform or transforms.
DOMMatrixReadOnly - Web APIs
the identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).
...if the matrix cannot be inverted, the new matrix's components are all set to nan and its is2d property is set to false.
...if no matrix is specified, the matrix is initialized with every element set to 0 except the bottom-right corner and the element immediately above and to its left: m33 and m34.
Binary strings - Web APIs
WebAPIDOMStringBinary
a subset of these strings is represented by utf-16 strings containing only ascii characters (i.e., characters whose code point does not exceed 127).
... for instance, the string "hello world!" belongs to the ascii subset, while the string "ÀÈÌÒÙ" does not.
... a binary string is a concept similar to the ascii subset, but instead of limiting the range to 127, it allows code points until 255.
DOMTokenList.toggle() - Web APIs
if set to false, then token will only be removed, but not added.
... if set to true, then token will only be added, but not removed.
... examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList - Web APIs
the domtokenlist interface represents a set of space-separated tokens.
... such a set is returned by element.classlist, htmllinkelement.rellist, htmlanchorelement.rellist, htmlareaelement.rellist, htmliframeelement.sandbox, or htmloutputelement.htmlfor.
... examples in the following simple example, we retrieve the list of classes set on a <p> element as a domtokenlist using element.classlist, add a class using domtokenlist.add(), and then update the node.textcontent of the <p> to equal the domtokenlist.
DataTransfer.mozCursor - Web APIs
the datatransfer.mozcursor property returns or sets the drag cursor's state.
... default uses the default gecko behavior, which is to set the cursor to an arrow during the drag operation.
... note: if any value other than default is set, auto is assumed.
DataTransfer.types - Web APIs
the datatransfer.types read-only property returns an array of the drag data formats (as strings) that were set in the dragstart event.
...,items} properties</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfe...
...items[" + i + "].kind = " + ev.datatransfer.items[i].kind + " ; type = " + ev.datatransfer.items[i].type); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </script> <body> <h1>examples of <code>datatransfer</code>.{<code>types</code>, <code>items</code>} properties</h1> <ul> <li id="i1" ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the drop zone</li> </...
Document.body - Web APIs
WebAPIDocumentbody
the document.body property represents the <body> or <frameset> node of the current document, or null if no such element exists.
...in documents with <body> contents, returns the <body> element, and in frameset documents, this returns the outermost <frameset> element.
... though the body property is settable, setting a new body on a document will effectively remove all the current children of the existing <body> element.
Document.domain - Web APIs
WebAPIDocumentdomain
the domain property of the document interface gets/sets the domain portion of the origin of the current document, as used by the same origin policy.
... if this property is successfully set, the port part of the origin is also set to null.
... exceptions securityerror an attempt has been made to set domain under one of the following conditions: the document is inside a sandboxed <iframe> the document has no browsing context the document's effective domain is null the given value is not equal to the document's effective domain (or it is not a registerable domain suffix of it) the document-domain feature-policy is enabled examples getting the domain for the uri http://developer.mozilla.org/docs/web, this example sets currentdomain to the string "developer.mozilla.org".
Document: drag event - Web APIs
html <div class="dropzone"> <div id="draggable" draggable="true" ondragstart="event.datatransfer.setdata('text/plain',null)"> this div is draggable </div> </div> <div class="dropzone"></div> <div class="dropzone"></div> <div class="dropzone"></div> css #draggable { width: 200px; height: 20px; text-align: center; background: white; } .dropzone { width: 200px; height: 20px; background: blueviolet; margin-bottom: 10px; padding: 10px; } javascript var dragged; /* even...
...on the dragged elem dragged = event.target; // make it half transparent event.target.style.opacity = .5; }, false); document.addeventlistener("dragend", function(event) { // reset the transparency event.target.style.opacity = ""; }, false); /* events fired on the drop targets */ document.addeventlistener("dragover", function(event) { // prevent default to allow drop event.preventdefault(); }, false); document.addeventlistener("dragenter", function(event) { // highlight potential drop target when the draggable element enters it if (event.target.classname == "dropzone") { event.target.style.backgr...
...ound = "purple"; } }, false); document.addeventlistener("dragleave", function(event) { // reset background of potential drop target when the draggable element leaves it if (event.target.classname == "dropzone") { event.target.style.background = ""; } }, false); document.addeventlistener("drop", function(event) { // prevent default action (open as link for some elements) event.preventdefault(); // move dragged elem to the selected drop target if (event.target.classname == "dropzone") { event.target.style.background = ""; dragged.parentnode.removechild( dragged ); event.target.appendchild( dragged ); } }, false); specifications specification status comment html living standardthe definition of 'drag event' in that specificati...
Document: gotpointercapture event - Web APIs
the gotpointercapture event is fired when an element captures a pointer using setpointercapture().
...it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture.
... const para = document.queryselector('p'); document.addeventlistener('gotpointercapture', () => { console.log('i\'ve been captured!') }); para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, using the ongotpointercapture event handler property: const para = document.queryselector('p'); document.ongotpointercapture = () => { console.log('i\'ve been captured!') }; para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status pointer events obsolete ...
Document.title - Web APIs
WebAPIDocumenttitle
the document.title property gets or sets the current title of the document.
...if the title was overridden by setting document.title, it contains that value.
... in xul, accessing document.title before the document is fully loaded has undefined behavior: document.title may return an empty string and setting document.title may have no effect.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
the caretpositionfrompoint() property of the documentorshadowroot interface returns a caretposition object, containing the dom node, along with the caret and caret's character offset within that node.
... demo html content <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
...stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.</p> javascript content function insertbreakatpoint(e) { var range; var textnode; var offset; if (document.caretpositionfrompoint) { range = document.caretpositionfrompoint(e.clientx, e.clienty); textnode = range.offsetnode; offset = range.offset; } else if (document.caretrangefrompoint) { range = document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; offset = range.startoffset; } // only split text_nodes if (textnode.nodetype == 3) { var replacement = textnode.splittext(offset); var br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); ...
DocumentOrShadowRoot.elementFromPoint() - Web APIs
elements with pointer-events set to none will be ignored, and the element below it will be returned.
... example this example creates two buttons which let you set the current color of the paragraph element located under the coordinates (2, 2).
... javascript function changecolor(newcolor) { elem = document.elementfrompoint(2, 2); elem.style.color = newcolor; } the changecolor() method simply obtains the element located at the specified point, then sets that element's current foreground color property to the color specified by the newcolor parameter.
DocumentType - Web APIs
documenttype.internalsubset read only a domstring of the internal subset, or null if there is none.
... removed the internalsubset, entities, and notation properties.
... obsolete added the publicid, systemid, and internalsubset properties.
How to create a DOM tree - Web APIs
y="usa"/> <address street="321 south avenue" city="denver" state="co" country="usa"/> </person> </people> the w3c dom api, supported by mozilla, can be used to create an in-memory representation of this document like so: var doc = document.implementation.createdocument("", "", null); var peopleelem = doc.createelement("people"); var personelem1 = doc.createelement("person"); personelem1.setattribute("first-name", "eric"); personelem1.setattribute("middle-initial", "h"); personelem1.setattribute("last-name", "jung"); var addresselem1 = doc.createelement("address"); addresselem1.setattribute("street", "321 south st"); addresselem1.setattribute("city", "denver"); addresselem1.setattribute("state", "co"); addresselem1.setattribute("country", "usa"); personelem1.appendchild(addresselem1...
...); var addresselem2 = doc.createelement("address"); addresselem2.setattribute("street", "123 main st"); addresselem2.setattribute("city", "arlington"); addresselem2.setattribute("state", "ma"); addresselem2.setattribute("country", "usa"); personelem1.appendchild(addresselem2); var personelem2 = doc.createelement("person"); personelem2.setattribute("first-name", "jed"); personelem2.setattribute("last-name", "brown"); var addresselem3 = doc.createelement("address"); addresselem3.setattribute("street", "321 north st"); addresselem3.setattribute("city", "atlanta"); addresselem3.setattribute("state", "ga"); addresselem3.setattribute("country", "usa"); personelem2.appendchild(addresselem3); var addresselem4 = doc.createelement("address"); addresselem4.setattribute("street", "123 west st"); addr...
...esselem4.setattribute("city", "seattle"); addresselem4.setattribute("state", "wa"); addresselem4.setattribute("country", "usa"); personelem2.appendchild(addresselem4); var addresselem5 = doc.createelement("address"); addresselem5.setattribute("street", "321 south avenue"); addresselem5.setattribute("city", "denver"); addresselem5.setattribute("state", "co"); addresselem5.setattribute("country", "usa"); personelem2.appendchild(addresselem5); peopleelem.appendchild(personelem1); peopleelem.appendchild(personelem2); doc.appendchild(peopleelem); see also the dom chapter of the xul tutorial.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
this handles everything for you, and is definitely the preferred solution: ul { list-style-type: none; margin: 0; padding: 0; display: flex; } if you need to rely on inline-block, you could set the font-size of the list to 0.
...} or you could set negative margin on the list items: li { display: inline-block; width: 2rem; height: 2rem; margin-right: -0.25rem; } you can also solve this problem by putting your list items all on the same line in the source, which causes the whitespace nodes to not be created in the first place: <li></li><li></li><li></li><li></li><li></li> dom traversal and whitespace when trying to do dom manipulation in javascript, you can also encounter problems because of whitespace nodes.
... as another example, if you have a certain subset of elements that you want to do something to based on whether they are empty (have no child nodes) or not, you could check whether each element is empty using something like node.haschildnodes(), but again, if any target elements contain text nodes, you could end up with false results.
Document Object Model (DOM) - Web APIs
it is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided: documenttouch domconfiguration domerrorhandler domimplementationlist domimplementationregistry domimplementationsource domlocator domobject domsettabletokenlist domuserdata elementtraversal entity entityreference namelist notation typeinfo userdatahandler html dom a document containing html is described using the document interface, which is extended by the html specification to include various html-specific features.
...ecomponenttransferelement svgfecompositeelement svgfeconvolvematrixelement svgfediffuselightingelement svgfedisplacementmapelement svgfedistantlightelement svgfedropshadowelement svgfefloodelement svgfefuncaelement svgfefuncbelement svgfefuncgelement svgfefuncrelement svgfegaussianblurelement svgfeimageelement svgfemergeelement svgfemergenodeelement svgfemorphologyelement svgfeoffsetelement svgfepointlightelement svgfespecularlightingelement svgfespotlightelement svgfetileelement svgfeturbulenceelement svgfilterelement svgfilterprimitivestandardattributes svgfontelement svgfontfaceelement svgfontfaceformatelement svgfontfacenameelement svgfontfacesrcelement svgfontfaceurielement svgforeignobjectelement svggelement svggeometryelement svgglyphelemen...
...ghkernelement svgimageelement svglineargradientelement svglineelement svgmarkerelement svgmaskelement svgmeshelement svgmeshgradientelement svgmeshpatchelement svgmeshrowelement svgmetadataelement svgmissingglyphelement svgmpathelement svgpathelement svgpatternelement svgpolylineelement svgpolygonelement svgradialgradientelement svgrectelement svgscriptelement svgsetelement svgsolidcolorelement svgstopelement svgstyleelement svgsvgelement svgswitchelement svgsymbolelement svgtextcontentelement svgtextelement svgtextpathelement svgtextpositioningelement svgtitleelement svgtrefelement svgtspanelement svguseelement svgunknownelement svgviewelement svgvkernelement svg data type interfaces here are the dom apis for data types used in t...
DynamicsCompressorNode.attack - Web APIs
the attack property's default value is 0.003 and it can be set between 0 and 1.
... // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function...
...() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); button.innerhtml = 'add compression'; source.disconnect(compressor); compressor.disconnect(audioctx.destination); source.connect(audioctx.destination); } } specifications specification status comment web audio apithe definition of 'attack' in that specification.
DynamicsCompressorNode.knee - Web APIs
the knee property's default value is 30 and it can be set between 0 and 40.
... // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function...
...() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); button.innerhtml = 'add compression'; source.disconnect(compressor); compressor.disconnect(audioctx.destination); source.connect(audioctx.destination); } } specifications specification status comment web audio apithe definition of 'knee' in that specification.
DynamicsCompressorNode.ratio - Web APIs
the ratio property's default value is 12 and it can be set between 1 and 20.
... // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function...
...() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); button.innerhtml = 'add compression'; source.disconnect(compressor); compressor.disconnect(audioctx.destination); source.connect(audioctx.destination); } } specifications specification status comment web audio apithe definition of 'ratio' in that specification.
DynamicsCompressorNode.release - Web APIs
the release property's default value is 0.25 and it can be set between 0 and 1.
... // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function...
...() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); button.innerhtml = 'add compression'; source.disconnect(compressor); compressor.disconnect(audioctx.destination); source.connect(audioctx.destination); } } specifications specification status comment web audio apithe definition of 'release' in that specification.
DynamicsCompressorNode.threshold - Web APIs
the threshold property's default value is -24 and it can be set between -100 and 0.
... // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function...
...() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); button.innerhtml = 'add compression'; source.disconnect(compressor); compressor.disconnect(audioctx.destination); source.connect(audioctx.destination); } } specifications specification status comment web audio apithe definition of 'threshold' in that specification.
Element.animate() - Web APIs
WebAPIElementanimate
0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
...can be set to accumulate or replace (see above).
... document.getelementbyid("tunnel").animate([ // keyframes { transform: 'translatey(0px)' }, { transform: 'translatey(-300px)' } ], { // timing options duration: 1000, iterations: infinity }); implicit to/from keyframes in newer browser versions, you are able to set a beginning or end state for an animation only (i.e.
Element.className - Web APIs
WebAPIElementclassName
the classname property of the element interface gets and sets the value of the class attribute of the specified element.
...it is better to get/set the classname of an element using element.getattribute and element.setattribute if you are dealing with svg elements.
... elm.setattribute('class', elm.getattribute('class')) the class is an html attribute, while the classname is a dom property.
Element.removeAttribute() - Web APIs
usage notes you should use removeattribute() instead of setting the attribute value to null either directly or using setattribute().
... many attributes will not behave as expected if you set them to null.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - example // given: <div id="div1" align="left" width="200px"> document.getelementbyid("div1").removeattribute("align"); // now: <div id="div1" width="200px"> specifications specification status comment domthe defi...
Event.initEvent() - Web APIs
WebAPIEventinitEvent
this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
...once set, the read-only property event.bubbles will give its value.
...once set, the read-only property event.cancelable will give its value.
Event - Web APIs
WebAPIEvent
many dom elements can be set up to accept (or "listen" for) these events, and execute code in response to process (or "handle") them.
...cs-module both monitoring video-watching.) when there are many nested elements, each with its own handler(s), event processing can become very complicated—especially where a parent element receives the very same event as its child elements because "spatially" they overlap so the event technically occurs in both, and the processing order of such events depends on the event bubbling and capture settings of each handler triggered.
...setting its value to true before returning from an event handler prevents propagation of the event.
EventSource - Web APIs
when not used over http/2, sse suffers from a limitation to the maximum number of open connections, which can be specially painful when opening various tabs as the limit is per browser and set to a very low number (6).
... eventsource.withcredentials read only a boolean indicating whether the eventsource object was instantiated with cross-origin (cors) credentials set (true), or not (false, the default).
... eventsource.close() closes the connection, if any, and sets the readystate attribute to closed.
ExtendableEvent.waitUntil() - Web APIs
in service workers, waituntil() tells the browser that work is ongoing until the promise settles, and it shouldn't terminate the service worker if it wants that work to complete.
... the activate events in service workers use waituntil() to buffer functional events such as fetch and push until the promise passed to waituntil() settles.
... the waituntil() method must be initially called within the event callback, but after that it can be called multiple times, until all the promises passed to it settle.
Fetch basic concepts - Web APIs
it will seem familiar to anyone who has used xmlhttprequest, but it provides a more powerful and flexible feature set.
... when a new headers object is created using the headers() constructor, its guard is set to none (the default).
... when a request or response object is created, it has an associated headers object whose guard is set as summarized below: new object's type creating constructor guard setting of associated headers object request request() request request() with mode of no-cors request-no-cors response response() response error() or redirect() methods immutable a header's guard affects the set(), delete(), and append() methods which change the header's contents.
FormData - Web APIs
WebAPIFormData
the formdata interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the xmlhttprequest.send() method.
... it uses the same format a form would use if the encoding type were set to "multipart/form-data".
... formdata.set() sets a new value for an existing key inside a formdata object, or adds the key/value if it does not already exist.
GamepadEvent - Web APIs
vendor prefix: webkitedge full support ≤18firefox full support 29 full support 29 no support 24 — 28disabled disabled from version 24 until version 28 (exclusive): this feature is behind the dom.gamepad.enabled preference (needs to be set to true).
... 35edge full support 12firefox full support 29 full support 29 no support 24 — 28disabled disabled from version 24 until version 28 (exclusive): this feature is behind the dom.gamepad.enabled preference (needs to be set to true).
...he vendor prefix: webkitedge full support 12firefox full support 29 full support 29 no support 24 — 28disabled disabled from version 24 until version 28 (exclusive): this feature is behind the dom.gamepad.enabled preference (needs to be set to true).
GlobalEventHandlers.ondragend - Web APIs
example this example shows two ways to use the ondragend attribute handler to set an element's dragend event handler.
...device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.ge...
... var el=document.getelementbyid("target"); el.style.background = "pink"; } function dragexit_handler(ev) { console.log("dragexit"); // change the source element's border back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <d...
GlobalEventHandlers.ondragenter - Web APIs
example this example demonstrates using the ondragenter attribute handler to set an element's dragenter event handler.
...device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.ge...
... var el=document.getelementbyid("target"); el.style.background = "pink"; } function dragexit_handler(ev) { console.log("dragexit"); // change the source element's border back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <d...
GlobalEventHandlers.ondragexit - Web APIs
example this example demonstrates using the ondragexit attribute handler to set an element's dragexit event handler.
...device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.ge...
... var el=document.getelementbyid("target"); el.style.background = "pink"; } function dragexit_handler(ev) { console.log("dragexit"); // change the source element's border back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <d...
GlobalEventHandlers.ondragleave - Web APIs
example this example demonstrates using the ondragleave attribute handler to set an element's dragleave event handler.
...nt="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's border to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's background color to signify a drag over event // has occurred ev.currenttarget.style.background = "lightblue"; ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(d...
... var el=document.getelementbyid("target"); el.style.background = "pink"; } function dragexit_handler(ev) { console.log("dragexit"); // change the source element's background color back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <d...
GlobalEventHandlers.onkeypress - Web APIs
*/ (function () { const ssecret = /* choose your hidden word...: */ "exit"; let noffset = 0; document.onkeypress = function(opevt) { let oevent = opevt || window.event, nchr = oevent.charcode, snodetype = oevent.target.nodename.touppercase(); if (nchr === 0 || oevent.target.contenteditable.touppercase() === "true" || snodetype === "textarea" || snodetype === "input" && oevent.target.type.touppercase() === "text") { return tru...
...e; } if (nchr !== ssecret.charcodeat(noffset)) { noffset = nchr === ssecret.charcodeat(0) ?
... 1 : 0; } else if (noffset < ssecret.length - 1) { noffset++; } else { noffset = 0; /* do something here...
HTMLAudioElement - Web APIs
mozcurrentsampleoffset() returns the number of samples form the beginning of the stream that have been written so far into the audio stream created by calling mozwriteaudio().
... mozsetup() sets up the audio stream to allow writing, given the number of audio channels (1 or 2) and the sample rate in khz.
... mozwriteaudio() writes a batch of audio frames to the stream at the current offset, returning the number of bytes actually written to the stream.
HTMLCanvasElement.mozOpaque - Web APIs
this has been standardized as setting the alpha option to false when creating a drawing context with htmlcanvaselement.getcontext().
... syntax var opaque = canvas.mozopaque; canvas.mozopaque = true; examples given this <canvas> element: <canvas id="canvas" width="300" height="300" moz-opaque></canvas> you can get or set the mozopaque property.
... for example, you could conditionally set it to true if mimetype == 'image/jpeg', or similar, to gain performance in your application when translucency is not needed.
HTMLCanvasElement - Web APIs
when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.
...when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.
...web content can set this to a javascript function that will be called when the canvas is to be redrawn while the page is being printed.
HTMLElement: gotpointercapture event - Web APIs
the gotpointercapture event is fired when an element captures a pointer using setpointercapture().
...it then calls setpointercapture() on the element on a pointerdown event, which will trigger gotpointercapture.
... const para = document.queryselector('p'); para.addeventlistener('gotpointercapture', () => { console.log('i\'ve been captured!') }); para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, using the ongotpointercapture event handler property: const para = document.queryselector('p'); para.ongotpointercapture = () => { console.log('i\'ve been captured!') }; para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status pointer events obsolete ...
HTMLElement.lang - Web APIs
WebAPIHTMLElementlang
the htmlelement.lang property gets or sets the base language of an element's attribute values and text content.
... syntax var languageused = elementnodereference.lang; // get the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written.
... newlanguage is a string variable with its value setting the language in which the text of the current element is written.
HTMLImageElement.crossOrigin - Web APIs
the htmlimageelement interface's crossorigin attribute is a string which specifies the cross-origin resource sharing (cors) setting to use when retrieving the image.
... permitted values are: anonymous requests by the <img> element have their mode set to cors and their credentials mode set to same-origin.
... javascript the code below demonstrates setting the crossorigin property on an <img> element to configure cors access for the fetch of a newly-created image.
HTMLImageElement.sizes - Web APIs
award-winning stuff, i'm sure.</p> <img src="/files/16870/new-york-skyline-wide.jpg" srcset="/files/16870/new-york-skyline-wide.jpg 3724w, /files/16869/new-york-skyline-4by3.jpg 1961w, /files/16871/new-york-skyline-tall.jpg 1060w" sizes="((min-width: 50em) and (max-width: 60em)) 50em, ((min-width: 30em) and (max-width: 50em)) 30em, (max-width: 30em) 20em"> <p>then there's even more amazing stuff to say down here.
... 45edge full support 13firefox full support 38 full support 38 no support 33 — 52disabled disabled from version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true).
...chrome android full support 45firefox android full support 38 full support 38 no support 33 — 52disabled disabled from version 33 until version 52 (exclusive): this feature is behind the dom.image.picture.enabled preference (needs to be set to true).
HTMLImageElement.x - Web APIs
in other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>.
... note: the x property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>.
...the third cell is taken from that row (once again, specifying 2 as the zero-based offset).
HTMLImageElement.y - Web APIs
in other words: it has either of those values set explicitly on it, or it has inherited it from a containing element, or by being located within a column described by either <col> or <colgroup>.
... note: the y property is only valid if the computed value of the image's display property is either table-column or table-column-group; in other words, either of those are set directly on the <img> or they're inherited from a containing element or by being located within a column described by either <col> or <colgroup>.
...the third cell is taken from that row (once again, specifying 2 as the zero-based offset).
Option() - Web APIs
defaultselected optional a boolean that sets the selected attribute value, i.e.
...note that a value of true does not set the option to selected if it is not already selected.
... selected optional a boolean that sets the option's selected state; the default is false (not selected).
HTMLSlotElement - Web APIs
properties htmlslotelement.name domstring: can be used to get and set the slot's name.
... methods htmlslotelement.assignednodes() returns a sequence of the nodes assigned to this slot, and if the flatten option is set to true, the assigned nodes of any other slots that are descendants of this slot.
...if the flatten option is set to true, it also returns the assigned elements of any other slots that are descendants of this slot.
HTMLTableElement - Web APIs
when set, if the object doesn't represent a <caption>, a domexception with the hierarchyrequesterror name is thrown.
...when set, if the object doesn't represent a <thead>, a domexception with the hierarchyrequesterror name is thrown.
...when set, if the object doesn't represent a <tfoot>, a domexception with the hierarchyrequesterror name is thrown.
IDBDatabaseSync - Web APIs
thod overview idbobjectstoresync createobjectstore (in domstring name, in domstring keypath, in optional boolean autoincrement) raises (idbdatabaseexception); idbobjectstoresync openobjectstore (in domstring name, in optional unsigned short mode) raises (idbdatabaseexception); void removeobjectstore (in domstring storename) raises (idbdatabaseexception); void setversion (in domstring version); idbtransactionsync transaction (in optional domstringlist storenames, in optional unsigned int timeout) raises (idbdatabaseexception); attributes attribute type description description readonly domstring the human-readable description of the connected database.
... setversion() sets the version of the connected database.
... void setversion ( in domstring version ); parameters returns void version the version to store in the database.
IDBIndex.openCursor() - Web APIs
the method sets the position of the cursor to the appropriate record, based on the specified direction.
... if at least one record matches the key range, then the result property of the event is set to the new idbcursorwithvalue object; the value of the cursor object is set to a structured clone of the referenced value.
... if no records match the key range then then the result property of the event is set to null.
IDBIndex.openKeyCursor() - Web APIs
the method sets the position of the cursor to the appropriate key, based on the specified direction.
... if at least one key matches the key range, then the result property of the event is set to the new idbcursor object; the key property of the cursor object is set to the found key and the primarykey property is set to the the corresponding primary key of the found record.
... if no keys match the key range, then then the result property of the event is set to null.
Checking when a deadline is due - Web APIs
request.onsuccess = function(event) { note.innerhtml += '<li>new item added to database.</li>'; title.value = ''; hours.value = null; minutes.value = null; day.value = 01; month.value = 'january'; year.value = 2020; }; } this next section creates a log message to say the new item addition is successful, and resets the form so it's ready for the next task to be entered.
...when a notification is fired for each item object, its notification property is set to "yes" so this check will not pass on the next iteration, via the following code inside the createnotification() function (read using indexeddb for an explanation): // now we need to update the value of notified to "yes" in this particular data object, so the // notification won't be set off on it again // first open up a tranaction as usual var objectstore = db.transaction(['...
...to do this, we are simply using setinterval() to run checkdeadlines() once per second: setinterval(checkdeadlines, 1000); ...
KeyboardEvent.charCode - Web APIs
if the key pressed generates a character (e.g., 'a'), charcode is set to the code of that character; charcode respects the letter case (in other words, charcode takes into account whether the shift key is held down).
... charcode is never set in the keydown and keyup events.
... in these cases, keycode is set instead.
KeyframeEffectOptions - Web APIs
these properties are all optional, although without setting a duration the animation will not play.
...can be set to accumulate or replace (see above).
...0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
MediaPositionState.duration - Web APIs
the mediapositionstate dictionary's duration property is used when calling the mediasession method setpositionstate() to provide the user agent with the overall total duration in seconds of the media currently being performed.
... example in this example, an app performing a live stream provides information to the browser by preparing a mediapositionstate object and submitting it by calling navigator.mediasession.setpositionstate().
... let positionstate = { duration: infinity; playbackrate: 1.0; position: 0.0; }; navigator.mediasession.setpositionstate(positionstate); specifications specification status comment media session standardthe definition of 'mediapositionstate.duration' in that specification.
MediaPositionState.playbackRate - Web APIs
the mediapositionstate dictionary's playbackrate property is used when calling the mediasession method setpositionstate() to tell the user agent the rate at which media is currently being played.
...it begins by creating a mediapositionstate object, then submits it to the browser it by calling navigator.mediasession.setpositionstate().
... let positionstate = { duration: mymediaduration; playbackrate: 2.0; position: mymediaposition; }; navigator.mediasession.setpositionstate(positionstate); note the value 2.0 as the playbackrate.
MediaStream.getAudioTracks() - Web APIs
the getaudiotracks() method of the mediastream interface returns a sequence that represents all the mediastreamtrack objects in this stream's track set where mediastreamtrack.kind is audio.
... example this example gets a webcam's audio and video in a stream using getusermedia(), attaches the stream to a <video> element, then sets a timer that, upon expiring, will stop the first audio track found on the stream.
... navigator.mediadevices.getusermedia({audio: true, video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; // stop the audio stream after 5 seconds settimeout(() => { const tracks = mediastream.getaudiotracks() tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'getaudiotracks()' in that specification.
MediaStream - Web APIs
mediastream.ended read only a boolean value set to true if the end of the stream has been reached.
... mediastream.getaudiotracks() returns a list of the mediastreamtrack objects stored in the mediastream object that have their kind attribute set to audio.
... mediastream.getvideotracks() returns a list of the mediastreamtrack objects stored in the mediastream object that have their kind attribute set to "video".
MediaStreamConstraints.audio - Web APIs
to learn more about how constraints work, see capabilities, constraints, and settings.
... result using a mediatrackconstraints object now let's look at a similar example that uses a set of constraints based on the mediatrackconstraints dictionary: html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <audio id="audio" autoplay controls></audio><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } audio { margin-top: 20px; border: 1px solid black; width:...
...} document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ audio: { samplesize: 8, echocancellation: true } }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which calls getusermedia(), specifying a set of audio constraints requesting that echo cancellation be enabled and that, if possible, the sample rate be 8 bits per sample instead of the more common 16 bits (possibly as a bandwidth saving measure).
MediaStreamConstraints.video - Web APIs
to learn more about how constraints work, see capabilities, constraints, and settings.
... result using a mediatrackconstraints object now let's look at a similar example that uses a set of constraints based on the mediatrackconstraints dictionary: html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <video id="video" width="160" height="120" autoplay></video><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } video { margin-top: 20px; border: 1px solid...
...elementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ video: { width: 160, height: 120, framerate: 15 } }).then(stream => videoelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which calls getusermedia(), specifying a set of video constraints that indicate a preference for a video track whose dimensions are as close as possible to 160x120 pixels, and whose frame rate is as close to 15 frames per second as possible.
MediaStreamConstraints - Web APIs
the mediastreamconstraints dictionary is used when calling getusermedia() to specify what kinds of tracks should be included in the returned mediastream, and, optionally, to establish constraints for those tracks' settings.
... to learn more about how constraints work, see capabilities, constraints, and settings.
...when a peer identity is set, mediastreamtracks from that peer have their isolated flag set to true.
MediaTrackConstraints.groupId - Web APIs
for example, the microphone and speaker on the same headset would share a group id.
... this makes it possible to use the group id to ensure that the audio and input devices are on the same headset by retrieving the group id of the input device and specifying it when asking for an output device, perhaps.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.logicalSurface - Web APIs
see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints.
... usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's video mediastreamtrack, then checking the value of the returned mediatracksettings object's logicalsurface object.
... for example, if your app needs to know if the selected display surface is a logical one: let islogicalsurface = displaystream.getvideotracks()[0].getsettings().logicalsurface; following this code, islogicalsurface is true if the display surface contained in the stream is a logical surface; that is, one which may not be entirely onscreen, or may even be entirely offscreen.
Media Capture and Streams API (Media Stream) - Web APIs
blobevent canvascapturemediastreamtrack inputdeviceinfo mediadevicekind mediadeviceinfo mediadevices mediastream mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints overconstrainederror url early versions of the media capture and streams api specification included separate audiostreamtrack and videostreamtrack interfaces—each based upon mediastreamtrack—which represented streams of those types.
... capabilities, constraints, and settingsthe twin concepts of constraints and capabilities let the browser and web site or app exchange information about what constrainable properties the browser's implementation supports and what values it supports for each one.
... this article discusses capabilities and constraints, as well as media settings, and includes an example we call the constraint exerciser.
MouseEvent - Web APIs
mouseevent.offsetx read only the x coordinate of the mouse pointer relative to the position of the padding edge of the target node.
... mouseevent.offsety read only the y coordinate of the mouse pointer relative to the position of the padding edge of the target node.
... working draft from document object model (dom) level 3 events specification, added offsetx and offsety, pagex and pagey, x, and y properties.
msIsBoxed - Web APIs
WebAPIMsIsBoxed
msisboxed is a property which gets or sets when the video player control is in boxed (letterbox or pillarbox) mode.
... syntax isboxed = object.msisboxed value boolean value set to true activates boxed mode for the video player.
... boolean value set to false means the video player is zoomed to fill the screen.
MutationObserver.MutationObserver() - Web APIs
creating and starting the observer this code actually sets up the observation process.
... const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: true, attributes: true, // omit (or set to false) to observe only changes to the parent node subtree: true } const observer = new mutationobserver(callback); observer.observe(targetnode, observeroptions); the desired subtree is located by finding an element with the id someelement.
... a set of options for the observer is also established in the observeroptions record.
MutationObserverInit.attributeFilter - Web APIs
if this property is specified, there's no need to also set attributes to true, as it's implied.
... example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room.
...the attributeoldvalue option is set to true because we want the prior value of the changed attributes recorded and reported in the mutation records we receive.
MutationObserverInit.attributeOldValue - Web APIs
if true, oldvalue is set accordingly.
... when using attributeoldvalue, setting the attributes option to true is optional.
... example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room.
NamedNodeMap - Web APIs
namednodemap.setnameditem() replaces, or adds, the attr identified in the map by the given name.
... namednodemap.setnameditemns() replaces, or adds, the attr identified in the map by the given namespace and related local name.
... obsolete added getnameditemns(), setnameditemns() and removenameditemns() document object model (dom) level 1 specificationthe definition of 'namednodemap' in that specification.
NodeIterator.nextNode() - Web APIs
the nodeiterator.nextnode() method returns the next node in the set represented by the nodeiterator and advances the position of the iterator within the set.
... the first call to nextnode() returns the first node in the set.
... this method returns null when there are no nodes left in the set.
Notification.Notification() - Web APIs
options optional an options object containing any custom settings that you want to apply to the notification.
...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.
... silent: a boolean specifying whether the notification is silent (no sounds or vibrations issued), regardless of the device settings.
OfflineAudioContext.startRendering() - Web APIs
after the offline audio graph is set up, you need to render it to an audiobuffer using offlineaudiocontext.startrendering.
... at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
...ne online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('renderin...
OfflineAudioContext - Web APIs
after the offline audio graph is set up, you need to render it to an audiobuffer using offlineaudiocontext.startrendering.
... at this point we create another audio context, create an audiobuffersourcenode inside it, and set its buffer to be equal to the promise audiobuffer.
...ne online and offline audio context var audioctx = new audiocontext(); var offlinectx = new offlineaudiocontext(2,44100*40,44100); source = offlinectx.createbuffersource(); // use xhr to load an audio track, and // decodeaudiodata to decode it and offlineaudiocontext to render it function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('renderin...
ParentNode - Web APIs
methods parentnode.append() inserts a set of node objects or domstring objects after the last child of the parentnode.
... parentnode.prepend() inserts a set of node objects or domstring objects before the first child of the parentnode.
... parentnode.replacechildren() replaces the existing children of a node with a specified new set of children.
PaymentRequest.prototype.id - Web APIs
WebAPIPaymentRequestid
if none is provided, the browser automatically sets the id value to a uuid.
... 61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 60firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.complete() - Web APIs
61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... yeswebview android no support nochrome android full support 56 full support 56 no support 53 — 56disabled disabled from version 53 until version 56 (exclusive): this feature is behind the #web-payments preference (needs to be set to enabled).
... to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.details - Web APIs
61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... yeswebview android no support nochrome android full support 56 full support 56 no support 53 — 56disabled disabled from version 53 until version 56 (exclusive): this feature is behind the #web-payments preference (needs to be set to enabled).
... to change preferences in chrome, visit chrome://flags.firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.payerName - Web APIs
this option is only present when the requestpayername option is set to true in the options parameter of the paymentrequest() constructor.
... 61edge full support 15firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 58firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse: payerdetailchange event - Web APIs
bubbles no cancelable no interface paymentrequestupdateevent event handler property onpayerdetailchange examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected.
... const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed.
...ynames(errors).length) { await response.retry(errors); } else { // we have a good payment; send the data to the server await fetch("/pay-for-things/", { method: "post", body: response.json() }); response.complete("success"); } }; await response.retry({ payer: { email: "invalid domain.", phone: "invalid number.", }, }); addeventlistener equivalent you could also set up the event handler using the addeventlistener() method: response.addeventlistener("payerdetailchange", async ev => { ...
Using the Payment Request API - Web APIs
in the following snippet we do just this — depending on whether the user can make a fast payment or needs to add payment credentials first, the title of the checkout button changes between "fast checkout with w3c" and "setup w3c checkout".
...id('checkout-button'); checkoutbutton.innertext = "loading..."; if (window.paymentrequest) { let request = new paymentrequest(buildsupportedpaymentmethodnames(), buildshoppingcartdetails()); request.canmakepayment().then(function(canmakeafastpayment) { if (canmakeafastpayment) { checkoutbutton.innertext = "fast checkout with w3c"; } else { checkoutbutton.innertext = "setup w3c checkout"; } }).catch(function(error) { // the user may have turned off the querying functionality in their // privacy settings.
...et shouldcallpaymentrequest = true; let fallbacktolegacyonpaymentrequestfailure = false; (new paymentrequest(supportedpaymentmethods, {total: {label: 'stub', amount: {currency: 'usd', value: '0.01'}}}) .canmakepayment() .then(function(result) { shouldcallpaymentrequest = result; }).catch(function(error) { console.log(error); // the user may have turned off query ability in their privacy settings.
PhotoCapabilities - Web APIs
photocapabilities.imageheight read only returns a mediasettingsrange object indicating the image height range supported by the user agent.
... photocapabilities.imagewidth read only returns a mediasettingsrange object indicating the image width range supported by the user agent.
... const input = document.queryselector('input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specifica...
Pinch zoom gestures - Web APIs
when this event is processed, the target's border is set to dashed to provide a clear visual indication the element has received a move event.
... // // this function sets the target element's border to "dashed" to visually // indicate the pointer's target received a move event.
... function pointerup_handler(ev) { log(ev.type, ev); // remove this pointer from the cache and reset the target's // background and border remove_event(ev); ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; // if the number of pointers down is less than two then reset diff tracker if (evcache.length < 2) { prevdiff = -1; } } application ui the application uses a <div> element for the touch area and provides buttons to enable logging and to cle...
RTCDataChannel.maxRetransmits - Web APIs
the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.
... this can only be set when the rtcdatachannel is created by calling rtcpeerconnection.createdatachannel(), using the maxretransmits field in the specified options.
... syntax var tries = adatachannel.maxretransmits; value the maximum number of times the browser will try to retransmit a message before giving up, or null if not set when rtcpeerconnection.createdatachannel() was called.
RTCIceTransport - Web APIs
getlocalparameters() returns a rtciceparameters object describing the ice parameters established by a call to the rtcpeerconnection.setlocaldescription() method.
... getremoteparameters() returns a rtciceparameters object containing the ice parameters for the remote device, as set by a call to rtcpeerconnection.setremotedescription().
... if setremotedescription() hasn't been called yet, the return value is null.
RTCOfferOptions.iceRestart - Web APIs
note: rather than manually creating and submitting an offer with icerestart set to true, you should consider calling the rtcpeerconnection method restartice() instead.
... pc.oniceconnectionstatechange = function(evt) { if (pc.iceconnectionstate === "failed") { if (pc.restartice) { pc.restartice(); } else { pc.createoffer({ icerestart: true }) .then(pc.setlocaldescription) .then(sendoffertoserver); } } } if the state changes to failed, this handler starts by looking to see if the rtcpeerconnection includes the restartice() method; if it does, we call that to request an ice restart.
... otherwise, we call back to the older technique: we manually create a new offer with icerestart set to true, then that offer is set as the new local description for the connection.
RTCPeerConnection.addStream() - Web APIs
if the signalingstate is set to closed, an invalidstateerror is raised.
... if the signalingstate is set to stable, the event negotiationneeded is sent on the rtcpeerconnection to indicate that ice negotiation must be repeated to consider the new stream.
...you can write web compatible code using feature detection instead: // add a track to a stream and the peer connection said stream was added to: stream.addtrack(track); if (pc.addtrack) { pc.addtrack(track, stream); } else { // if you have code listening for negotiationneeded events: settimeout(() => pc.dispatchevent(new event('negotiationneeded'))); } // remove a track from a stream and the peer connection said stream was added to: stream.removetrack(track); if (pc.removetrack) { pc.removetrack(pc.getsenders().find(sender => sender.track == track)); } else { // if you have code listening for negotiationneeded events: settimeout(() => pc.dispatchevent(new event('negotiati...
RTCPeerConnection.canTrickleIceCandidates - Web APIs
this property is only set after having called rtcpeerconnection.setremotedescription().
... note: this property's value is determined once the local peer has called rtcpeerconnection.setremotedescription(); the provided description is used by the ice agent to determine whether or not the remote peer supports trickled ice candidates.
...pc.setremotedescription(remoteoffer) .then(_ => pc.createanswer()) .then(answer => pc.setlocaldescription(answer)) .then(_ => if (pc.cantrickleicecandidates) { return pc.localdescription; } return new promise(r => { pc.addeventlistener('icegatheringstatechange', e => { if (e.target.icegatheringstate === 'complete') { r(pc.localdescription); } }); }); }) .then(answer => sendanswertopeer(answer)) // signaling message .catch(e => handleerror(e)); pc.addeventlistener('icecandidate', e => { if (pc.cantrickleicecandidates) { sendcandidatetopeer(e.candidat...
RTCPeerConnection: connectionstatechange event - Web APIs
bubbles no cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session.
... it simply calls an app-defined function called setonlinestatus() to update a status display.
... pc.onconnectionstatechange = ev => { switch(pc.connectionstate) { case "new": case "checking": setonlinestatus("connecting..."); break; case "connected": setonlinestatus("online"); break; case "disconnected": setonlinestatus("disconnecting..."); break; case "closed": setonlinestatus("offline"); break; case "failed": setonlinestatus("error"); break; default: setonlinestatus("unknown"); break; } } you can also create a handler for connectionstatechange by using addeventlistener(): pc.addeventlistener("connectionstatechange", ev => { switch(pc.connectionstate) { /* ...
RTCPeerConnection.currentLocalDescription - Web APIs
to change the currentlocaldescription, call rtcpeerconnection.setlocaldescription(), which triggers a series of events which leads to this value being set.
... syntax sessiondescription = rtcpeerconnection.currentlocaldescription; return value the current description of the local end of the connection, if one has been set.
... if none has been successfully set, this value is null.
RTCPeerConnection.currentRemoteDescription - Web APIs
to change the currentremotedescription, call rtcpeerconnection.setremotedescription(), which triggers a series of events which leads to this value being set.
... syntax sessiondescription = rtcpeerconnection.currentremotedescription; return value the current description of the remote end of the connection, if one has been set.
... if none has been successfully set, this value is null.
RTCPeerConnection.getConfiguration() - Web APIs
the returned configuration is the last configuration applied via setconfiguration(), or if setconfiguration() hasn't been called, the configuration the rtcpeerconnection was constructed with.
...uration = mypeerconnection.getconfiguration(); if ((configuration.certificates != undefined) && (!configuration.certificates.length)) { rtcpeerconnection.generatecertificate({ name: 'rsassa-pkcs1-v1_5', hash: 'sha-256', moduluslength: 2048, publicexponent: new uint8array([1, 0, 1]) }).then(function(cert) { configuration.certificates = [cert]; mypeerconnection.setconfiguration(configuration); }); } this example fetches the current configuration of the rtcpeerconnection, then looks to see if it has any certificates set by examining whether or not (a) the configuration has a value for certificates, and (b) whether its length is zero.
... if it's determined that there are no certificates in place, rtcpeerconnection.generatecertificate() is called to create a new certificate; we provide a fulfillment handler which adds a new array containing the one newly-created certificate to the current configuration and passes it to setconfiguration() to add the certificate to the connection.
RTCPeerConnection.getSenders() - Web APIs
example in this example, a setmuting() function is shown.
...the function gets the list of the peer connection's senders and iterates over every sender, setting the corresponding media track's enabled to the inverse of the specified muting.
... function setmuting(pc, muting) { let senderlist = pc.getsenders(); senderlist.foreach(sender) { sender.track.enabled = !muting; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.getsenders()' in that specification.
RTCPeerConnection.getStats() - Web APIs
example this example creates a periodic function using setinterval() that collects statistics for an rtcpeerconnection every second, generating an html-formatted report and inserting it into a specific element in the dom.
... window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let statsoutput = ""; stats.foreach(report => { statsoutput += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(report).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; } }); }); document.queryselector(".stats-box").innerhtml = statsoutput; }); }, 1000); this works by calling getstats(), then, when t...
... once the html for the report is generated, it is injected into the element whose class is "stats-box" by setting its innerhtml property.
RTCPeerConnection.onaddstream - Web APIs
the event is sent immediately after the call setremotedescription() and doesn't wait for the result of the sdp negotiation.
...the first time an event occurs may be nearly immediately after the remote end of the connection is set using rtcpeerconnection.setremotedescription(); it doesn't wait for a particular stream to be accepted or rejected using sdp negotiation.
... example this code, based on an older version of our signaling and video calling sample, responds to addstream events by setting the video source for a <video> element to the stream specified in the event, and then enabling a "hang up" button in the app's user interface.
RTCPeerConnection.onnegotiationneeded - Web APIs
syntax rtcpeerconnection.onnegotiationneeded = eventhandler; value this should be set to a function you provide which is passed a single parameter: an event object containing the negotiationneeded event.
... pc.onnegotiationneeded = function() { pc.createoffer().then(function(offer) { return pc.setlocaldescription(offer); }) .then(function() { // send the offer to the remote peer through the signaling server }); }) .catch(reporterror); } first, it creates the offer by calling createoffer().
... when that succeeds, the offer is passed into setlocaldescription() to set the local description for the connection.
RTCPeerConnection.ontrack - Web APIs
the function receives as input the event object, of type rtctrackevent; this event is sent when a new incoming mediastreamtrack has been created and associated with an rtcrtpreceiver object which has been added to the set of receivers on connection.
... syntax rtcpeerconnection.ontrack = eventhandler; value set ontrack to be a function you provide that accepts as input a rtctrackevent object describing the new track and how it's being used.
... pc.ontrack = function(event) { document.getelementbyid("received_video").srcobject = event.streams[0]; document.getelementbyid("hangup-button").disabled = false; }; the first line of our ontrack event handler takes the first stream in the incoming track and sets the srcobject attribute to that.
RTCRtpTransceiver.direction - Web APIs
[1] to determine if a sender has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding.
... exceptions when setting the value of direction, the following exceptions can occur: invalidstateerror either the receiver's rtcpeerconnection is closed or the rtcrtpreceiver is stopped.
... usage notes setting the direction when you change the value of direction, an invalidstateerror exception will occur if the connection is closed or the receiver is stopped.
RTCSessionDescription() - Web APIs
this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself.
... this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself.
... navigator.getusermedia({video: true}, function(stream) { pc.onaddstream({stream: stream}); // adding a local stream won't trigger the onaddstream callback pc.addstream(stream); pc.createoffer(function(offer) { pc.setlocaldescription(new rtcsessiondescription(offer), function() { // send the offer to a server to be forwarded to the friend you're calling.
Range.commonAncestorContainer - Web APIs
to change the ancestor container of a node, consider using the various methods available to set the start and end positions of the range, such as range.setstart() and range.setend().
... html <ul> <li>strings <ul> <li>cello</li> <li>violin <ul> <li>first chair</li> <li>second chair</li> </ul> </li> </ul> </li> <li>woodwinds <ul> <li>clarinet</li> <li>oboe</li> </ul> </li> </ul> css the .highlight class created below uses a set of css @keyframes to animate a fading outline.
...pointerup', e => { const selection = window.getselection(); if (selection.type === 'range') { for (let i = 0; i < selection.rangecount; i++) { const range = selection.getrangeat(i); playanimation(range.commonancestorcontainer); } } }); function playanimation(el) { if (el.nodetype === node.text_node) { el = el.parentnode; } el.classlist.remove('highlight'); settimeout(() => { el.classlist.add('highlight'); }, 0); } result specifications specification status comment domthe definition of 'range.commonancestorcontainer' in that specification.
Range.isPointInRange() - Web APIs
it returns true if the point (cursor position) at offset within referencenode is within this range.
... syntax bool = range.ispointinrange( referencenode, offset ) parameters referencenode the node to compare with the range.
... offset the offset into node of the point to compare with the range.
Reporting API - Web APIs
this method is not as failsafe as the report-to method described above — any page crash could stop you retrieving the reports — but it is easier to set up, and more flexible.
... reporting api dictionaries reportingobserveroptions allows options to be set in the constructor when creating a reporting observer.
...tructor: observer.observe(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
Request.mode - Web APIs
WebAPIRequestmode
the associated mode, available values of which are: same-origin — if a request is made to another origin with this mode set, the result is simply an error.
...only a limited set of headers are exposed in the response, but the body is readable.
... for example, when a request object is created using the request.request constructor, the value of the mode property for that request is set to cors.
SVGAnimationElement - Web APIs
the svganimationelement interface is the base interface for all of the animation element interfaces: svganimateelement, svgsetelement, svganimatecolorelement, svganimatemotionelement and svganimatetransformelement.
... svganimationelement.beginelementat() creates a begin instance time for the current time plus the specified offset.
... svganimationelement.endelementat() creates a end instance time for the current time plus the specified offset.
SVGElement - Web APIs
font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties also inherits properties from: documentandelementeventhandlers, element, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement, svgelementinstance svgelement.datasetread only a domstringmap object which provides a list of key/value pairs of named data attributes which correspond to custom data attributes attached to the element.
...this works just like html's htmlelement.dataset property and html's data-* global attribute.
... candidate recommendation adds the dataset property.
SVGPreserveAspectRatio - Web APIs
pectratio_xminymax = 8 svg_preserveaspectratio_xmidymax = 9 svg_preserveaspectratio_xmaxymax = 10 svg_meetorslice_unknown = 0 svg_meetorslice_meet = 1 svg_meetorslice_slice = 2 normative document svg 1.1 (2nd edition) constants name value description svg_preserveaspectratio_unknown 0 the enumeration was set to a value that is not one of predefined types.
... svg_meetorslice_unknown 0 the enumeration was set to a value that is not one of predefined types.
... exceptions on setting: a domexception with code no_modification_allowed_err is raised on an attempt to change the value of an attribute on a read only object.
Selection.collapse() - Web APIs
syntax sel.collapse(node, offset); parameters node the caret location will be within this node.
... this value can also be set to null — if null is specified, the method will behave like selection.removeallranges(), i.e.
... offset optional the offset in node to which the selection will be collapsed.
Selection.extend() - Web APIs
WebAPISelectionextend
syntax sel.extend(node, offset) parameters node the node within which the focus will be moved.
... offset optional the offset position within node where the focus will be moved to.
... nochrome android full support yesfirefox android full support yesopera android full support yessafari ios full support yessamsung internet android full support yesoffset parameter is optional experimentalchrome full support yesedge full support ≤79firefox full support 55ie no support noopera full support yessafari full suppo...
ServiceWorkerMessageEvent.origin - Web APIs
the origin read-only property of the serviceworkermessageevent interface returns the origin of the service worker's environment settings object.
... examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
... // set up a message channel to communicate with the sw var channel = new messagechannel(); channel.port1.onmessage = function(e) { console.log(e.origin); handlechannelmessage(e.data); } mysw = reg.active; mysw.postmessage('hello', [channel.port2]); }); ...
SourceBuffer.abort() - Web APIs
the abort() method of the sourcebuffer interface aborts the current segment and resets the segment parser.
... example the spec description of abort() is somewhat confusing — consider for example step 1 of reset parser state.
...in lines 92-101, the seek() function is defined — note that abort() is called if mediasource.readystate is set to open, which means that it is ready to receive new source buffers — at this point it is worth aborting the current segment and just getting the one for the new seek position (see checkbuffer() and getcurrentsegment().) specifications specification status comment media source extensionsthe definition of 'abort()' in that specification.
SpeechSynthesisErrorEvent.error - Web APIs
sy the operation couldn't be completed at this time because the user-agent couldn't access the audio output device (for example, the user may need to correct this by closing another application.) audio-hardware the operation couldn't be completed at this time because the user-agent couldn't identify an audio output device (for example, the user may need to connect a speaker or configure system settings.) network the operation couldn't be completed at this time because some required network communication failed.
... language-unavailable no appropriate voice was available for the language set in speechsynthesisutterance.lang.
... voice-unavailable the voice set in speechsynthesisutterance.voice was not available.
SpeechSynthesisUtterance.lang - Web APIs
the lang property of the speechsynthesisutterance interface gets and sets the language of the utterance.
... if unset, the app's (i.e.
... the <html> lang value) lang will be used, or the user-agent default if that is unset too.
SpeechSynthesisUtterance.voice - Web APIs
the voice property of the speechsynthesisutterance interface gets and sets the voice that will be used to speak the utterance.
... this should be set to one of the speechsynthesisvoice objects returned by speechsynthesis.getvoices().
... if not set by the time the utterance is spoken, the voice used will be the most suitable default voice available for the utterance's lang setting.
Using readable streams - Web APIs
inside this method, you should include code that sets up the stream functionality, e.g.
... the custom stream constructor has a start() method that uses a windowtimers.setinterval() call to generate a random string every second.
... const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); readstream(); controller.close(); ...
SubtleCrypto.unwrapKey() - Web APIs
the key must have the unwrapkey usage set.
...*/ function bytestoarraybuffer(bytes) { const bytesasarraybuffer = new arraybuffer(bytes.length); const bytesuint8 = new uint8array(bytesasarraybuffer); bytesuint8.set(bytes); return bytesasarraybuffer; } /* get some key material to use as input to the derivekey method.
...*/ function bytestoarraybuffer(bytes) { const bytesasarraybuffer = new arraybuffer(bytes.length); const bytesuint8 = new uint8array(bytesasarraybuffer); bytesuint8.set(bytes); return bytesasarraybuffer; } /* get some key material to use as input to the derivekey method.
SubtleCrypto.wrapKey() - Web APIs
to export a key, it must have cryptokey.extractable set to true.
...the key must have the wrapkey usage set.
... supported algorithms all algorithms that are usable for encryption are also usable for key wrapping, as long as the key has the "wrapkey" usage set.
TextTrack.mode - Web APIs
WebAPITextTrackmode
safari additionally requires the default boolean attribute to be set to true when implementing your own video player controls in order for the subtitles cues to be shown.
...this is done by setting the pauseonexit property on each cue to true.
... however, to ensure that the track's cues are available, we first set mode to showing.
Multi-touch interaction - Web APIs
function set_handlers(name) { // install event handlers for the given element var el=document.getelementbyid(name); el.ontouchstart = start_handler; el.ontouchmove = move_handler; // use same handler for touchcancel and touchend el.ontouchcancel = end_handler; el.ontouchend = end_handler; } function init() { set_handlers("target1"); set_handlers("target2"); set_handlers("target3"); set_handlers("t...
... // // this function sets the target element's border to "dashed" to visually // indicate the target received a move event.
... // ev.preventdefault(); if (logevents) log("touchmove", ev, false); // to avoid too much color flashing many touchmove events are started, // don't update the background if two touch points are active if (!(ev.touches.length == 2 && ev.targettouches.length == 2)) update_background(ev); // set the target element's border to dashed to give a clear visual // indication the element received a move event.
Using Touch Events - Web APIs
for the touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface).
... together, these interfaces define a relatively low-level set of features, yet they support many kinds of touch-based interaction, including the familiar multi-touch gestures such as multi-finger swipe, rotation, pinch and zoom.
... // touchmove handler function process_touchmove(ev) { // set call preventdefault() ev.preventdefault(); } best practices here are some best practices to consider when using touch events: minimize the amount of work that is done in the touch handlers.
Touch events - Web APIs
</canvas> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below will be called.
... function startup() { var el = document.getelementbyid("canvas"); el.addeventlistener("touchstart", handlestart, false); el.addeventlistener("touchend", handleend, false); el.addeventlistener("touchcancel", handlecancel, false); el.addeventlistener("touchmove", handlemove, false); } document.addeventlistener("domcontentloaded", startup); this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
...floor(touch.identifier / 7) % 16; r = r.tostring(16); // make it a hex digit g = g.tostring(16); // make it a hex digit b = b.tostring(16); // make it a hex digit var color = "#" + r + g + b; console.log("color for touch with identifier " + touch.identifier + " = " + color); return color; } the result from this function is a string that can be used when calling <canvas> functions to set drawing colors.
UIEvent.initUIEvent() - Web APIs
this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
...once set, the read-only property event.bubbles will give its value.
...once set, the read-only property event.cancelable will give its value.
URL API - Web APIs
WebAPIURL API
the url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded mime type used to submit web forms' contents as a set of key/value pairs.
... 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.
... for example, to create a url and set its username: let myusername = "someguy"; let addr = new url("https://mysite.com/login"); addr.username = myusername; setting the value of username not only sets that property's value, but it updates the overall url.
ValidityState.patternMismatch - Web APIs
the read-only patternmismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's pattern attribute.
... if the field supports the pattern attribute -- which means the <input> is of type text, tel, email, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternmismatch property will be true.
...###" aria-label="3-digit prefix" size="2"/> - <input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-label="4-digit number" size="3"/> </label> </p> here we have 3 sections for a north american phone number with an implicit label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each.
WEBGL_debug_renderer_info - Web APIs
depending on the privacy settings of the browser, this extension might only be available to privileged contexts.
... availability: depending on the privacy settings of the browser, this extension might only be available to privileged contexts or not work at all.
... in firefox, if privacy.resistfingerprinting is set to true, this extensions is disabled.
WebGL2RenderingContext.texImage3D() - Web APIs
syntax void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, glintptr offset); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlcanvaselement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlimageelement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, htmlvideoelement source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, imagebitmap source); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format...
...srcdata); void gl.teximage3d(target, level, internalformat, width, height, depth, border, format, type, arraybufferview srcdata, srcoffset); parameters target a glenum specifying the binding point (target) of the active texture.
... offset a glintptr byte offset into the webglbuffer's data store.
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
syntax void gl.vertexattribipointer(index, size, type, stride, offset); parameters index a gluint specifying the index of the vertex attribute that is to be modified.
... stride a glsizei specifying the offset in bytes between the beginning of consecutive vertex attributes.
... offset a glintptr specifying an offset in bytes of the first component in the vertex attribute array.
WebGLRenderingContext.bufferData() - Web APIs
srcdata, usage); void gl.bufferdata(target, arraybufferview srcdata, usage); // webgl2: void gl.bufferdata(target, arraybufferview srcdata, usage, srcoffset, length); parameters target a glenum specifying the binding point (target).
... size a glsizeiptr setting the size in bytes of the buffer object's data store.
... srcoffset a gluint specifying the element index offset where to start reading the buffer.
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
pixels); // additionally available in webgl 2: // read from buffer bound to gl.pixel_unpack_buffer void gl.compressedteximage2d(target, level, internalformat, width, height, border, glsizei imagesize, glintptr offset); void gl.compressedteximage2d(target, level, internalformat, width, height, border, arraybufferview srcdata, optional srcoffset, optional srclengthoverride); // read from buffer bound to gl.pixel_unpack_buffer void gl.compressedteximage3d(target, level, internalformat, width, height, depth, border, glsizei imagesize, glintptr offset); void gl.compressedteximage3d(t...
...arget, level, internalformat, width, height, depth, border, arraybufferview srcdata, optional srcoffset, optional srclengthoverride); parameters target a glenum specifying the binding point (target) of the active texture.
... offset a glintptr specifying the offset in bytes from which to read from the buffer bound to gl.pixel_unpack_buffer.
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
syntax void gl.copytexsubimage2d(target, level, xoffset, yoffset, x, y, width, height); parameters target a glenum specifying the binding point (target) of the active texture.
... xoffset a glint specifying the horizontal offset within the texture image.
... yoffset a glint specifying the vertical offset within the texture image.
WebGLRenderingContext.drawElements() - Web APIs
syntax void gl.drawelements(mode, count, type, offset); parameters mode a glenum specifying the type primitive to render.
...possible values are: gl.unsigned_byte gl.unsigned_short when using the oes_element_index_uint extension: gl.unsigned_int offset a glintptr specifying a byte offset in the element array buffer.
... if offset is not a valid multiple of the size of the given type, a gl.invalid_operation error is thrown.
WebGLRenderingContext.getError() - Web APIs
the command is ignored and the error flag is set.
...the command is ignored and the error flag is set.
...the command is ignored and the error flag is set.
WebGLRenderingContext.makeXRCompatible() - Web APIs
*/ outputcanvas.addeventlistener("webglcontextrestored", (event) => { loadsceneresources(currentscene); }); async function onstartedxrsession(xrsession) { try { await gl.makexrcompatible(); } catch(err) { switch(err) { case aborterror: showsimplemessagebox("unable to transfer the game to your xr headset.", "cancel"); break; case invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.classlist.contains("use-webxr") && navigator.xr) { try { ...
...if the button clicked by the user has that class (and we've confirmed that webxr is available by ensuring that the navigator.xr property exists), we use requestsession() to request a new webxr session and set the usingxr flag to true.
... handlers are provided for both webglcontextlost and webglcontextrestored; in the first case, we make sure we're aware that the state can be recovered, while in the latter we actually reload the scene to ensure we have the correct resources for the current screen or headset configuration.
WebGLRenderingContext.pixelStorei() - Web APIs
syntax void gl.pixelstorei(pname, param); parameters pname a glenum specifying which parameter to set.
... param a glint specifying a value to set the pname parameter to.
...d from memory glint 0 0 to infinity opengl es 3.0 gl.unpack_skip_rows number of rows of pixel locations skipped before the first pixel is read from memory glint 0 0 to infinity opengl es 3.0 gl.unpack_skip_images number of pixel images skipped before the first pixel is read from memory glint 0 0 to infinity opengl es 3.0 examples setting the pixel storage mode affects the webglrenderingcontext.readpixels() operations, as well as unpacking of textures with the webglrenderingcontext.teximage2d() and webglrenderingcontext.texsubimage2d() methods.
WebGLRenderingContext.shaderSource() - Web APIs
the webglrenderingcontext.shadersource() method of the webgl api sets the source code of a webglshader.
... syntax void gl.shadersource(shader, source); parameters shader a webglshader object in which to set the source code.
... source a domstring containing the glsl source code to set.
WebGLRenderingContext.stencilOp() - Web APIs
the webglrenderingcontext.stencilop() method of the webgl api sets both the front and back-facing stencil test actions.
... gl.zero sets the stencil buffer value to 0.
... gl.replace sets the stencil buffer value to the reference value as specified by webglrenderingcontext.stencilfunc().
WebGLRenderingContext.stencilOpSeparate() - Web APIs
the webglrenderingcontext.stencilopseparate() method of the webgl api sets the front and/or back-facing stencil test actions.
... gl.zero sets the stencil buffer value to 0.
... gl.replace sets the stencil buffer value to the reference value as specified by webglrenderingcontext.stencilfunc().
Creating 3D objects using WebGL - Web APIs
we can pass a lot fewer data around by building an array of all 24 vertices, then referring to each vertex by its index into that array instead of moving entire sets of coordinates around.
... gl.vertexattribpointer( programinfo.attriblocations.vertexposition, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexposition); } define the vertices' colors we also need to build an array of colors for each of the 24 vertices.
... { const vertexcount = 36; const type = gl.unsigned_short; const offset = 0; gl.drawelements(gl.triangles, vertexcount, type, offset); } since each face of our cube is comprised of two triangles, there are 6 vertices per side, or 36 total vertices in the cube, even though many of them are duplicates.
Getting started with WebGL - Web APIs
its purpose is to set up the webgl context and start rendering content.
...your browser or machine may not support it."); return; } // set clear color to black, fully opaque gl.clearcolor(0.0, 0.0, 0.0, 1.0); // clear the color buffer with specified clear color gl.clear(gl.color_buffer_bit); } window.onload = main; the first thing we do here is obtain a reference to the canvas, assigning it to a variable named canvas.
...in this case, we set the clear color to black, and clear the context to that color (redrawing the canvas with the background color).
Using shaders to apply color in WebGL - Web APIs
applying color to the vertices in webgl objects are built using sets of vertices, each of which has a position and a color.
... drawing using the colors next, it's necessary to add code to look up the attribute location for the colors and setup that attribute for the shader program: const programinfo = { program: shaderprogram, attriblocations: { vertexposition: gl.getattriblocation(shaderprogram, 'avertexposition'), vertexcolor: gl.getattriblocation(shaderprogram, 'avertexcolor'), }, ...
... { const numcomponents = 4; const type = gl.float; const normalize = false; const stride = 0; const offset = 0; gl.bindbuffer(gl.array_buffer, buffers.color); gl.vertexattribpointer( programinfo.attriblocations.vertexcolor, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexcolor); } view the complete code | open this demo on a new page « previousnext » ...
Using WebRTC data channels - Web APIs
let datachannel = pc.createdatachannel("myapp channel"); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); manual negotiation to manually negotiate the data channel connection, you need to first create a new rtcdatachannel object using the createdatachannel() method on the rtcpeerconnection, specifying in the options a negotiated property set to true.
...this process should signal to the remote peer that it should create its own rtcdatachannel with the negotiated property also set to true, using the same id.
... let datachannel = pc.createdatachannel("myapp channel", { negotiated: true }); datachannel.addeventlistener("open", (event) => { begintransmission(datachannel); }); requestremotechannel(datachannel.id); in this code snippet, the channel is created with negotiated set to true, then a function called requestremotechannel() is used to trigger negotiation, to create a remote channel with the same id as the local channel.
WebXR performance guide - Web APIs
it makes sense, then, to have a limited set of these objects, simply replacing their contents with the new information each time you need to use them.
... they can be thought of as being similar to the registers in a microprocessor: a limited set of memory storage slots for specific kinds of data or use cases.
...that means that for every frame, the javascript runtime has to allocate memory for those and set them up—possibly triggering garbage collection—and then when each interaction of the loop is completed, the memory is released.
Web Authentication API - Web APIs
navigator.credentials.get() - when used with the publickey option, uses an existing set of credentials to authenticate to a service, either logging a user in or as a form of second-factor authentication.
...the full set of required fields, optional fields, and their meanings for creating a registration request can be found in the publickeycredentialcreationoptions dictionary.
... likewise, the full set of response fields can be found in the publickeycredential interface (where publickeycredential.response is the authenticatorattestationresponse interface).
Window.clearImmediate() - Web APIs
this method clears the action specified by window.setimmediate.
... syntax window.clearimmediate( immediateid ) where immediateid is a id returned by window.setimmediate.
... examples let immediateid = setimmediate(() => { // run some code } document.getelementbyid("button") .addeventlistener(() => { clearimmediate(immediateid); }); specifications specification status comment efficient script yielding the definition of 'setimmediate' in that specification.
window.location - Web APIs
WebAPIWindowlocation
note that security settings, like cors, may prevent this to effectively happen.
... example #6: using bookmarks without changing the hash property: <!doctype html> <html> <head> <meta charset="utf-8"/> <title>mdn example</title> <script> function shownode (onode) { document.documentelement.scrolltop = onode.offsettop; document.documentelement.scrollleft = onode.offsetleft; } function showbookmark (sbookmark, busehash) { if (arguments.length === 1 || busehash) { location.hash = sbookmark; return; } var obookmark = document.queryselector(sbookmark); if (obookmark) { shownode(...
...dow.addeventlistener("scroll", _chkowner, false); } else if (window.attachevent) { window.attachevent("onscroll", _chkowner); } return function (sbookmark, busehash) { var onode = document.queryselector(sbookmark); _scrolly = document.documentelement.scrolltop; _scrollx = document.documentelement.scrollleft; _bookmark = sbookmark; _usehash = busehash === true; _nodex = onode.offsetleft; _nodey = onode.offsettop; _itframe = 1; if (_scrollid === -1) { _scrollid = setinterval(_next, math.round(nduration / nframes)); } }; })(); specifications specification status comment html living standardthe definition of 'window.location' in that specification.
Window.sessionStorage - Web APIs
example the following snippet accesses the current origin's session storage object and adds data to it with storage.setitem().
... sessionstorage.setitem('mycat', 'tom'); the following example autosaves the contents of a text field, and if the browser is refreshed, restores the text field content so that no writing is lost.
...see if we have an autosave value // (this will only happen if the page is accidentally refreshed) if (sessionstorage.getitem("autosave")) { // restore the contents of the text field field.value = sessionstorage.getitem("autosave"); } // listen for changes in the text field field.addeventlistener("change", function() { // and save the results into the session storage object sessionstorage.setitem("autosave", field.value); }); note: please refer to the using the web storage api article for a full example.
XMLHttpRequest.multipart - Web APIs
please use server-sent events, web sockets, or responsetext from progress events instead.
...if set to true, the content type of the initial response must be multipart/x-mixed-replace or an error will occur.
... note: when this is set, the onload handler and other event handlers are not reset after the first xmldocument is loaded, and the onload handler is called after each part of the response is received.
XMLHttpRequest.readyState - Web APIs
3 loading downloading; responsetext holds partial data.
...during this state, the request headers can be set using the setrequestheader() method and the send() method can be called which will initiate the fetch.
...if responsetype is "text" or empty string, responsetext will have the partial text response as it loads.
XMLHttpRequest.responseXML - Web APIs
if the responsetype is set to "document" and the request was made asynchronously, instead the response is parsed as "text/html".
... exceptions invalidstateerror the responsetype isn't either "document" or an empty string.
... example var xhr = new xmlhttprequest; xhr.open('get', '/server'); // if specified, responsetype must be empty string or "document" xhr.responsetype = 'document'; // force the response to be parsed as xml xhr.overridemimetype('text/xml'); xhr.onload = function () { if (xhr.readystate === xhr.done && xhr.status === 200) { console.log(xhr.response, xhr.responsexml); } }; xhr.send(); specifications specification status comment xmlhttprequestthe definition of 'responsexml' in that specification.
XMLHttpRequest.send() - Web APIs
if the request method is get or head, the body parameter is ignored and the request body is set to null.
... if no accept header has been set using the setrequestheader(), an accept header with the type "*/*" (any type) is sent.
...}; xhr.send(null); // xhr.send('string'); // xhr.send(new blob()); // xhr.send(new int8array()); // xhr.send(document); example: post var xhr = new xmlhttprequest(); xhr.open("post", '/server', true); //send the proper header information along with the request xhr.setrequestheader("content-type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function() { // call a function when the state changes.
XRBoundedReferenceSpace.boundsGeometry - Web APIs
each point must be at floor level, with its y coordinate's value set to 0.
... each entry in boundsgeometry is equal to an entry in the list of native bounds geometry points for the room, premultiplied by the inverse of the origin offset.
...as a general rule, with the origin for x and z located in or near the center of the space, and with the orientation set facing in a logical forward direction, as appropriate for the underlying platform or xr hardware.
XREnvironmentBlendMode - Web APIs
this is primarily used by fully-immersive vr headsets, which totally obscure the surrounding environment, with none of the real world shown to the user at all.
...as with the opaque setting, alpha values specified are ignored and treated as if they were 1.0.
... alpha-blend used by headsets or goggles which use cameras to capture the real world and display it digitally on the screen or screens used to render the content for the user to see, this offers a way to create an ar presentation using a vr device.
XRPermissionDescriptor.optionalFeatures - Web APIs
syntax xrpermissiondescriptor = { mode: xrsessionmode, requiredfeatures: reqfeaturelist, optionalfeatures: optfeaturelist }; xrpermissiondescriptor.optionalfeatures = optfeaturelist; optfeaturelist = xrpermissiondescriptor.optionalfeatures; value an array of strings taken from the xrreferencespacetype enumerated type, indicating set of features that your app would like to use, but can operate without if permission to use them isn't available.
...it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces.
... xrreferencespace usage notes examples let xrpermissiondesc = { name: "xr", mode: "immersive-vr", optionalfeatures: [ "bounded-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.optionalfeatures' in that specification.
XRPermissionDescriptor.requiredFeatures - Web APIs
the xrpermissiondescriptor dictionary's requiredfeatures property should be set prior to calling navigator.permissions.query() to a list of webxr features which must be supported for the app to work.
...it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces.
... let xrpermissiondesc = { name: "xr", mode: "immersive-ar", requiredfeatures: [ "local-floor" ] }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.requiredfeatures' in that specification.
XRPose.emulatedPosition - Web APIs
a basic xr headset provides three degrees of freedom (3dof), tracking the pitch, yaw, and roll of the user's head.
...if its position is computed as an offset from another object (such as by basing it off the model representing the user's body), then this value is true.
... this information is important because devices whose position is emulated are prone to their offset drifting relative to the real world space over time.
XRSession.environmentBlendMode - Web APIs
this is primarily used by fully-immersive vr headsets, which totally obscure the surrounding environment, with none of the real world shown to the user at all.
...as with the opaque setting, alpha values specified are ignored and treated as if they were 1.0.
... alpha-blend used by headsets or goggles which use cameras to capture the real world and display it digitally on the screen or screens used to render the content for the user to see, this offers a way to create an ar presentation using a vr device.
XRSession.requestAnimationFrame() - Web APIs
the callback receives as input two parameters: time a domhighrestimestamp indicating the time offset at which the updated viewer state was received from the webxr device.
... let xrsession = null function onwindowanimationframe(time) { window.requestanimationframe(onwindowanimationframe) // this may be called while an immersive session is running on some devices, // such as a desktop with a tethered headset.
...function startxrsession() { navigator.xr.requestsession('immersive-vr').then((session) => { xrsession = session xrsession.addeventlistener('end', onxrsessionended) // do necessary session setup here.
XRSystem: devicechange event - Web APIs
a devicechange event is fired on an xrsystem object whenever the whenever the availability of immersive xr devices has changed; for example, a vr headset or ar goggles have been connected or disconnected.
... if (navigator.xr) { navigator.xr.addeventlistener("devicechange", event => { navigator.xr.issessionsupported("immersive-vr") .then(immersiveok) => { if (immersiveok) { enablexrbutton.disabled = false; } else { enablexrbutton.disabled = true; } }); }); } when devicechange is received, the handler set up in this code calls the xr method issessionsupported() to find out if there's a device available that can handle immersive vr presentations.
... you can also use the ondevicechange event handler property to set a single handler for devicechange events: if (navigator.xr) { navigator.xr.ondevicechange = event => { /* ...
XRSystem: requestSession() - Web APIs
exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, passing into it a domexception whose name is one of the following: invalidstateerror the requested session mode is immersive-vr but there is already an immersive vr session either currently active or in the process of being set up.
...if the promise resolves, it sets up a session and initiates the animation loop.
... navigator.xr.requestsession("immersive-vr") .then((xrsession) => { xrsession.addeventlistener('end', onxrsessionended); // do necessary session setup here.
XRSystem - Web APIs
WebAPIXRSystem
events devicechange sent when the set of available xr devices has changed.
...if there isn't, we use requestsession() to start one and, once the returned promise resolves, we call a function onsessionstarted() to set up our session for rendering and so forth.
...when the returned promise resolves, we set xrsession to null to record the fact that we no longer have an ongoing session.
XRWebGLLayer.framebuffer - Web APIs
opaque framebuffers initialized with the depth property set to false will not have a depth buffer and will rely on the coordinates alone to determine distance.
... the xr compositor assumes that opaque framebuffers use colors with premultiplied allpha, regardless of whether or not the webgl context's premultipliedalpha context attribute is set.
... the default configuration of a new framebuffer upon creating a new xrwebgllayer, its new framebuffer is initialized just like the default framebuffer for any webgl interface: the color buffer is configured with its clear value set to the color (0, 0, 0, 0) (meaning transparent black).
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
now we can see the coordinates of each of the viewports representing these two views: since each eye gets half of the frame buffer, the result is that the left eye gets a 640x720 portion of the buffer with the viewport's x and y at 0, the width at 640, and the height set to 720.
... the right eye gets the other half of the frame buffer, with its viewport's x set at 639.
... that gets us a new xrwebgllayer object representing a rendering surface we can use for the xrsession; we set it as the rendering surface for xrsession by calling its updaterenderstate() method, passing the new gllayer in using the xrrenderstate dictionary's xrrenderstate.baselayer property.
XRWebGLLayer.getViewport() - Web APIs
example this example demonstrates in part what the callback for the requestanimationframe() function might look like, using getviewport() to get the viewport so that drawing can be constrained to the area set aside for the eye whose viewpoint is currently being rendered.
... this works because the set of views returned by an xrviewerpose each represent one eye's perspective on the scene.
... since the framebuffer is split in half, one half for each eye, setting the webgl viewport to match the webxr layer's viewport will ensure that when rendering the scene for the current eye's pose, it is rendered into the correct half of the framebuffer.
ARIA Screen Reader Implementors Guide - Accessibility
interpreting wai-aria live region markup live changes are hints: in general live region markup is provided by the author as hints, and the assistive technology may allow for global, site or even region-specific settings, as well as heuristics to help with live changes on pages that have no wai-aria hints.
... ideas for settings and heuristics allow for a different voice (in text-to-speech) or other varying presentational characteristics to set live changes apart.
... allow global settings to turn off the presentation of live changes, present all live changes, use markup, or be "smart" (use heuristics) details for processing via platform accessibility apis we hope browser manufacturers will work to provide consistent implementations.
Using the aria-invalid attribute - Accessibility
aria-invalid can also be used to indicate that a required field has not been filled in.the attribute should be programmatically set as a result of a validation process.
... the snippet below shows a very simple validation function, which only checks for the presence of a particular character (in the real world, validation will likely be more sophisticated): function checkvalidity(aid, asearchterm, amsg){ var elem = document.getelementbyid(aid); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); updatealert(amsg); } else { elem.setattribute("aria-invalid", "false"); updatealert(); } } the snippet below shows the alert functions, which add (or remove) the error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldalert) { document.body.removechild(oldalert); } ...
... if (msg) { var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var content = document.createtextnode(msg); newalert.appendchild(content); document.body.appendchild(newalert); } } note that the alert has the aria role attribute set to "alert." working examples: alert role example (uses the aria-invalid attribute) notes when aria-invalid is used in conjunction with the aria-required attribute, aria-invalid should not be set to true before the form is submitted - only in response to validation.
Using the log role - Accessibility
where the user needs to hear the entire live region upon a change aria-atomic="true" should be set.
... to have announcements made as soon as possible and where the user may be interrupted, aria-live="assertive" can be set for more aggressive updates.
... assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce changes inside a log when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted.
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.
... <p id="image-1">text that describes the group of images.</p> </div> svg and role="img" if you are using embedded svg images in your page, it is a good idea to set role="img" on the outer <svg> element and give it a label.
ARIA: switch role - Accessibility
the switch role does not support the value mixed for the aria-checked attribute; assigning a value of mixed to a switch instead sets the value to false.
...the switch is implemented as a <button> element which is initially checked courtesy of its aria-checked attribute being set to "true".
... document.queryselectorall(".switch").foreach(function(theswitch) { theswitch.addeventlistener("click", handleclickevent, false); }); function handleclickevent(evt) { let el = evt.target; if (el.getattribute("aria-checked") == "true") { el.setattribute("aria-checked", "false"); } else { el.setattribute("aria-checked", "true"); } } css the purpose of the css is to establish a look and feel for the switch that's reminiscent of the power switch paradigm.
Accessibility and Spacial Patterns - Accessibility
the mechanism for this is poorly understood, but is believed to be linked to "gamma oscillations" set up in the brain.
... adobe illustrator, for example, allows one to typeset ada braille for printing out.
... see also mdn accessibiltity: what users can do to browse more safely web accessibiltity for seizures and physical reactions web accessibility: understanding colors and luminance braille part 3: a step-by-step guide to typesetting ada braille correctly in adobe illustrator spatial math in brailleblaster (4 of 5) government literature nasa: designing with blue math spatial reasoning: why math talk is about more than numbers scientific literature colour constancy in context: roles for local adaptation and levels of reference gamma oscillations and photosensitive epilepsy characterizing the patterne...
An overview of accessible web applications and widgets - Accessibility
line 9 sets the aria-hidden state to true.
...javascript to update the aria-checked attribute var showtip = function(el) { el.setattribute('aria-hidden', 'false'); } role changes aria allows developers to declare a semantic role for an element that otherwise offers incorrect or no semantics.
...a developer might be tempted to implement the "view" mode using a read-only text <input> element and setting its aria role to button, then switching to "edit" mode by making the element writable and removing the role attribute in "edit" mode (since <input> elements have their own role semantics).
-webkit-print-color-adjust - CSS: Cascading Style Sheets
/* keyword values */ -webkit-print-color-adjust: economy; -webkit-print-color-adjust: exact; /* global values */ -webkit-print-color-adjust: inherit; -webkit-print-color-adjust: initial; -webkit-print-color-adjust: unset; syntax the -webkit-print-color-adjust property is specified as one of the keyword values listed below.
... background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog.
... exact background colors and images of the element to which this rule is applied are always printed, user's print settings are overridden.
::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, l...
... html <h2>my heading</h2> <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
... working draft generalizes allowed properties to typesetting, text decoration, inline layout properties, opacity, and box-shadow.
:host() - CSS: Cascading Style Sheets
WebCSS:host()
nks in headers!" }' + ':host-context(article, aside) { color: gray; }' + ':host(.footer) { color : red; }' + ':host { background: rgba(0,0,0,0.1); padding: 2px 5px; }'; the :host(.footer) { color : red; } rule styles all instances of the <context-span> element (the shadow host in this instance) in the document that have the footer class set on them — we've used it to give instances of the element inside the <footer> a special color.
... 54edge full support 79firefox full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...roid full support 54firefox android full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
:where() - CSS: Cascading Style Sheets
WebCSS:where
internet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:where()chrome full support 72disabled full support 72disabled disabled from version 72: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
...port nofirefox 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).
... no support nowebview android no support nochrome android full support 72disabled full support 72disabled disabled from version 72: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to enabled).
additive-symbols - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial valuen/acomputed valueas specified formal syntax [ <integer> && <symbol> ]#where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
negative - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial value"-" hyphen-minuscomputed valueas specified formal syntax <symbol> <symbol>?where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
pad - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial value0 ""computed valueas specified formal syntax <integer> && <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
prefix - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial value"" (the empty string)computed valueas specified formal syntax <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)<gradient> = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()>where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><cf-mixing-image> = <percentage>?
@font-face - CSS: Cascading Style Sheets
font-feature-settings allows control over advanced typographic features in opentype fonts.
... font-variation-settings allows low-level control over opentype or truetype font variations, by specifying the four letter axis names of the features to vary, along with their variation values.
...ill not work: .classname { @font-face { font-family: myhelvetica; src: local("helvetica neue bold"), local("helveticaneue-bold"), url(mgopenmodernabold.ttf); font-weight: bold; } } formal syntax @font-face { [ font-family: <family-name>; ] | [ src: <src>; ] | [ unicode-range: <unicode-range>; ] | [ font-variant: <font-variant>; ] | [ font-feature-settings: <font-feature-settings>; ] | [ font-variation-settings: <font-variation-settings>; ] | [ font-stretch: <font-stretch>; ] | [ font-weight: <font-weight>; ] | [ font-style: <font-style>; ] }where <family-name> = <string> | <custom-ident>+ examples specifying a downloadable font this example simply specifies a downloadable font to use, applying it to the entire body of the document:...
max-zoom - CSS: Cascading Style Sheets
the max-zoom css descriptor sets the maximum zoom factor of a document defined by the @viewport at-rule.
... syntax /* keyword value */ max-zoom: auto; /* <number> values */ max-zoom: 0.8; max-zoom: 2.0; /* <percentage> value */ max-zoom: 150%; values auto the user agent will set the document's upper zoom factor limit.
... formal definition related at-rule@viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting max-zoom @viewport { max-zoom: 1.5; } specifications specification status comment css device adaptationthe definition of '"max-zoom" descriptor' in that specification.
min-zoom - CSS: Cascading Style Sheets
the min-zoom css descriptor sets the minimum zoom factor of a document defined by the @viewport at-rule.
... syntax /* keyword value */ min-zoom: auto; /* <number> values */ min-zoom: 0.8; min-zoom: 2.0; /* <percentage> value */ min-zoom: 150%; values auto the user agent will set the document's lower zoom factor limit.
... formal definition related at-rule@viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting min zoom factor @viewport { min-zoom: 2.0; } specifications specification status comment css device adaptationthe definition of '"min-zoom" descriptor' in that specification.
width - CSS: Cascading Style Sheets
WebCSS@viewportwidth
the width css descriptor is shorthand for setting both the min-width and the max-width descriptors of the viewport.
... if two viewport values are provided the first value will be set to the min-width and the second value will be set max-width.
... blockmax-width: refer to the width of the containing blockcomputed valueas each of the properties of the shorthand:min-width: the percentage as specified or the absolute lengthmax-width: the percentage as specified or the absolute length or none formal syntax <viewport-length>{1,2}where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting minimum and maximum width @viewport { width: 500px; } specifications specification status comment css device adaptationthe definition of '"min-width" descriptor' in that specification.
zoom - CSS: Cascading Style Sheets
WebCSS@viewportzoom
the zoom css descriptor sets the initial zoom factor of a document defined by the @viewport at-rule.
... syntax /* keyword value */ zoom: auto; /* <number> values */ zoom: 0.8; zoom: 2.0; /* <percentage> values */ zoom: 150%; values auto the user agent will set the document's initial zoom factor.
... formal definition related at-rule@viewportinitial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting viewport zoom factor @viewport { zoom: 2.0; } specifications specification status comment css device adaptationthe definition of '"zoom" descriptor' in that specification.
Alternative style sheets - CSS: Cascading Style Sheets
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 "...
... no matter what style is selected, the rules from the reset.css stylesheet will always be applied.
... working draft the css om specification defines the concepts of the style sheet set name, its disabled flag, and the preferred css style sheet set name.
Using URL values for the cursor property - CSS: Cascading Style Sheets
if none are specified, the coordinates of the hotspot are read from the file itself (for cur and xbm files) or are set to the top left corner of the image.
... an example of the css3 syntax is: .foo { cursor: auto; cursor: url(cursor1.png) 4 12, auto; } .bar { cursor: pointer; cursor: url(cursor2.png) 2 2, pointer; } /* falls back onto 'auto' and 'pointer' in ie, but must be set separately */ the first number is the x-coordinate, and the second number is the y-coordinate.
... the example will set the hotspot to be the pixel at (4,12) from the top left (0,0).
Box alignment in grid layout - CSS: Cascading Style Sheets
the first item overrides the align-items value set on the group by setting align-self to center.
...the properties align-items and justify-items are applied to the grid container and set the align-self and justify-self properties as a group.
... this means that you can set alignment for all of your grid items at once, then override any items that need a different alignment by applying the align-self or justify-self property to the rules for the individual grid items.
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
if the box-sizing property is set to content-box (default) and if the element is a block element, the content area's size can be explicitly defined with the width, min-width, max-width, height, min-height, and max-height properties.
...if the box-sizing property is set to border-box, the border area's size can be explicitly defined with the width, min-width, max-width, height, min-height, and max-height properties.
... when there is a background (background-color or background-image) set on a box, it extends to the outer edge of the border (i.e.
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
an element set to display: flex behaves in most ways like any other block level container that establishes a containing block.
...in grid layout you do the majority of sizing specification on the container, setting up tracks and then placing items into them.
... in flexbox, while you create a flex container and set the direction at that level, any control over item sizing needs to happen on the items themselves.
In Flow and Out of Flow - CSS: Cascading Style Sheets
in the next example i have three paragraph elements, the second element has position absolute, with offset values of top: 30px and right: 30px.
... using position: fixed also removes the item from flow, however the offsets are based on the viewport rather than the containing block.
... relative positioning and flow if you give an item relative positioning with position: relative it remains in flow, however you are then able to use the offset values to push it around.
Introduction to formatting contexts - CSS: Cascading Style Sheets
le-cell, including anonymous table cells created when using the display: table-* properties table captions or elements with display: table-caption block elements where overflow has a value other than visible elements with display: flow-root or display: flow-root list-item elements with contain: layout, content, or strict flex items grid items multicol containers elements with column-span set to all this is useful because a new bfc will behave much like the outermost document in that it becomes a mini-layout inside the main layout.
...a typical way to do this in the past has been to set overflow: auto or set other values than the initial value of overflow: visible.
... setting overflow: auto created a new bfc containing the float.
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
in the first we set the start row line, then the end line we explain that we want to span 3 lines.
... .box1 { grid-column-start: 1; grid-row-start: 1; grid-row-end: span 3; } in the second example, we specify the end row line we want the item to finish at and then set the start line as span 3.
...this may result in the layout you want, but if something is appearing somewhere unexpected, check that you have set a position for it.
Using CSS gradients - CSS: Cascading Style Sheets
<div class="multicolor-linear"></div> div { width: 120px; height: 120px; } .multicolor-linear { background: linear-gradient(to left, lime 28px, red 77%, cyan); } creating hard lines to create a hard line between two colors, creating a stripe instead of a gradual transition, adjacent color stops can be set to the same location.
... example: closest-side for ellipses this example uses the closest-side size value, which means the size is set by the distance from the starting point (the center) to the closest side of the enclosing box.
... <div class="radial-ellipse-side"></div> div { width: 240px; height: 100px; } .radial-ellipse-side { background: radial-gradient(ellipse closest-side, red, yellow 10%, #1e90ff 50%, beige); } example: farthest-corner for ellipses this example is similar to the previous one, except that its size is specified as farthest-corner, which sets the size of the gradient by the distance from the starting point to the farthest corner of the enclosing box from the starting point.
Using CSS counters - CSS: Cascading Style Sheets
using counters manipulating a counter's value to use a css counter, it must first be initialized to a value with the counter-reset property (0 by default).
... css body { counter-reset: section; /* set a counter named 'section', and its initial value is 0.
... example of a nested counter css ol { counter-reset: section; /* creates a new instance of the section counter with each ol element */ list-style-type: none; } li::before { counter-increment: section; /* increments only this instance of the section counter */ content: counters(section,...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
an example would be margin-block, which is a shorthand setting for margin-block-start and margin-block-end.
... note: the css working group are currently trying to decide what to do about the four-value shorthands for logical properties, for example the equivalents to setting four physical properties at once, like margins with the margin property.
...for example you could set a width, test for inline-size and, if it is supported, set the width to auto and the inline-size to the original width value.
CSS Motion Path - CSS: Cascading Style Sheets
with offset-path you can define a specific path of any shape you want.
... you then animate it along that path by animating offset-distance, and can choose to rotate it at any point using offset-rotate.
... 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 draft initial definition.
Column layouts - CSS: Cascading Style Sheets
you have a set of small items you want to break into columns.
... a single row of items with equal heights — flexbox flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column.
... download this example flexbox can also be used to create layouts where the flex items wrap onto new rows, by setting the flex-wrap property on the container to wrap.
Mozilla CSS extensions - CSS: Cascading Style Sheets
till accepted] -moz-column-width [prefixed version still accepted] -moz-column-rule [prefixed version still accepted] -moz-column-rule-width [prefixed version still accepted] -moz-column-rule-style [prefixed version still accepted] -moz-column-rule-color [prefixed version still accepted] -moz-context-properties f–m filter [applying to more than svg] -moz-font-feature-settings [prefixed version still accepted] -moz-font-language-override [prefixed version still accepted] -moz-hyphens [prefixed version still accepted] -moz-margin-end [superseded by the standard version margin-inline-end] -moz-margin-start [superseded by the standard version margin-inline-start] mask [applying to more than svg] o -moz-opacityobsolete since gecko 1.9.1 -moz-o...
...utlineobsolete since gecko 1.9.2 -moz-outline-colorobsolete since gecko 1.9.2 -moz-outline-offsetobsolete since gecko 1.9.2 -moz-outline-styleobsolete since gecko 1.9.2 -moz-outline-widthobsolete since gecko 1.9.2 p -moz-padding-end [superseded by the standard version padding-inline-start] -moz-padding-start [superseded by the standard version padding-inline-end] -moz-perspective [prefixed version still accepted] -moz-perspective-origin [prefixed version still accepted] pointer-events [applying to more than svg] t–u -moz-tab-size -moz-text-align-lastobsolete since gecko 53 -moz-text-decoration-colorobsolete since gecko 39 -moz-text-decoration-lineobsolete since gecko 39 -moz-text-decoration-styleobsolete since gecko 39 -moz-text-size-adjust -moz-tra...
... border-style and outline-style -moz-bg-insetobsolete since gecko 1.9 -moz-bg-outsetobsolete since gecko 1.9 -moz-bg-solidobsolete since gecko 1.9 <color> keywords -moz-activehyperlinktext -moz-hyperlinktext -moz-visitedhyperlinktext -moz-buttondefault -moz-buttonhoverface -moz-buttonhovertext -moz-default-background-color -moz-default-color -moz-cellhighlight -moz-cellhighlighttext -moz-field -moz-fieldtext -moz-dialog ...
WebKit CSS extensions - CSS: Cascading Style Sheets
gin-after-collapse -webkit-margin-after -webkit-margin-before-collapse -webkit-margin-before -webkit-margin-bottom-collapse -webkit-margin-collapse -webkit-margin-end** -webkit-margin-start** -webkit-margin-top-collapse -webkit-marquee-direction -webkit-marquee-increment -webkit-marquee-repetition -webkit-marquee-speed -webkit-marquee-style -webkit-marquee -webkit-mask-box-image-outset -webkit-mask-box-image-repeat -webkit-mask-box-image-slice -webkit-mask-box-image-source -webkit-mask-box-image-width -webkit-mask-box-image -webkit-mask-repeat-x -webkit-mask-repeat-y -webkit-mask-source-type -webkit-max-logical-height -webkit-max-logical-width -webkit-min-logical-height -webkit-min-logical-width n -webkit-nbsp-mode p -webkit-padding-after** -webkit-paddin...
...kit-column-count -webkit-column-fill -webkit-column-gap -webkit-column-rule -webkit-column-rule-color -webkit-column-rule-style -webkit-column-rule-width -webkit-column-span -webkit-column-width -webkit-columns f -webkit-filter -webkit-flex -webkit-flex-basis -webkit-flex-direction -webkit-flex-flow -webkit-flex-grow -webkit-flex-shrink -webkit-flex-wrap -webkit-font-feature-settings -webkit-font-kerning -webkit-font-variant-ligatures g-j -webkit-grid -webkit-grid-area -webkit-grid-auto-columns -webkit-grid-auto-flow -webkit-grid-auto-rows -webkit-grid-column -webkit-grid-column-end -webkit-grid-column-gap -webkit-grid-column-start -webkit-grid-gap -webkit-grid-row -webkit-grid-row-end -webkit-grid-row-gap -webkit-grid-row-start -webkit-grid-template...
... -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-region-fragment -webkit-shape-inside -webkit-touch-callout (see touch-action) background-origin-x (unprefixed!) background-origin-y (unprefixed!) * still supporte...
animation-duration - CSS: Cascading Style Sheets
the animation-duration css property sets the length of time that an animation takes to complete one cycle.
... it is often convenient to use the shorthand property animation to set all animation properties at once.
...for more information, see setting multiple animation property values.
animation-iteration-count - CSS: Cascading Style Sheets
the animation-iteration-count css property sets the number of times an animation sequence should be played before stopping.
... it is often convenient to use the shorthand property animation to set all animation properties at once.
...for more information, see setting multiple animation property values.
animation-play-state - CSS: Cascading Style Sheets
the animation-play-state css property sets whether an animation is running or paused.
... syntax /* single animation */ animation-play-state: running; animation-play-state: paused; /* multiple animations */ animation-play-state: paused, running, running; /* global values */ animation-play-state: inherit; animation-play-state: initial; animation-play-state: unset; values running the animation is currently playing.
...for more information, see setting multiple animation property values.
background-origin - CSS: Cascading Style Sheets
the background-origin css property sets the background's origin: from the border start, inside the border, or inside the padding.
... syntax /* keyword values */ background-origin: border-box; background-origin: padding-box; background-origin: content-box; /* global values */ background-origin: inherit; background-origin: initial; background-origin: unset; the background-origin property is specified as one of the keyword values listed below.
...it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-box | padding-box | content-box examples setting background origins .example { border: 10px double; padding: 10px; background: url('image.jpg'); background-position: center left; background-origin: content-box; } #example2 { border: 4px solid black; padding: 10px; background: url('image.gif'); background-repeat: no-repeat; background-origin: border-box; } div { background-image: url('logo.jpg'), url('mainback.png'...
background-repeat - CSS: Cascading Style Sheets
the background-repeat css property sets how background images are repeated.
... repeat-y; background-repeat: repeat; background-repeat: space; background-repeat: round; background-repeat: no-repeat; /* two-value syntax: horizontal | vertical */ background-repeat: repeat space; background-repeat: repeat repeat; background-repeat: round space; background-repeat: no-repeat round; /* global values */ background-repeat: inherit; background-repeat: initial; background-repeat: unset; values <repeat-style> the one-value syntax is a shorthand for the full two-value syntax: single value two-value equivalent repeat-x repeat no-repeat repeat-y no-repeat repeat repeat repeat repeat space space space round round round no-repeat no-repeat no-repeat in th...
...it also applies to ::first-letter and ::first-line.inheritednocomputed valuea list, each item consisting of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting background-repeat html <ol> <li>no-repeat <div class="one"></div> </li> <li>repeat <div class="two"></div> </li> <li>repeat-x <div class="three"></div> </li> <li>repeat-y <div class="four"></div> </li> <li>space <div class="five"></div> </li> <li>round <div class="six"></div> </li> <li>repeat-x, repeat-y (multiple images) <div class="sev...
background-size - CSS: Cascading Style Sheets
the background-size css property sets the size of the element's background image.
... image, second value: height */ background-size: 50% auto; background-size: 3em 25%; background-size: auto 6px; background-size: auto auto; /* multiple backgrounds */ background-size: auto, auto; /* not to be confused with `auto auto` */ background-size: 50%, 25%, 25%; background-size: 6px, auto, contain; /* global values */ background-size: inherit; background-size: initial; background-size: unset; the background-size property is specified in one of the following ways: using the keyword values contain or cover.
... using both a width and a height value, in which case the first sets the width and the second sets the height.
border-block - CSS: Cascading Style Sheets
the border-block css property is a shorthand property for setting the individual logical block border property values in a single place in the style sheet.
... border-block: 1px; border-block: 2px dotted; border-block: medium dashed blue; border-block can be used to set the values for one or more of border-block-width, border-block-style, and border-block-color setting both the start and end in the block dimension at once.
... the borders in the other dimension can be set with border-inline, which sets border-inline-start, and border-inline-end.
border-bottom-color - CSS: Cascading Style Sheets
the border-bottom-color css property sets the color of an element's bottom border.
... it can also be set with the shorthand css properties border-color or border-bottom.
... syntax /* <color> values */ border-bottom-color: red; border-bottom-color: #ffbb00; border-bottom-color: rgb(255, 0, 0); border-bottom-color: hsla(100%, 50%, 25%, 0.75); border-bottom-color: currentcolor; border-bottom-color: transparent; /* global values */ border-bottom-color: inherit; border-bottom-color: initial; border-bottom-color: unset; the border-bottom-color property is specified as a single value.
border-collapse - CSS: Cascading Style Sheets
the border-collapse css property sets whether cells inside a <table> have shared or separate borders.
... when cells are collapsed, the border-style value of inset behaves like groove, and outset behaves like ridge.
... syntax /* keyword values */ border-collapse: collapse; border-collapse: separate; /* global values */ border-collapse: inherit; border-collapse: initial; border-collapse: unset; the border-collapse property is specified as a single keyword, which may be chosen from the list below.
border-left-color - CSS: Cascading Style Sheets
the border-left-color css property sets the color of an element's left border.
... it can also be set with the shorthand css properties border-color or border-left.
... syntax /* <color> values */ border-left-color: red; border-left-color: #ffbb00; border-left-color: rgb(255, 0, 0); border-left-color: hsla(100%, 50%, 25%, 0.75); border-left-color: currentcolor; border-left-color: transparent; /* global values */ border-left-color: inherit; border-left-color: initial; border-left-color: unset; the border-left-color property is specified as a single value.
border-right-color - CSS: Cascading Style Sheets
the border-right-color css property sets the color of an element's right border.
... it can also be set with the shorthand css properties border-color or border-right.
... syntax /* <color> values */ border-right-color: red; border-right-color: #ffbb00; border-right-color: rgb(255, 0, 0); border-right-color: hsla(100%, 50%, 25%, 0.75); border-right-color: currentcolor; border-right-color: transparent; /* global values */ border-right-color: inherit; border-right-color: initial; border-right-color: unset; the border-right-color property is specified as a single value.
border-spacing - CSS: Cascading Style Sheets
the border-spacing css property sets the distance between the borders of adjacent <table> cells.
... note: the border-spacing property is equivalent to the deprecated cellspacing <table> attribute, except that it has an optional second value that can be used to set different horizontal and vertical spacing.
... syntax /* <length> */ border-spacing: 2px; /* horizontal <length> | vertical <length> */ border-spacing: 1cm 2em; /* global values */ border-spacing: inherit; border-spacing: initial; border-spacing: unset; the border-spacing property may be specified as either one or two values.
border-top-color - CSS: Cascading Style Sheets
the border-top-color css property sets the color of an element's top border.
... it can also be set with the shorthand css properties border-color or border-top.
... syntax /* <color> values */ border-top-color: red; border-top-color: #ffbb00; border-top-color: rgb(255, 0, 0); border-top-color: hsla(100%, 50%, 25%, 0.75); border-top-color: currentcolor; border-top-color: transparent; /* global values */ border-top-color: inherit; border-top-color: initial; border-top-color: unset; the border-top-color property is specified as a single value.
box-align - CSS: Cascading Style Sheets
WebCSSbox-align
/* keyword values */ box-align: start; box-align: center; box-align: end; box-align: baseline; box-align: stretch; /* global values */ box-lines: inherit; box-lines: initial; box-lines: unset; the direction of layout depends on the element's orientation: horizontal or vertical.
... if the alignment is set using the element's align attribute, then the style is ignored.
... formal definition initial valuestretchapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax start | center | end | baseline | stretch examples setting box alignment <!doctype html> <html> <head> <title>css box-align example</title> <style> div.example { display: box; /* as specified */ display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ /* make this box taller than the children, so there is room for the box-pack */ height: 400px; /* make this box wider than the children so there is room for the box-align */ width: 300px; /* children should be oriented vertically */ box-orient: vertical; /* as specified *...
box-orient - CSS: Cascading Style Sheets
the box-orient css property sets whether an element lays out its contents horizontally or vertically.
... /* keyword values */ box-orient: horizontal; box-orient: vertical; box-orient: inline-axis; box-orient: block-axis; /* global values */ box-orient: inherit; box-orient: initial; box-orient: unset; syntax the box-orient property is specified as one of the keyword values listed below.
... formal definition initial valueinline-axis (horizontal in xul)applies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax horizontal | vertical | inline-axis | block-axis | inherit examples setting horizontal box orientation here, he box-orient property will cause the two <p> sections in the example to display in the same line.
break-after - CSS: Cascading Style Sheets
the break-after css property sets how page, column, or region breaks should behave after a generated box.
...ys; break-after: all; /* page break values */ break-after: avoid-page; break-after: page; break-after: left; break-after: right; break-after: recto; break-after: verso; /* column break values */ break-after: avoid-column; break-after: column; /* region break values */ break-after: avoid-region; break-after: region; /* global values */ break-after: inherit; break-after: initial; break-after: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
...a subset of values should be aliased as follows: page-break-after break-after auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break.
break-before - CSS: Cascading Style Sheets
the break-before css property sets how page, column, or region breaks should behave before a generated box.
...re: all; /* page break values */ break-before: avoid-page; break-before: page; break-before: left; break-before: right; break-before: recto; break-before: verso; /* column break values */ break-before: avoid-column; break-before: column; /* region break values */ break-before: avoid-region; break-before: region; /* global values */ break-before: inherit; break-before: initial; break-before: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element.
...a subset of values should be aliased as follows: page-break-before break-before auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break.
color - CSS: Cascading Style Sheets
WebCSScolor
the color css property sets the foreground color value of an element's text and text decorations, and sets the currentcolor value.
...); color: rgb(34 12 64 / 0.6); color: rgba(34 12 64 / 0.3); color: rgb(34.0 12 64 / 60%); color: rgba(34.6 12 64 / 30%); /* <hsl()> values */ color: hsl(30, 100%, 50%, 0.6); color: hsla(30, 100%, 50%, 0.6); color: hsl(30 100% 50% / 0.6); color: hsla(30 100% 50% / 0.6); color: hsl(30.0 100% 50% / 60%); color: hsla(30.2 100% 50% / 60%); /* global values */ color: inherit; color: initial; color: unset; the color property is specified as a single <color> value.
... values <color> sets the color of the textual and decorative parts of the element.
<color> - CSS: Cascading Style Sheets
note: the list of accepted keywords has undergone many changes during the evolution of css: css level 1 only included 16 basic colors, called the vga colors as they were taken from the set of displayable colors on vga graphics cards.
...hsl can also make it easier to create a set of matching colors (such as when you want multiple shades of a single hue).
... -moz-win-accentcolor used to access the windows 10 custom accent color that you can set on the start menu, taskbar, title bars, etc.
column-rule-color - CSS: Cascading Style Sheets
the column-rule-color css property sets the color of the line drawn between columns in a multi-column layout.
... syntax /* <color> values */ column-rule-color: red; column-rule-color: rgb(192, 56, 78); column-rule-color: transparent; column-rule-color: hsla(0, 100%, 50%, 0.6); /* global values */ column-rule-color: inherit; column-rule-color: initial; column-rule-color: unset; the column-rule-color property is specified as a single <color> value.
...)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples setting a blue column rule html <p>this is a bunch of text split into three columns.
column-rule-style - CSS: Cascading Style Sheets
the column-rule-style css property sets the style of the line drawn between columns in a multi-column layout.
... syntax /* <'border-style'> values */ column-rule-style: none; column-rule-style: hidden; column-rule-style: dotted; column-rule-style: dashed; column-rule-style: solid; column-rule-style: double; column-rule-style: groove; column-rule-style: ridge; column-rule-style: inset; column-rule-style: outset; /* global values */ column-rule-style: inherit; column-rule-style: initial; column-rule-style: unset; the column-rule-style property is specified as a single <'border-style'> value.
... formal definition initial valuenoneapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-style'> examples setting a dashed column rule html <p>this is a bunch of text split into three columns.
column-rule-width - CSS: Cascading Style Sheets
the column-rule-width css property sets the width of the line drawn between columns in a multi-column layout.
... syntax /* keyword values */ column-rule-width: thin; column-rule-width: medium; column-rule-width: thick; /* <length> values */ column-rule-width: 1px; column-rule-width: 2.5em; /* global values */ column-rule-width: inherit; column-rule-width: initial; column-rule-width: unset; the column-rule-width property is specified as a single <'border-width'> value.
... formal definition initial valuemediumapplies tomulticol elementsinheritednocomputed valuethe absolute length; 0 if the column-rule-style is none or hiddenanimation typea length formal syntax <'border-width'> examples setting a thick column rule html <p>this is a bunch of text split into three columns.
column-width - CSS: Cascading Style Sheets
the column-width css property sets the ideal column width in a multi-column layout.
... syntax /* keyword value */ column-width: auto; /* <length> values */ column-width: 60px; column-width: 15.5em; column-width: 3.3vw; /* global values */ column-width: inherit; column-width: initial; column-width: unset; the column-width property is specified as one of the values listed below.
... formal definition initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valuethe absolute length, zero or largeranimation typea length formal syntax <length> | auto examples setting column width in pixels html <p class="content-box"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
columns - CSS: Cascading Style Sheets
WebCSScolumns
the columns css shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths.
... constituent properties this property is a shorthand for the following css properties: column-count column-width syntax /* column width */ columns: 18em; /* column count */ columns: auto; columns: 2; /* both column width and count */ columns: 2 auto; columns: auto 12em; columns: auto auto; /* global values */ columns: inherit; columns: initial; columns: unset; the columns property may be specified as one or two of the values listed below, in any order.
...:column-width: autocolumn-count: autoapplies toblock containers except table wrapper boxesinheritednocomputed valueas each of the properties of the shorthand:column-width: the absolute length, zero or largercolumn-count: as specifiedanimation typeas each of the properties of the shorthand:column-width: a lengthcolumn-count: an integer formal syntax <'column-width'> | <'column-count'> examples setting three equal columns html <p class="content-box"> this is a bunch of text split into three columns using the css `columns` property.
counter() - CSS: Cascading Style Sheets
WebCSScounter
syntax values <custom-ident> a name identifying the counter, which is the same case-sensitive name used for the counter-reset and counter-increment.
... the name cannot start with two dashes and can't be none, unset, initial, or inherit.
...)where <counter-style> = <counter-style-name> | symbols()where <counter-style-name> = <custom-ident> examples default value compared to upper roman html <ol> <li></li> <li></li> <li></li> </ol> css ol { counter-reset: listcounter; } li { counter-increment: listcounter; } li::after { content: "[" counter(listcounter) "] == [" counter(listcounter, upper-roman) "]"; } result decimal-leading-zero compared to lower-alpha html <ol> <li></li> <li></li> <li></li> </ol> css ol { counter-reset: count; } li { counter-increment: count; } li::after { content: "[" counter(count, decim...
cross-fade() - CSS: Cascading Style Sheets
&& <image><cf-final-image> = <image> | <color>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <image()> = image( <image-tags>?
...)<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<paint()> = paint( <ident>, <declaration-value>?
...)where <image-tags> = ltr | rtl<image-src> = <url> | <string><image-set-option> = [ <image> | <string> ] <resolution><id-selector> = <hash-token><linear-gradient()> = linear-gradient( [ <angle> | to <side-or-corner> ]?
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
in order to better describe this behavior, the display property has been refactored to allow for two values — an outer and inner value — to be set on it, as well as the single values we are used to.
... this means that instead of setting display: flex to create a block-level box with flex children, we will use display: block flex.
... if only an inner value of flex, grid, or flow-root is specified then the specification explains that the outer value should be set to block: "if a <display-inside> value is specified but <display-outside> is omitted, the element’s outer display type defaults to block—except for ruby, which defaults to inline." finally, we have some legacy pre-composed inline-level values of: inline-block inline-table inline-flex inline-grid if a supporting browser comes across these as single values then it treats them the sa...
<easing-function> - CSS: Cascading Style Sheets
the easing functions in the cubic-bezier subset of easing functions are often called "smooth" easing functions, because they can be used to smooth down the start and end of the animation.
... easing functions css supports three kinds of easing functions: linear, the subset of the cubic bézier curves that are functions, and staircase functions.
...nst startbtn = document.queryselector('button'); const divelem = document.queryselector('div > div'); startbtn.addeventlistener('click', () => { if(startbtn.textcontent === 'start animation') { divelem.style.animationname = 'move-right'; startbtn.textcontent = 'stop animation'; divelem.style.animationtimingfunction = selectelem.value; } else { divelem.style.animationname = 'unset'; startbtn.textcontent = 'start animation'; } }); selectelem.addeventlistener('change', () => { divelem.style.animationtimingfunction = selectelem.value; }); result cubic-bezier() function examples these cubic bézier curves are valid for use in css: /* the canonical bézier curve with four <number> in the [0,1] range.
<filter-function> - CSS: Cascading Style Sheets
tput { width: 5%; text-align: center; } select { width: 40%; margin-left: 2px; } javascript const selectelem = document.queryselector('select'); const divelem = document.queryselector('div'); const slider = document.queryselector('input'); const output = document.queryselector('output'); const curvalue = document.queryselector('p code'); selectelem.addeventlistener('change', () => { setslider(selectelem.value); setdiv(selectelem.value); }); slider.addeventlistener('input', () => { setdiv(selectelem.value); }); function setslider(filter) { if(filter === 'blur') { slider.value = 0; slider.min = 0; slider.max = 30; slider.step = 1; slider.setattribute('data-unit', 'px'); } else if(filter === 'brightness' || filter === 'contrast' || filter === 'saturate...
...') { slider.value = 1; slider.min = 0; slider.max = 4; slider.step = 0.05; slider.setattribute('data-unit', ''); } else if(filter === 'drop-shadow') { slider.value = 0; slider.min = -20; slider.max = 40; slider.step = 1; slider.setattribute('data-unit', 'px'); } else if(filter === 'opacity') { slider.value = 1; slider.min = 0; slider.max = 1; slider.step = 0.01; slider.setattribute('data-unit', ''); } else if(filter === 'grayscale' || filter === 'invert' || filter === 'sepia') { slider.value = 0; slider.min = 0; slider.max = 1; slider.step = 0.01; slider.setattribute('data-unit', ''); } else if(filter === 'hue-rotate') { slider.value = 0; slider.min = 0; slider.max = 360; slider.step = 1; ...
... slider.setattribute('data-unit', 'deg'); } } function setdiv(filter) { if(filter === 'drop-shadow') { divelem.style.filter = `${selectelem.value}(${math.round(slider.value)}${slider.getattribute('data-unit')} ${math.round(slider.value)}${slider.getattribute('data-unit')} ${math.round(math.abs(slider.value/2))}${slider.getattribute('data-unit')})`; } else { divelem.style.filter = `${selectelem.value}(${slider.value}${slider.getattribute('data-unit')}`; } updateoutput(); updatecurvalue(); } function updateoutput() { output.textcontent = slider.value; } function updatecurvalue() { curvalue.textcontent = `filter: ${divelem.style.filter}`; } setslider(selectelem.value); setdiv(selectelem.value); result specifications specification status ...
font-language-override - CSS: Cascading Style Sheets
/* keyword value */ font-language-override: normal; /* <string> values */ font-language-override: "eng"; /* use english glyphs */ font-language-override: "trk"; /* use turkish glyphs */ /* global values */ font-language-override: initial; font-language-override: inherit; font-language-override: unset; by default, html's lang attribute tells browsers to display glyphs designed specifically for that language.
... for example, a lot of fonts have a special character for the digraph fi that merge the dot on the "i" with the "f." however, if the language is set to turkish the typeface will likely know not to use the merged glyph; turkish has two versions of the "i," one with a dot (i) and one without (ı), and using the ligature would incorrectly transform a dotted "i" into a dotless "i." the font-language-override property lets you override the typeface behavior for a specific language.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | <string> examples using danish glyphs html <p class="para1">default language setting.</p> <p class="para2">this is a string with the <code>font-language-override</code> set to danish.</p> css p.para1 { font-language-override: normal; } p.para2 { font-language-override: "dan"; } result specifications specification status comment css fonts module level 4the definition of 'font-language-override' in that specification.
font-optical-sizing - CSS: Cascading Style Sheets
the font-optical-sizing css property sets whether text rendering is optimized for viewing at different sizes.
... syntax /* keyword values */ font-optical-sizing: none; font-optical-sizing: auto; /* default */ /* global values */ font-optical-sizing: inherit; font-optical-sizing: initial; font-optical-sizing: unset; values none the browser will not modify the shape of glyphs for optimal viewing.
...the optical size variation axis is represented by opsz in font-variation-settings.
gap (grid-gap) - CSS: Cascading Style Sheets
WebCSSgap
the gap css property sets the gaps (gutters) between rows and columns.
... */ gap: 20px; gap: 1em; gap: 3vmin; gap: 0.5cm; /* one <percentage> value */ gap: 16%; gap: 100%; /* two <length> values */ gap: 20px 10px; gap: 1em 0.5em; gap: 3vmin 2vmax; gap: 0.5cm 2mm; /* one or two <percentage> values */ gap: 16% 100%; gap: 21px 82%; /* calc() values */ gap: calc(10% + 20px); gap: calc(20px + 10%) calc(10% - 5px); /* global values */ gap: inherit; gap: initial; gap: unset; this property is specified as a value for <'row-gap'> followed optionally by a value for <'column-gap'>.
... if <'column-gap'> is omitted, it’s set to the same value as <'row-gap'>.
grid-auto-columns - CSS: Cascading Style Sheets
-columns: min-content max-content auto; grid-auto-columns: 100px 150px 390px; grid-auto-columns: 10% 33.3%; grid-auto-columns: 0.5fr 3fr 1fr; grid-auto-columns: minmax(100px, auto) minmax(max-content, 2fr) minmax(20%, 80vmax); grid-auto-columns: 100px minmax(100px, auto) 10% 0.5fr fit-content(400px); /* global values */ grid-auto-columns: inherit; grid-auto-columns: initial; grid-auto-columns: unset; values <length> is a non-negative length.
...as a maximum, a <flex> value sets the track’s flex factor.
...iscrete formal syntax <track-size>+where <track-size> = <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )where <track-breadth> = <length-percentage> | <flex> | min-content | max-content | auto<inflexible-breadth> = <length> | <percentage> | min-content | max-content | autowhere <length-percentage> = <length> | <percentage> examples setting grid column size html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> </div> css #grid { height: 100px; display: grid; grid-template-areas: "a a"; grid-gap: 10px; grid-auto-columns: 200px; } #grid > div { background-color: lime; } result specifications specification status comment css grid layoutthe ...
grid-auto-rows - CSS: Cascading Style Sheets
ck-size values */ grid-auto-rows: min-content max-content auto; grid-auto-rows: 100px 150px 390px; grid-auto-rows: 10% 33.3%; grid-auto-rows: 0.5fr 3fr 1fr; grid-auto-rows: minmax(100px, auto) minmax(max-content, 2fr) minmax(20%, 80vmax); grid-auto-rows: 100px minmax(100px, auto) 10% 0.5fr fit-content(400px); /* global values */ grid-auto-rows: inherit; grid-auto-rows: initial; grid-auto-rows: unset; values <length> is a non-negative length.
...as a maximum, a <flex> value sets the track’s flex factor.
...discrete formal syntax <track-size>+where <track-size> = <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( [ <length> | <percentage> ] )where <track-breadth> = <length-percentage> | <flex> | min-content | max-content | auto<inflexible-breadth> = <length> | <percentage> | min-content | max-content | autowhere <length-percentage> = <length> | <percentage> examples setting grid row size html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> </div> css #grid { width: 200px; display: grid; grid-template-areas: "a a"; grid-gap: 10px; grid-auto-rows: 100px; } #grid > div { background-color: lime; } result specifications specification status comment css grid layoutthe definit...
grid-row - CSS: Cascading Style Sheets
WebCSSgrid-row
if two <grid-line> values are specified, the grid-row-start longhand is set to the value before the slash, and the grid-row-end longhand is set to the value after the slash.
...er> + <custom-ident> values */ grid-row: somegridarea 4; grid-row: 4 somegridarea / 6; /* span + <integer> + <custom-ident> values */ grid-row: span 3; grid-row: span somegridarea; grid-row: 5 somegridarea span; grid-row: span 3 / 6; grid-row: span somegridarea / span someothergridarea; grid-row: 5 somegridarea span / 2 span; /* global values */ grid-row: inherit; grid-row: initial; grid-row: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
...] | [ span && [ <integer> | <custom-ident> ] ] examples setting grid row size and location html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> </div> css #grid { display: grid; height: 200px; grid-template-columns: 200px; grid-template-rows: repeat(6, 1fr); } #item1 { background-color: lime; } #item2 { background-color: yellow; grid-row: 2 / 4; } #item3 { background-color: blue; grid-row...
initial-letter - CSS: Cascading Style Sheets
the initial-letter css property sets styling for dropped, raised, and sunken initial letters.
... /* keyword values */ initial-letter: normal; /* numeric values */ initial-letter: 1.5; /* initial letter occupies 1.5 lines */ initial-letter: 3.0; /* initial letter occupies 3 lines */ initial-letter: 3.0 2; /* initial letter occupies 3 lines and sinks 2 lines */ /* global values */ initial-letter: inherit; initial-letter: initial; initial-letter: unset; syntax the keyword value normal, or a <number> optionally followed by an <integer>.
...] examples setting initial letter size html <p class="normal">initial letter is normal</p> <p class="onefive">initial letter occupies 1.5 lines</p> <p class="three">initial letter occupies 3 lines</p> css .normal { -webkit-initial-letter: normal; initial-letter: normal; } .onefive { -webkit-initial-letter: 1.5; initial-letter: 1.5; } .three { -webkit-initial-letter: 3.0; initial-letter: 3.0; }...
justify-items - CSS: Cascading Style Sheets
for absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right.
... justify-items: baseline; justify-items: first baseline; justify-items: last baseline; /* overflow alignment (for positional alignment only) */ justify-items: safe center; justify-items: unsafe center; /* legacy alignment */ justify-items: legacy right; justify-items: legacy left; justify-items: legacy center; /* global values */ justify-items: inherit; justify-items: initial; justify-items: unset; this property can take one of four different forms: basic keywords: one of the keyword values normal, auto, or stretch.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
letter-spacing - CSS: Cascading Style Sheets
the letter-spacing css property sets the horizontal spacing behavior between text characters.
... syntax /* keyword value */ letter-spacing: normal; /* <length> values */ letter-spacing: 0.3em; letter-spacing: 3px; letter-spacing: .3px; /* global values */ letter-spacing: inherit; letter-spacing: initial; letter-spacing: unset; values normal the normal letter spacing for the current font.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valuean optimum value consisting of either an absolute length or the keyword normalanimation typea length formal syntax normal | <length> examples setting letter spacing html <p class="normal">letter spacing</p> <p class="em-wide">letter spacing</p> <p class="em-wider">letter spacing</p> <p class="em-tight">letter spacing</p> <p class="px-wide">letter spacing</p> css .normal { letter-spacing: normal; } .em-wide { letter-spacing: 0.4em; } .em-wider { letter-spacing: 1em; } .em-tight { letter-spacing: -0.05em; } .px-wide { letter-spacing...
line-break - CSS: Cascading Style Sheets
the line-break css property sets how to break lines of chinese, japanese, or korean (cjk) text when working with punctuation and symbols.
... /* keyword values */ line-break: auto; line-break: loose; line-break: normal; line-break: strict; line-break: anywhere; /* global values */ line-break: inherit; line-break: initial; line-break: unset; syntax values auto break text using the default line break rule.
... formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | loose | normal | strict | anywhere examples setting text wrapping see whether the text is wrapped before "々", "ぁ" and "。".
line-height-step - CSS: Cascading Style Sheets
the line-height-step css property sets the step unit for line box heights.
... when the property is set, line box heights are rounded up to the closest multiple of the unit.
... formal definition initial value0applies toblock containersinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples setting step unit for line box height in the following example, the height of line box in each paragraph is rounded up to the step unit.
margin-bottom - CSS: Cascading Style Sheets
the margin-bottom css property sets the margin area on the bottom of an element.
... syntax /* <length> values */ margin-bottom: 10px; /* an absolute length */ margin-bottom: 1em; /* relative to the text size */ margin-bottom: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-bottom: auto; /* global values */ margin-bottom: inherit; margin-bottom: initial; margin-bottom: unset; the margin-bottom property is specified as the keyword auto, or a <length>, or a <percentage>.
...it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples setting positive and negative bottom margins html <div class="container"> <div class="box0">box 0</div> <div class="box1">box 1</div> <div class="box2">box one's negative margin pulls me up</div> </div> css css for divs to set margin-bottom and height .box0 { margin-bottom:1em; height:3em; } .box1 { margin-bottom:-1.5em; height:4em; } .box2 { border:1px dashed black; bord...
margin-top - CSS: Cascading Style Sheets
the margin-top css property sets the margin area on the top of an element.
... syntax /* <length> values */ margin-top: 10px; /* an absolute length */ margin-top: 1em; /* relative to the text size */ margin-top: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-top: auto; /* global values */ margin-top: inherit; margin-top: initial; margin-top: unset; the margin-top property is specified as the keyword auto, or a <length>, or a <percentage>.
...it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples setting positive and negative top margins .content { margin-top: 5%; } .sidebox { margin-top: 10px; } .logo { margin-top: -5px; } #footer { margin-top: 1em; } specifications specification status comment css basic box modelthe definition of 'margin-top' in that specification.
mask-repeat - CSS: Cascading Style Sheets
the mask-repeat css property sets how mask images are repeated.
...epeat: space; mask-repeat: round; mask-repeat: no-repeat; /* two-value syntax: horizontal | vertical */ mask-repeat: repeat space; mask-repeat: repeat repeat; mask-repeat: round space; mask-repeat: no-repeat round; /* multiple values */ mask-repeat: space round, no-repeat; mask-repeat: round repeat, space, repeat-x; /* global values */ mask-repeat: inherit; mask-repeat: initial; mask-repeat: unset; by default, the repeated images are clipped to the size of the element, but they can be scaled to fit (using round) or evenly distributed from end to end (using space).
... formal definition initial valueno-repeatapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueconsists of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting repeat for a single mask css #masked { width: 250px; height: 250px; background: blue linear-gradient(red, blue); mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-repeat: repeat; /* can be changed in the live sample */ margin-bottom: 10px; } html content <div id="masked"> </div> <select id="repetition"> <option value="repeat-x">repeat-x</option> <o...
min() - CSS: Cascading Style Sheets
WebCSSmin
the min() css function lets you set the smallest (most negative) value from a list of comma-separated expressions as the value of a css property value.
... formal syntax min( <calc-sum># )where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <dimension> | <percentage> | ( <calc-sum> ) accessibility concerns when using min() to set a maximum font size, ensure that the font can still be scaled at least 200% for readability (without assistive technology like a zoom function).
... mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 examples setting a maximum size for a label and input another use case for css functions is to set a maximum size on responsive form controls: enabling the width of labels and inputs to shrink as the width of the form shrinks.
opacity - CSS: Cascading Style Sheets
WebCSSopacity
the opacity css property sets the opacity of an element.
... webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal definition initial value1.0applies toall elementsinheritednocomputed valuethe specified value, clipped in the range [0,1]animation typea number formal syntax <alpha-value>where <alpha-value> = <number> | <percentage> examples setting background opacity html <div class="light">you can barely see this.</div> <div class="medium">this is easier to see.</div> <div class="heavy">this is very easy 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 definition of 'opacity' in that specification.
orphans - CSS: Cascading Style Sheets
WebCSSorphans
the orphans css property sets the minimum number of lines in a block container that must be shown at the bottom of a page, region, or column.
... /* <integer> values */ orphans: 2; orphans: 3; /* global values */ orphans: inherit; orphans: initial; orphans: unset; in typography, an orphan is the first line of a paragraph that appears alone at the bottom of a page.
... formal definition initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples setting a minimum orphan size of three lines html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containing some more text than the first one.
overflow-inline - CSS: Cascading Style Sheets
the overflow-inline css property sets what shows when content overflows the inline start and end edges of a box.
... syntax /* keyword values */ overflow-inline: visible; overflow-inline: hidden; overflow-inline: scroll; overflow-inline: auto; /* global values */ overflow-inline: inherit; overflow-inline: initial; overflow-inline: unset; the overflow-inline property is specified as a single keyword chosen from the list of values below.
... formal definition initial valueautoapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax visible | hidden | clip | scroll | auto examples setting inline overflow behavior html <ul> <li><code>overflow-inline:hidden</code> — hides the text outside the box <div id="div1"> abcdefghijklmopqrstuvwxyzabcdefghijklmopqrstuvwxyz </div> </li> <li><code>overflow-inline:scroll</code> — always adds a scrollbar <div id="div2"> abcdefghijklmopqrstuvwxyzabcdefghijklmopqrstuvwxyz </div> </li> <li><code>overf...
overflow-y - CSS: Cascading Style Sheets
the overflow-y css property sets what shows when content overflows a block-level element's top and bottom edges.
... syntax /* keyword values */ overflow-y: visible; overflow-y: hidden; overflow-y: clip; overflow-y: scroll; overflow-y: auto; /* global values */ overflow-y: inherit; overflow-y: initial; overflow-y: unset; the overflow-y property is specified as a single keyword chosen from the list of values below.
... formal definition initial valuevisibleapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete formal syntax visible | hidden | clip | scroll | auto examples setting overflow-y behavior html <ul> <li><code>overflow-y:hidden</code> — hides the text outside the box <div id="div1"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
overscroll-behavior-y - CSS: Cascading Style Sheets
the overscroll-behavior-y css property sets the browser's behavior when the vertical boundary of a scrolling area is reached.
... /* keyword values */ overscroll-behavior-y: auto; /* default */ overscroll-behavior-y: contain; overscroll-behavior-y: none; /* global values */ overscroll-behavior-y: inherit; overscroll-behavior-y: initial; overscroll-behavior-y: unset; initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax the overscroll-behavior-y property is specified as a keyword chosen from the list of values below.
... contain default scroll overflow behavior is observed inside the element this value is set on (e.g.
padding - CSS: Cascading Style Sheets
WebCSSpadding
the padding css shorthand property sets the padding area on all four sides of an element at once.
...property is a shorthand for the following css properties: padding-bottom padding-left padding-right padding-top syntax /* apply to all four sides */ padding: 1em; /* vertical | horizontal */ padding: 5% 10%; /* top | horizontal | bottom */ padding: 1em 2em 2em; /* top | right | bottom | left */ padding: 5px 1em 0 2em; /* global values */ padding: inherit; padding: initial; padding: unset; the padding property may be specified using one, two, three, or four values.
...ckcomputed valueas each of the properties of the shorthand:padding-bottom: the percentage as specified or the absolute lengthpadding-left: the percentage as specified or the absolute lengthpadding-right: the percentage as specified or the absolute lengthpadding-top: the percentage as specified or the absolute lengthanimation typea length formal syntax [ <length> | <percentage> ]{1,4} examples setting padding with pixels html <h4>this element has moderate padding.</h4> <h3>the padding is huge in this element!</h3> css h4 { background-color: lime; padding: 20px 50px; } h3 { background-color: cyan; padding: 110px 50px 50px 110px; } result setting padding with pixels and percentages padding: 5%; /* all sides: 5% padding */ padding: 10px; /* all...
page-break-after - CSS: Cascading Style Sheets
/* keyword values */ page-break-after: auto; page-break-after: always; page-break-after: avoid; page-break-after: left; page-break-after: right; page-break-after: recto; page-break-after: verso; /* global values */ page-break-after: inherit; page-break-after: initial; page-break-after: unset; this property applies to block elements that generate a box.
...a subset of values should be aliased as follows: page-break-after break-after auto auto left left right right avoid avoid always page formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element.
... user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { page-break-after: always; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification.
place-items - CSS: Cascading Style Sheets
if the second value is not set, the first value is also used for it.
...ce-items: self-start auto; place-items: self-end normal; place-items: flex-start auto; place-items: flex-end normal; place-items: left auto; place-items: right normal; /* baseline alignment */ place-items: baseline normal; place-items: first baseline auto; place-items: last baseline normal; place-items: stretch auto; /* global values */ place-items: inherit; place-items: initial; place-items: unset; values auto the value used is the value of the justify-items property of the parents box, unless the box has no parent, or is absolutely positioned, in these cases, auto represents normal.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
scroll-behavior - CSS: Cascading Style Sheets
the scroll-behavior css property sets the behavior for a scrolling box when scrolling is triggered by the navigation or cssom scrolling apis.
... syntax /* keyword values */ scroll-behavior: auto; scroll-behavior: smooth; /* global values */ scroll-behavior: inherit; scroll-behavior: initial; scroll-behavior: unset; the scroll-behavior property is specified as one of the keyword values listed below.
... formal definition initial valueautoapplies toscrolling boxesinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | smooth examples setting smooth scroll behavior html <nav> <a href="#page-1">1</a> <a href="#page-2">2</a> <a href="#page-3">3</a> </nav> <scroll-container> <scroll-page id="page-1">1</scroll-page> <scroll-page id="page-2">2</scroll-page> <scroll-page id="page-3">3</scroll-page> </scroll-container> css a { display: inline-block; width: 50px; text-decoration: none; } nav, scroll-container { dis...
scroll-padding-block-end - CSS: Cascading Style Sheets
the scroll-padding-block-end property defines offsets for the end edge in the block dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-block-end: auto; /* <length> values */ scroll-padding-block-end: 10px; scroll-padding-block-end: 1em; scroll-padding-block-end: 10%; /* global values */ scroll-padding-block-end: inherit; scroll-padding-block-end: initial; scroll-padding-block-end: unset; values <length-percentage> an inwards offset from the block end edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-block-start - CSS: Cascading Style Sheets
the scroll-padding-block-start property defines offsets for the start edge in the block dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-block-start: auto; /* <length> values */ scroll-padding-block-start: 10px; scroll-padding-block-start: 1em; scroll-padding-block-start: 10%; /* global values */ scroll-padding-block-start: inherit; scroll-padding-block-start: initial; scroll-padding-block-start: unset; values <length-percentage> an inwards offset from the block start edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-bottom - CSS: Cascading Style Sheets
the scroll-padding-bottom property defines offsets for the bottom of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-bottom: auto; /* <length> values */ scroll-padding-bottom: 10px; scroll-padding-bottom: 1em; scroll-padding-bottom: 10%; /* global values */ scroll-padding-bottom: inherit; scroll-padding-bottom: initial; scroll-padding-bottom: unset; values <length-percentage> an inwards offset from the bottom edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-inline-end - CSS: Cascading Style Sheets
the scroll-padding-inline-end property defines offsets for the end edge in the inline dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-inline-end: auto; /* <length> values */ scroll-padding-inline-end: 10px; scroll-padding-inline-end: 1em; scroll-padding-inline-end: 10%; /* global values */ scroll-padding-inline-end: inherit; scroll-padding-inline-end: initial; scroll-padding-inline-end: unset; values <length-percentage> an inwards offset from the inline end edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-inline-start - CSS: Cascading Style Sheets
the scroll-padding-inline-start property defines offsets for the start edge in the inline dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-inline-start: auto; /* <length> values */ scroll-padding-inline-start: 10px; scroll-padding-inline-start: 1em; scroll-padding-inline-start: 10%; /* global values */ scroll-padding-inline-start: inherit; scroll-padding-inline-start: initial; scroll-padding-inline-start: unset; values <length-percentage> an inwards offset from the inline start edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-left - CSS: Cascading Style Sheets
the scroll-padding-left property defines offsets for the left of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-left: auto; /* <length> values */ scroll-padding-left: 10px; scroll-padding-left: 1em; scroll-padding-left: 10%; /* global values */ scroll-padding-left: inherit; scroll-padding-left: initial; scroll-padding-left: unset; values <length-percentage> an inwards offset from the left edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-right - CSS: Cascading Style Sheets
the scroll-padding-right property defines offsets for the right of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-right: auto; /* <length> values */ scroll-padding-right: 10px; scroll-padding-right: 1em; scroll-padding-right: 10%; /* global values */ scroll-padding-right: inherit; scroll-padding-right: initial; scroll-padding-right: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-padding-top - CSS: Cascading Style Sheets
the scroll-padding-top property defines offsets for the top of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-top: auto; /* <length> values */ scroll-padding-top: 10px; scroll-padding-top: 1em; scroll-padding-top: 10%; /* global values */ scroll-padding-top: inherit; scroll-padding-top: initial; scroll-padding-top: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage.
... auto the offset is determind by the user agent.
scroll-snap-coordinate - CSS: Cascading Style Sheets
/* keyword value */ scroll-snap-coordinate: none; /* <position> values */ scroll-snap-coordinate: 50px 50px; /* single coordinate */ scroll-snap-coordinate: 100px 100px, 100px bottom; /* multiple coordinates */ /* global values */ scroll-snap-coordinate: inherit; scroll-snap-coordinate: initial; scroll-snap-coordinate: unset; if the element has been transformed, the snap coordinates are likewise transformed, thus aligning the snap points with the element as it is displayed.
... <position> specifies the offset of the snap coordinates from the start edge of the element’s border box.
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting scroll snap coordinates html <div id="container"> <div> <p>at coordinate (0, 0)</p> <div class="scrollcontainer coordinate0"> <div>1</div> <div>2</div> <div>3</div> </div> </div> <div> <p>at coordinate (25, 0)</p> <div class="scrollcontainer coordinate25"> <div>1</div> <div>2</div> <div>3</div> </div> </div> <div> <...
scroll-snap-type-x - CSS: Cascading Style Sheets
/* keyword values */ scroll-snap-type-x: none; scroll-snap-type-x: mandatory; scroll-snap-type-x: proximity; /* global values */ scroll-snap-type-x: inherit; scroll-snap-type-x: initial; scroll-snap-type-x: unset; syntax values none when the visual viewport of this scroll container is scrolled horizontally, it must ignore snap points.
...if content is added, moved, deleted or resized the scroll offset will be adjusted to maintain the resting on that snap point.
...if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point.
scroll-snap-type-y - CSS: Cascading Style Sheets
/* keyword values */ scroll-snap-type-y: none; scroll-snap-type-y: mandatory; scroll-snap-type-y: proximity; /* global values */ scroll-snap-type-y: inherit; scroll-snap-type-y: initial; scroll-snap-type-y: unset; syntax values none when the visual viewport of this scroll container is scrolled vertically, it must ignore snap points.
...if content is added, moved, deleted or resized the scroll offset will be adjusted to maintain the resting on that snap point.
...if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point.
scrollbar-color - CSS: Cascading Style Sheets
the scrollbar-color css property sets the color of the scrollbar track and thumb.
...*/ /* global values */ scrollbar-color: inherit; scrollbar-color: initial; scrollbar-color: unset; values <scrollbar-color> defines the color of the scrollbar.
... note: user agents must apply any scrollbar-color value set on the root element to the viewport.
shape-margin - CSS: Cascading Style Sheets
the shape-margin css property sets a margin for a css shape created using shape-outside.
... syntax /* <length> values */ shape-margin: 10px; shape-margin: 20mm; /* <percentage> value */ shape-margin: 60%; /* global values */ shape-margin: inherit; shape-margin: initial; shape-margin: unset; values <length-percentage> sets the margin of the shape to a <length> value or to a <percentage> of the width of the element's containing block.
...ngth, percentage or calc(); formal syntax <length-percentage>where <length-percentage> = <length> | <percentage> examples adding a margin to a polygon html <section> <div class="shape"></div> we are not quite sure of any one thing in biology; our knowledge of geology is relatively very slight, and the economic laws of society are uncertain to every one except some individual who attempts to set them forth; but before the world was fashioned the square on the hypotenuse was equal to the sum of the squares on the other two sides of a right triangle, and it will be so after this world is dead; and the inhabitant of mars, if he exists, probably knows its truth as we know it.</section> css section { max-width: 400px; } .shape { float: left; width: 150px; height: 150px; backgroun...
tab-size - CSS: Cascading Style Sheets
WebCSStab-size
syntax /* <integer> values */ tab-size: 4; tab-size: 0; /* <length> values */ tab-size: 10px; tab-size: 2em; /* global values */ tab-size: inherit; tab-size: initial; tab-size: unset; values <integer> a multiple of the advance width of the space character (u+0020) to be used as the width of tabs.
... formal definition initial value8applies toblock containersinheritedyescomputed valuethe specified integer or an absolute lengthanimation typea length formal syntax <integer> | <length> examples expanding by character count pre { tab-size: 4; /* set tab size to 4 characters wide */ } collapse tabs pre { tab-size: 0; /* remove indentation */ } comparing to the default size this example compares a default tab size with a custom tab size.
... note that white-space is set to pre to prevent the tabs from collapsing.
table-layout - CSS: Cascading Style Sheets
the table-layout css property sets the algorithm used to lay out <table> cells, rows, and columns.
... syntax /* keyword values */ table-layout: auto; table-layout: fixed; /* global values */ table-layout: inherit; table-layout: initial; table-layout: unset; values auto by default, most browsers use an automatic table layout algorithm.
... fixed table and column widths are set by the widths of table and col elements or by the width of the first row of cells.
text-align - CSS: Cascading Style Sheets
the text-align css property sets the horizontal alignment of a block element or table-cell box.
...xt-align: center; text-align: justify; text-align: justify-all; text-align: start; text-align: end; text-align: match-parent; /* character-based alignment in a table column */ text-align: "."; text-align: "." center; /* block alignment values (non-standard syntax) */ text-align: -moz-center; text-align: -webkit-center; /* global values */ text-align: inherit; text-align: initial; text-align: unset; the text-align property is specified in one of the following ways: using the keyword values start, end, left, right, center, justify, justify-all, or match-parent.
...</p> css .example { text-align: justify; border: solid; } result notes the standard-compatible way to center a block itself without centering its inline content is setting the left and right margin to auto, e.g.: .something { margin: auto; } .something { margin: 0 auto; } .something { margin-left: auto; margin-right: auto; } specifications specification status comment css logical properties and values level 1the definition of 'text-align' in that specification.
text-combine-upright - CSS: Cascading Style Sheets
the text-combine-upright css property sets the combination of characters into the space of a single character.
... values */ text-combine-upright: none; text-combine-upright: all; /* digits values */ text-combine-upright: digits; /* fits 2 consecutive digits horizontally inside vertical text */ text-combine-upright: digits 4; /* fits up to 4 consecutive digits horizontally inside vertical text */ /* global values */ text-combine-upright: inherit; text-combine-upright: initial; text-combine-upright: unset; syntax values none there is no special processing.
... all attempts to typeset all consecutive characters within the box horizontally, such that they take up the space of a single character within the vertical line of the box.
text-decoration-line - CSS: Cascading Style Sheets
the text-decoration-line css property sets the kind of decoration that is used on text in an element, such as an underline or overline.
... when setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead.
...text-decoration-line: overline; text-decoration-line: line-through; text-decoration-line: blink; /* multiple keywords */ text-decoration-line: underline overline; /* two decoration lines */ text-decoration-line: overline underline line-through; /* multiple decoration lines */ /* global values */ text-decoration-line: inherit; text-decoration-line: initial; text-decoration-line: unset; the text-decoration-line property is specified as none, or one or more space-separated values from the list below.
text-decoration-skip - CSS: Cascading Style Sheets
the text-decoration-skip css property sets what parts of an element’s content any text decoration affecting the element must skip over.
...-decoration-skip: objects; text-decoration-skip: spaces; text-decoration-skip: edges; text-decoration-skip: box-decoration; /* multiple keywords */ text-decoration-skip: objects spaces; text-decoration-skip: leading-spaces trailing-spaces; text-decoration-skip: objects edges box-decoration; /* global values */ text-decoration-skip: inherit; text-decoration-skip: initial; text-decoration-skip: unset; syntax values none nothing is skipped.
... edges the start and end of the text decoration is inset slightly (e.g., by half of the line thickness) from the content edge of the decorating box.
text-decoration-thickness - CSS: Cascading Style Sheets
the text-decoration-thickness css property sets the stroke thickness of the decoration line that is used on text in an element, such as a line-through, underline, or overline.
... syntax /* single keyword */ text-decoration-thickness: auto; text-decoration-thickness: from-font; /* length */ text-decoration-thickness: 0.1em; text-decoration-thickness: 3px; /* percentage */ text-decoration-thickness: 10%; /* global values */ text-decoration-thickness: inherit; text-decoration-thickness: initial; text-decoration-thickness: unset; values auto the browser chooses an appropriate width for the text decoration line.
...if the font file doesn't include this information, behave as if auto was set, with the browser choosing an appropriate thickness.
text-emphasis-color - CSS: Cascading Style Sheets
the text-emphasis-color css property sets the color of emphasis marks.
... this value can also be set using the text-emphasis shorthand.
... /* initial value */ text-emphasis-color: currentcolor; /* <color> */ text-emphasis-color: #555; text-emphasis-color: blue; text-emphasis-color: rgba(90, 200, 160, 0.8); text-emphasis-color: transparent; /* global values */ text-emphasis-color: inherit; text-emphasis-color: initial; text-emphasis-color: unset; syntax values <color> defines the color of the emphasis marks.
text-emphasis-style - CSS: Cascading Style Sheets
the text-emphasis-style css property sets the appearance of emphasis marks.
... it can also be set, and reset, using the text-emphasis shorthand.
...r rendered as 'f' only */ /* keyword values */ text-emphasis-style: filled; text-emphasis-style: open; text-emphasis-style: dot; text-emphasis-style: circle; text-emphasis-style: double-circle; text-emphasis-style: triangle; text-emphasis-style: filled sesame; text-emphasis-style: open sesame; /* global values */ text-emphasis-style: inherit; text-emphasis-style: initial; text-emphasis-style: unset; syntax values none no emphasis marks.
text-justify - CSS: Cascading Style Sheets
the text-justify css property sets what type of justification should be applied to text when text-align: justify; is set on an element.
...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.
...this is the default justification used if text-justify is not set at all.
transition-property - CSS: Cascading Style Sheets
the transition-property css property sets the css properties to which a transition effect should be applied.
... note: the set of properties that can be animated is subject to change.
...rty: all; /* <custom-ident> values */ transition-property: test_05; transition-property: -specific; transition-property: sliding-vertically; /* multiple values */ transition-property: test1, animation4; transition-property: all, height, color; transition-property: all, -moz-specific, sliding; /* global values */ transition-property: inherit; transition-property: initial; transition-property: unset; values none no properties will transition.
visibility - CSS: Cascading Style Sheets
to both hide an element and remove it from the document layout, set the display property to none instead of using visibility.
... syntax /* keyword values */ visibility: visible; visibility: hidden; visibility: collapse; /* global values */ visibility: inherit; visibility: initial; visibility: unset; the visibility property is specified as one of the keyword values listed below.
...descendants of the element will be visible if they have visibility set to visible.
white-space - CSS: Cascading Style Sheets
the white-space css property sets how white space inside an element is handled.
... syntax /* keyword values */ white-space: normal; white-space: nowrap; white-space: pre; white-space: pre-wrap; white-space: pre-line; white-space: break-spaces; /* global values */ white-space: inherit; white-space: initial; white-space: unset; the white-space property is specified as a single keyword chosen from the list of values below.
...); font-size: 16px; font-family: monospace; } #css-code select { font-family: inherit; } #results { background-color: rgb(230, 230, 230); overflow-x: scroll; height: 400px; white-space: normal; font-size: 14px; } var select = document.queryselector("#css-code select"); var results = document.queryselector("#results p"); select.addeventlistener("change", function(e) { results.setattribute("style", "white-space: "+e.target.value); }) <p> lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
zoom - CSS: Cascading Style Sheets
WebCSSzoom
/* keyword values */ zoom: normal; zoom: reset; /* <percentage> values */ zoom: 50%; zoom: 200%; /* <number> values */ zoom: 1.1; zoom: 0.7; /* global values */ zoom: inherit; zoom: initial; zoom: unset; syntax values normal render this element at its normal size.
... reset do not (de)magnify this element if the user applies non-pinch-based zooming (e.g.
... formal definition initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typean integer formal syntax normal | reset | <number> | <percentage> examples first example html <p class="small">small</p> <p class="normal">normal</p> <p class="big">big</p> css p.small { zoom: 75%; } p.normal { zoom: normal; } p.big { zoom: 2.5; } p { display: inline-block; } p:hover { zoom: reset; } result second example html <div id="a" class="circle"></div> <div id="b" class="circle"></div> <div id="c" class="...
math:max() - EXSLT
WebEXSLTmathmax
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:max() returns the maximum value of a node-set.
... to compute the maximum value of the node-set, the node set is sorted into descending order as it would be using xsl:sort() with a data type of number.
... syntax math:max(nodeset) parameters nodeset the node-set whose highest value is to be returned.
math:min() - EXSLT
WebEXSLTmathmin
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:min() returns the minimum value of a node-set.
... to compute the minimum value of the node-set, the node set is sorted into ascending order as it would be using xsl:sort() with a data type of number.
... note: syntax math:min(nodeset) parameters nodeset the node-set whose lowest value is to be returned.
str:split() - EXSLT
WebEXSLTstrsplit
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:split() splits a string using a pattern string to determine where the splits should occur, returning a node-set containing the resulting strings.
... returns a node-set of token elements, each containing one token from the string.
... example str:split('book, phone, computer, chair', ', ') returns a node set like: <token>book</token> <token>phone</token> <token>computer</token> <token>chair</token> specifications exslt - str:split ...
str:tokenize() - EXSLT
WebEXSLTstrtokenize
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes str:tokenize() splits a string using a set of characters as delimiters that determine where the splits should occur, returning a node-set containing the resulting strings.
... returns a node-set of token elements, each containing one token from the string.
... example: str:tokenize('2007-09-14-03t11:40:23', '-t:') returns a node set like this: <token>2007</token> <token>09</token> <token>14</token> <token>11</token> <token>40</token> <token>23</token> specifications exslt - str:tokenize ...
WAI ARIA Live Regions/API Support - Developer guides
new accessible object) object replaced with different object (this happens especially if an object's interfaces or role changes) children_changed::remove followed immediately by children_change::add event_object_hide followed immediately by event_object_show text removed text_changed::delete ia2_event_text_removed (use iaccessibletext::get_oldtext to retrieve the offsets and removed text) text inserted text_changed::insert ia2_event_text_inserted (use iaccessibletext::get_newtext to retrieve the offsets and inserted text) text replaced text_changed::delete followed immediately by text_changed::insert ia2_event_text_removed followed immediately by ia2_event_text_inserted * we do not use msaa's create/destroy at the request of s...
...at this time, for properties where the container-[name] attribute has not been set, the at must have code to fall back on the default value as defined in the w3c spec.
...in iaccessible2, this is retrieved from the object attribute "event-from-input", which will be set to "true" or "false".
Media events - Developer guides
note: manually setting the currenttime will eventually fire a canplaythrough event in firefox.
... volumechange sent when the audio volume changes (both when the volume is set and when the muted attribute is changed).
... then, in line 3, the example sets the element's currenttime attribute to 10.0, which initiates a seek operation to the 10-second mark in the media.
Introduction to HTML5 - Developer guides
declaring the character set with the <meta charset> the first thing done on a page is usually indicating the character set that is used.
...now, it is very simple: <meta charset="utf-8"> place this right after your <head>, as some browsers restart the parsing of an html document if the declared character set is different from what they had anticipated.
... note that html5 restricts character sets to those compatible with ascii and using at least 8 bits.
Printing - Developer guides
open and automatically close a popup window when finished if you want to be able to automatically close a popup window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>javascript window close example </title> <script type="text/javascript"> function popuponclick() { my_window = window.open('', 'mywindow', 'status=1,width=350,height=150'); my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body onafterprint="self.close()">'); my_window.document.write('<p>when you print...
...the following is a possible example which will print a file named externalpage.html: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>mdn example</title> <script type="text/javascript"> function closeprint () { document.body.removechild(this.__container__); } function setprint () { this.contentwindow.__container__ = this; this.contentwindow.onbeforeunload = closeprint; this.contentwindow.onafterprint = closeprint; this.contentwindow.focus(); // required for ie this.contentwindow.print(); } functio...
...n printpage (surl) { var ohiddframe = document.createelement("iframe"); ohiddframe.onload = setprint; ohiddframe.style.position = "fixed"; ohiddframe.style.right = "0"; ohiddframe.style.bottom = "0"; ohiddframe.style.width = "0"; ohiddframe.style.height = "0"; ohiddframe.style.border = "0"; ohiddframe.src = surl; document.body.appendchild(ohiddframe); } </script> </head> <body> <p><span onclick="printpage('externalpage.html');" style="cursor:pointer;text-decoration:underline;color:#0000ff;">print external page!</span></p> </body> </html> note: older versions of internet explorer cannot print the contents of a hidden <iframe>.
The Unicode Bidirectional Text Algorithm - Developer guides
there are two sets of control characters; one set opens the override, and another restores the original directionality.
... initial unicode bidi algorithm control characters character code point html entity markup equivalent description left-to-right isolate (lri) u+2066 &#x2066; dir="ltr" sets the base direction to ltr, isolating the embedded content from the surrounding text right-to-left isolate (lri) u+2067 &#x2067; dir="rtl" sets the base direction to rtl, isolating the embedded content from the surrounding text first strong isolate (fsi) u+2068 &#x2068; dir="auto" isolates the content and sets the base direction according to the first strongly-typed directional character in the embedded content left-to-right embedding (lre) ...
... u+202a &#x202a; dir="ltr" sets the base direction to ltr but allows the embedded text to interact with the surrounding content; this risks the effect spilling over to the outer content right-to-left embedding (rle) u+202b &#x202b; dir="rtl" sets the base direction to rtl, but lets the embedded text interact with the surrounding content, risking spillover effects left-to-right override (lro) u+202d &#x202d; <bdo dir="ltr"> overrides the bidi algorithm, displaying the characters in memory order, from left to right right-to-left override (rlo) u+202e &#x202e; <bdo dir="rtl"> overrides the bidi algorithm and displays the embedded characters in reverse memory order, from right to left closing unicode bidi algorithm c...
Developer guides
this set of guides tells you all you need to know about pwas.
... using formdata objects the formdata object lets you compile a set of key/value pairs to send using xmlhttprequest.
...the transmission is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to "multipart/form-data".
The HTML autocomplete attribute - HTML: Hypertext Markup Language
note: in most modern browsers, setting autocomplete to "off" will not prevent a password manager from asking the user if they would like to save username and password information, or from automatically filling in those values in a site's login form.
...setting the value of the autocomplete attribute to off disables this feature.
... form layout flexibility given that different countries write their address in different ways, with each field in different places within the address, and even different sets and numbers of fields entirely, it can be helpful if, when possible, your site is able to switch to the layout expected by your users when presenting an address entry form, given the country the address is located within.
HTML attribute: min - HTML: Hypertext Markup Language
WebHTMLAttributesmin
syntax if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified.
...for 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as <input type="number" min="-5.2"> syntax for min values by input type input type example example date yyyy-mm-dd <input type="date" min="2019-12-25" step="1"> month yyyy-mm <input type="month" min="2019-12" step="12"> week yyyy-w## <input type="week" min="2019-w23" step=""> time hh:mm <input type="time" min="09:00" step="900"> datetime-local yy...
...yy-mm-ddthh:mm <input type="datetime-local" min="2019-12-25t19:30"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the min value set, the value is considered invalid in contraint validation and will match the :invalid pseudoclass see client-side validation and rangeunderflow for more information.
HTML attribute: pattern - HTML: Hypertext Markup Language
if a non-null value doesn't conform to the constraints set by the pattern value, the validitystate object's read-only patternmismatch property will be true.
... the pattern's regular expression, when matched against the value, must have its start anchored to the start of the string and its end anchored to the end of the string, which is slightly different from javascript regular expressions: in the case of pattern attribute, we are matching against the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end.
...###" aria-label="3-digit prefix" size="2"/> - <input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-label="4-digit number" size="3"/> </label> </p> here we have 3 sections for a north american phone number with an implicit label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each.
HTML attribute: readonly - HTML: Hypertext Markup Language
conversely, inputs that support the readonly attribute but don't have the attribute set match the :read-write pseudo-class.
.../> <label>date</label> </div> <div class="group"> <input type="email" value="some value" readonly="readonly"/> <label>email</label> </div> <div class="group"> <input type="password" value="some value" readonly="readonly"/> <label>password</label> </div> <div class="group"> <textarea readonly="readonly">some value</textarea> <label>message</label> </div> result examples <fieldset> <legend>checkboxes buttons</legend> <p><label> <input type="checkbox" name="chbox" value="regular"> regular </label></p> <p><label> <input type="checkbox" name="chbox" value="readonly" readonly> readonly </label></p> <p><label> <input type="checkbox" name="chbox" value="disabled" disabled> disabled </label></p> </fieldset> <fieldset> <legend>radio buttons</legend> <...
...p><label> <input type="radio" name="radio" value="regular"> regular </label></p> <p><label> <input type="radio" name="radio" value="readonly" readonly> readonly </label></p> <p><label> <input type="radio" name="radio" value="disabled" disabled> disabled </label></p> </fieldset> specifications specification status comment html living standardthe definition of 'readonly attribute' in that specification.
HTML attribute: step - HTML: Hypertext Markup Language
WebHTMLAttributesstep
the step sets the stepping interval when clicking up and down spinner buttons, moving a slider left and right on a range, and validating the different date types.
...put type="week" min="2019-w23" step="2"> time 60 (seconds) <input type="time" min="09:00" step="900"> datetime-local 1 (day) <input type="datetime-local" min="019-12-25t19:30" step="7"> number 1 <input type="number" min="0" step="0.1" max="10"> range 1 <input type="range" min="0" step="2" max="10"> if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified.
...for 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as <input type="number" min="-5.2"> min impact on step the value of min and step define what are valid values, even if the step attribute is not included, as step defaults to 0.
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
create the manifest file: ffmpeg \ -f webm_dash_manifest -i video_160x90_250k.webm \ -f webm_dash_manifest -i video_320x180_500k.webm \ -f webm_dash_manifest -i video_640x360_750k.webm \ -f webm_dash_manifest -i video_1280x720_1500k.webm \ -f webm_dash_manifest -i my_audio.webm \ -c copy \ -map 0 -map 1 -map 2 -map 3 -map 4 \ -f webm_dash_manifest \ -adaptation_sets "id=0,streams=0,1,2,3 id=1,streams=4" \ my_video_manifest.mpd the -map arguments correspond to the input files in the sequence they are given; you should have one for each file.
... the -adaptation_sets argument assigns them into adaptation sets; for example, this creates one set (0) that contains the streams 0, 1, 2 and 3 (the videos), and another set (1) that contains only stream 4, the audio stream.
...dash works via http, so as long as your http server supports byte range requests, and it's set up to serve .mpd files with mimetype="application/dash+xml", then you're all set.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
coords a set of values specifying the coordinates of the hot-spot region.
... poly or polygon: the value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on.
...firefox 79+) setting target="_blank" on <area> elements implicitly provides the same rel behavior as setting rel="noopener".
<basefont> - HTML: Hypertext Markup Language
WebHTMLElementbasefont
the obsolete html base font element (<basefont>) sets a default font face, size, and color for the other elements which are descended from its parent element.
... with this set, the font's size can then be varied relative to the base size using the <font> element.
... color this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb format.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
when the open attribute is not set, the dialog shouldn't be shown to the user.
...when such a form is submitted, the dialog closes with its returnvalue property set to the value of the button that was used to submit the form.
...ectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] favdialog.addeventlistener('close', function onclose() { outputbox.value = favdialog.returnvalue + " button clicked - " + (new date()).tostring(); }); result specifications ...
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
accept-charset space-separated character encodings the server accepts.
...if this attribute is not set (and therefore the form is validated), it can be overridden by a formnovalidate attribute on a <button>, <input type="submit">, or <input type="image"> element belonging to the form.
...!-- form which will send a get request to the current url --> <form> <label>name: <input name="submitted-name" autocomplete="name"> </label> <button>save</button> </form> <!-- form which will send a post request to the current url --> <form method="post"> <label>name: <input name="submitted-name" autocomplete="name"> </label> <button>save</button> </form> <!-- form with fieldset, legend, and label --> <form method="post"> <fieldset> <legend>title</legend> <label><input type="radio" name="radio"> select me</label> </fieldset> </form> specifications specification status comment html living standardthe definition of '<form>' in that specification.
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
additional attributes in addition to the attributes common to all <input> elements, hidden inputs offer the following attributes: attribute description name like all input types, the name of the input to report when submitting the form; the special value _charset_ causes the hidden input's value to be reported as the character encoding used to submit the form name this is actually one of the common attributes, but it has a special meaning available for hidden inputs.
...however, when the form is submitted, a hidden input whose name is set to _charset_ will automatically be reported with the value set to the character encoding used to submit the form.
...id" value="34657"> </form> let's also add some simple css: html { font-family: sans-serif; } form { width: 500px; } div { display: flex; margin-bottom: 10px; } label { flex: 2; line-height: 2; text-align: right; padding-right: 20px; } input, textarea { flex: 7; font-family: sans-serif; font-size: 1.1rem; padding: 5px; } textarea { height: 60px; } the server would set the value of the hidden input with the id "postid" to the id of the post in its database before sending the form to the user's browser and would use that information when the form is returned to know which database record to update with modified information.
<option>: The HTML Option element - HTML: Hypertext Markup Language
WebHTMLElementoption
disabled if this boolean attribute is set, this option is not checkable.
...if this attribute is not set, the element can still be disabled if one of its ancestors is a disabled <optgroup> element.
...if the <option> element is the descendant of a <select> element whose multiple attribute is not set, only one single <option> of this <select> element may have the selected attribute.
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
if this attribute is not specified, the control inherits its setting from the containing element, for example <fieldset>; if there is no containing element with the disabled attribute set, then the control is enabled.
...(if this attribute is not set, the <select> is associated with its ancestor <form> element, if any.) this attribute lets you associate <select> elements to <form>s anywhere in the document, not just inside a <form>.
... technical summary content categories flow content, phrasing content, interactive content, listed, labelable, resettable, and submittable form-associated element permitted content zero or more <option> or <optgroup> elements.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
<p>enter the following at the telnet command prompt: <code>set localecho</code><br /> the telnet client should display: <tt>local echo is on</tt></p> result overriding the default font you can override the browser's default font—if the browser permits you to do so, which it isn't required to do—using css: css tt { font-family: "lucida console", "menlo", "monaco", "courier", monospace; } html <p>enter the following at the telne...
...t command prompt: <code>set localecho</code><br /> the telnet client should display: <tt>local echo is on</tt></p> result usage notes the <tt> element is, by default, rendered using the browser's default non-proportional font.
... user-configured changes to the default monospace font setting may take precedence over your css.
itemtype - HTML: Hypertext Markup Language
itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active.
...this vocabulary defines a standard set of type names and property names.
... note: more about itemtype attributes can be found at http://schema.org/thing the itemtype attribute must have a value that is an unordered set of unique tokens which are case-sensitive, each is a valid and absolute url, and all defined to use the same vocabulary.
lang - HTML: Hypertext Markup Language
if the attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according to bcp47, it is set to invalid.
... even if the lang attribute is set, it may not be taken into account, as the xml:lang attribute has priority.
... recommendation supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>.
Reason: expected ‘true’ in CORS header ‘Access-Control-Allow-Credentials’ - HTTP
the cors request requires that the server permit the use of credentials, but the server's access-control-allow-credentials header's value isn't set to true to enable their use.
... if the request is being issued using xmlhttprequest, make sure you're not setting withcredentials to true.
... to eliminate this error by changing the server's configuration, adjust the server's configuration to set the access-control-allow-credentials header's value to true.
CORS errors - HTTP
WebHTTPCORSErrors
setting up such a cors configuration isn't necessarily easy and may present some challenges.
... if the cors configuration isn't setup correctly, the browser console will present an error like "cross-origin request blocked: the same origin policy disallows reading the remote resource at $somesite" indicating that the request was blocked due to violating the cors security rules.
... this might not necessarily be a set-up mistake, though.
Content Security Policy (CSP) - HTTP
WebHTTPCSP
example 1 a web site administrator wants all content to come from the site's own origin (this excludes subdomains.) content-security-policy: default-src 'self' example 2 a web site administrator wants to allow content from a trusted domain and all its subdomains (it doesn't have to be the same domain that the csp is set on.) content-security-policy: default-src 'self' *.trusted.com example 3 a web site administrator wants to allow users of a web application to include images from any origin in their own content, but to restrict audio or video media to trusted providers, and all scripts only to a specific server that hosts trusted code.
... content-security-policy: default-src 'self' *.mailsite.com; img-src * note that this example doesn't specify a script-src; with the example csp, this site uses the setting specified by the default-src directive, which means that scripts can be loaded only from the originating server.
...to enable violation reporting, you need to specify the report-uri policy directive, providing at least one uri to which to deliver the reports: content-security-policy: default-src 'self'; report-uri http://reportcollector.example.com/collector.cgi then you need to set up your server to receive the reports; it can store or process them in whatever manner you determine is appropriate.
HTTP conditional requests - HTTP
the different behaviors are defined by the method of the request used, and by the set of headers used for a precondition: for safe methods, like get, which usually tries to fetch a document, the conditional request can be used to send back the document, if relevant only.
... besides the setting of the validators on the server side, this mechanism is transparent: all browsers manage a cache and send such conditional requests without any special work to be done by web developers.
...for caching or resuming downloads, the only work required for webmasters is to configure the server correctly; setting correct etags in some environments can be tricky.
Feature Policy - HTTP
with feature policy, you opt-in to a set of "policies" for the browser to enforce on specific features used throughout a website.
... writing a policy a policy is described using a set of individual policy directives.
... the current set of policy-controlled features fall into two broad categories: enforcing best practices for good user experiences.
Content-Disposition - HTTP
the content-disposition header is defined in the larger context of mime messages for e-mail, but only a subset of the possible parameters apply to http forms and post requests.
... a name with a value of '_charset_' indicates that the part is not an html field, but the default charset to use for parts without explicit charset information.
... examples a response triggering the "save as" dialog: 200 ok content-type: text/html; charset=utf-8 content-disposition: attachment; filename="cool.html" content-length: 21 <html>save me!</html> this simple html file will be saved as a regular download rather than displayed in the browser.
CSP: block-all-mixed-content - HTTP
the http content-security-policy (csp) block-all-mixed-content directive prevents loading any assets over http when the page uses https.
...if the former is set, the latter does nothing, so set one directive or the other – not both, unless you want to force https on older browsers that do not force it after a redirect to http.
... syntax content-security-policy: block-all-mixed-content; examples content-security-policy: block-all-mixed-content; <meta http-equiv="content-security-policy" content="block-all-mixed-content"> to disallow http assets on a more granular level, you can also set individual directives to https:.
Referrer-Policy - HTTP
carefully consider the impact of this setting.
... integration with html you can also set referrer policies inside html.
... 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.
WWW-Authenticate - HTTP
header type response header forbidden header name no syntax www-authenticate: <type> realm=<realm>[, charset="utf-8"] directives <type> authentication type.
... charset=<charset> tells the client the server's prefered encoding scheme when submitting a username and password.
... examples typically, a server response contains a www-authenticate header that looks like these: www-authenticate: basic www-authenticate: basic realm="access to the staging site", charset="utf-8" see also http authentication for examples on how to configure apache or nginx servers to password protect your site with http basic authentication.
X-DNS-Prefetch-Control - HTTP
on firefox, this can be done by setting the network.dns.disableprefetch preference to true.
...on firefox, this can be changed by setting the network.dns.disableprefetchfromhttps preference to false.
... examples turning on and off prefetching you can either send the x-dns-prefetch-control header server-side, or from individual documents, using the http-equiv attribute on the <meta> element, like this: <meta http-equiv="x-dns-prefetch-control" content="off"> you can reverse this setting by setting content to "on".
HTTP Messages - HTTP
WebHTTPMessages
an optional set of http headers specifying the request, or describing the body included in the message.
...it is only used with connect when setting up an http tunnel.
... single-resource bodies, consisting of a single file of unknown length, encoded by chunks with transfer-encoding set to chunked.
Indexed collections - JavaScript
the array's length property is set to the number of arguments.
... let arr = array(42) // creates an array with no elements // and arr.length set to 42.
...a view provides a context — that is, a data type, starting offset, and number of elements — that turns the data into an actual typed array.
Iterators and generators - JavaScript
mbol.iterator] = function* () { yield 2; yield 1; }; user-defined iterables you can make your own iterables like this: const myiterable = { *[symbol.iterator]() { yield 1; yield 2; yield 3; } } for (let value of myiterable) { console.log(value); } // 1 // 2 // 3 or [...myiterable]; // [1, 2, 3] built-in iterables string, array, typedarray, map and set are all built-in iterables, because their prototype objects all have a symbol.iterator method.
... for (let value of ['a', 'b', 'c']) { console.log(value); } // "a" // "b" // "c" [...'abc']; // ["a", "b", "c"] function* gen() { yield* ['a', 'b', 'c']; } gen().next(); // { value: "a", done: false } [a, b, c] = new set(['a', 'b', 'c']); a; // "a" advanced generators generators compute their yielded values on demand, which allows them to efficiently represent sequences that are expensive to compute (or even infinite sequences, as demonstrated above).
... here is the fibonacci generator using next(x) to restart the sequence: function* fibonacci() { let current = 0; let next = 1; while (true) { let reset = yield current; [current, next] = [next, next + current]; if (reset) { current = 0; next = 1; } } } const sequence = fibonacci(); console.log(sequence.next().value); // 0 console.log(sequence.next().value); // 1 console.log(sequence.next().value); // 1 console.log(sequence.next().value); // 2 console.log(sequence.next().value); // 3 console.log(sequ...
Character classes - JavaScript
inside a character set, the dot loses its special meaning and matches a literal dot.
...so to match a pattern across multiple lines, the character set [^] can be used — it will match any character including newlines.
... \u{hhhh} or \u{hhhhh} (only when the u flag is set.) matches the character with the unicode value u+hhhh or u+hhhhh (hexadecimal digits).
Unicode property escapes - JavaScript
note: as there are many properties and values available, we will not describe them exhaustively here but rather provide various examples rationale before es2018 there was no performance-efficient way to match characters from different sets based on scripts (like macedonian, greek, georgian etc.) or propertyname (like emoji etc) in javascript.
...the script and script_extensions unicode properties allow regular expression to match characters according to the script they are mainly used with (script) or according to the set of scripts they belong to (script_extensions).
... if a character is used in a limited set of scripts, the script property will only match for the "predominant" used script.
Public class fields - JavaScript
class baseclass { msg = 'hello world' basepublicmethod() { return this.msg } } class subclass extends baseclass { subpublicmethod() { return super.basepublicmethod() } } const instance = new subclass() console.log(instance.subpublicmethod()) // expected output: "hello worl​d" getters and setters are special methods that bind to a class property and are called when that property is accessed or set.
... use the get and set syntax to declare a public instance getter or setter.
... class classwithgetset { #msg = 'hello world' get msg() { return this.#msg } set msg(x) { this.#msg = `hello ${x}` } } const instance = new classwithgetset() console.log(instance.msg) // expected output: "hello worl​d" instance.msg = 'cake' console.log(instance.msg) // expected output: "hello cake" specifications specification public and private instance fieldsthe definition of 'fielddefinition' in that specification.
TypeError: X.prototype.y called on incompatible type - JavaScript
message typeerror: 'this' is not a set object (edge) typeerror: function.prototype.tostring called on incompatible object (firefox) typeerror: function.prototype.bind called on incompatible target (firefox) typeerror: method set.prototype.add called on incompatible receiver undefined (chrome) typeerror: bind must be called on a function (chrome) error type typeerror what went wrong?
... examples invalid cases var myset = new set; ['bar', 'baz'].foreach(myset.add); // myset.add is a function, but "myset" is not captured as this.
... valid cases var myset = new set; ['bar', 'baz'].foreach(myset.add.bind(myset)); // this works due to binding "myset" as this.
TypeError: "x" is not a non-null object - JavaScript
message typeerror: invalid descriptor for property {x} (edge) typeerror: "x" is not a non-null object (firefox) typeerror: property description must be an object: "x" (chrome) typeerror: invalid value used in weak set (chrome) error type typeerror what went wrong?
...providing no object (like just a number), will throw an error: object.defineproperty({}, 'key', 1); // typeerror: 1 is not a non-null object object.defineproperty({}, 'key', null); // typeerror: null is not a non-null object a valid property descriptor object might look like this: object.defineproperty({}, 'key', { value: 'foo', writable: false }); weakmap and weakset objects require object keys weakmap and weakset objects store object keys.
... var ws = new weakset(); ws.add('foo'); // typeerror: "foo" is not a non-null object use objects instead: ws.add({foo: 'bar'}); ws.add(window); ...
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.
... note the following when working with the get syntax: it can have an identifier which is either a number or a string; it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden).
... class example { get hello() { return 'world'; } } const obj = new example(); console.log(obj.hello); // "world" console.log(object.getownpropertydescriptor(obj, 'hello')); // undefined console.log( object.getownpropertydescriptor( object.getprototypeof(obj), 'hello' ) ); // { configurable: true, enumerable: false, get: function get hello() { return 'world'; }, set: undefined } specifications specification ecmascript (ecma-262)the definition of 'method definitions' in that specification.
Array.from() - JavaScript
description array.from() lets you create arrays from: array-like objects (objects with a length property and indexed elements); or iterable objects (objects such as map and set).
...1 : -1) * math.floor(math.abs(number)); }; var maxsafeinteger = math.pow(2, 53) - 1; var tolength = function (value) { var len = tointeger(value); return math.min(math.max(len, 0), maxsafeinteger); }; var setgetitemhandler = function setgetitemhandler(isiterator, items) { var iterator = isiterator && items[symboliterator](); return function getitem(k) { return isiterator ?
...object(new c(len)) : new array(len); return getarray( t, a, len, setgetitemhandler(isiterator, items), isiterator, mapfn ); }; })(); } examples array from a string array.from('foo'); // [ "f", "o", "o" ] array from a set const set = new set(['foo', 'bar', 'baz', 'foo']); array.from(set); // [ "foo", "bar", "baz" ] array from a map const map = new map([[1, 2], [2, 4], [4, 8]]); array.from(map); // [[1, ...
BigInt64Array() constructor - JavaScript
syntax new bigint64array(); new bigint64array(length); new bigint64array(typedarray); new bigint64array(object); new bigint64array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
BigUint64Array() constructor - JavaScript
syntax new biguint64array(); new biguint64array(length); new biguint64array(typedarray); new biguint64array(object); new biguint64array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
DataView.prototype.byteLength - JavaScript
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
...if the dataview is not specifying an offset or a bytelength, the bytelength of the referenced arraybuffer or sharedarraybuffer will be returned.
... examples using the bytelength property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.bytelength; // 8 (matches the bytelength of the buffer) var dataview2 = new dataview(buffer, 1, 5); dataview2.bytelength; // 5 (as specified when constructing the dataview) var dataview3 = new dataview(buffer, 2); dataview3.bytelength; // 6 (due to the offset of the constructed dataview) specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.bytelength' in that specification.
Error.prototype.stack - JavaScript
different browsers set this value at different times.
... for example, firefox sets it when creating an error object, while phantomjs sets it only when throwing the error, and archived msdn docs also seem to match the phantomjs implementation.
... <!doctype html> <meta charset="utf-8"> <title>stack trace example</title> <body> <script> function trace() { try { throw new error('myerror'); } catch(e) { alert(e.stack); } } function b() { trace(); } function a() { b(3, 4, '\n\n', undefined, {}); } a('first call, firstarg'); </script> assuming the above markup is saved as c:\example.html on a windows file system it produces an alert message box with the following text: starting with firefox 30 and later containing the column number: trace@file:///c:/example.html:9:17 b@file:///c:/example.html:16:13 a@file:///c:/example.html:19:13 @file:///c:/example.html:21:9 firefox 14 to firefox 29: trace@file:///c:/example.ht...
Float32Array() constructor - JavaScript
syntax new float32array(); // new in es2017 new float32array(length); new float32array(typedarray); new float32array(object); new float32array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Float64Array() constructor - JavaScript
syntax new float64array(); // new in es2017 new float64array(length); new float64array(typedarray); new float64array(object); new float64array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Function.name - JavaScript
function foo() {}; foo.bind({}).name; // "bound foo" function names for getters and setters when using get and set accessor properties, "get" or "set" will appear in the function name.
... let o = { get foo(){}, set foo(x){} }; var descriptor = object.getownpropertydescriptor(o, "foo"); descriptor.get.name; // "get foo" descriptor.set.name; // "set foo"; function names in classes you can use obj.constructor.name to check the "class" of an object (but be sure to read the warnings below): function foo() {} // es2015 syntax: class foo {} var fooinstance = new foo(); console.log(fooinstance.constructor.name); // logs "foo" warning: the script interpreter will set the built-in function.name property only if a function does not have an own property called name (see section 9.2.11 of the ecmascript2015 language specification).
... however, es2015 specifies the static keyword such that static methods will be set as ownproperty of the class constructor function (ecmascript2015, 14.5.14.21.b + 12.2.6.9).
Function - JavaScript
instance methods function.prototype.apply(thisarg [, argsarray]) calls a function and sets its this to the provided thisarg.
... function.prototype.bind(thisarg[, arg1[, arg2[, ...argn]]]) creates a new function which, when called, has its this set to the provided thisarg.
... function.prototype.call(thisarg[, arg1, arg2, ...argn]) calls a function and sets its this to the provided value.
Int16Array() constructor - JavaScript
syntax new int16array(); // new in es2017 new int16array(length); new int16array(typedarray); new int16array(object); new int16array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Int32Array() constructor - JavaScript
syntax new int32array(); // new in es2017 new int32array(length); new int32array(typedarray); new int32array(object); new int32array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Int8Array() constructor - JavaScript
syntax new int8array(); // new in es2017 new int8array(length); new int8array(typedarray); new int8array(object); new int8array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Intl.Locale.prototype.caseFirst - JavaScript
examples setting the casefirst value via the locale string in the unicode locale string spec, the values that casefirst represents correspond to the key kf.
... let casefirststr = new intl.locale("fr-latn-fr-u-kf-upper"); console.log(casefirststr.casefirst); // prints "upper" setting the casefirst value via the configuration object argument the intl.locale constructor has an optional configuration object argument, which can be used to pass extension types.
... set the casefirst property of the configuration object to your desired casefirst value, and then pass it into the constructor.
Intl.Locale.prototype.collation - JavaScript
valid collation types collation type description big5han pinyin ordering for latin, big5 charset ordering for cjk characters (used in chinese) compat a previous version of the ordering, for compatibility dict dictionary style ordering (such as in sinhala) the direct collation type has been deprected.
... direct binary code point order (used in hindi) ducet the default unicode collation element table order emoji recommended ordering for emoji characters eor european ordering rules gb2312 pinyin ordering for latin, gb2312han charset ordering for cjk characters (used in chinese) phonebk phonebook style ordering (such as in german) phonetic phonetic ordering (sorting based on pronunciation) pinyin pinyin ordering for latin and for cjk characters (used in chinese) reformed reformed ordering (such as in swedish) search special collation type for string search searchjl special collation type for korean initial consonant search standard defa...
...set the collation property of the configuration object to your desired collation type, and then pass it into the constructor.
Intl.Locale.prototype.script - JavaScript
it indicates the set of symbols, or glyphs, that are used to write a particular language.
... examples setting the script in the locale identifer string argument the script is the second part of a valid unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor.
... let scriptstr = new intl.locale("en-latn-us"); console.log(scriptstr.script); // prints "latn" setting the script via the configuration object the locale constructor takes a configuration object, which can be used to set the script subtag and property.
Object.prototype.constructor - JavaScript
*/ } createdconstructor.prototype = object.create(parent.prototype) createdconstructor.prototype.constructor = createdconstructor // sets the correct constructor for future use createdconstructor.prototype.create = function create() { return new this.constructor() } new createdconstructor().create().create() // it's pretty fine ok, now it's pretty clear why changing the constructor can be useful.
... parentwithstatic.startposition = { x: 0, y:0 } // static member property parentwithstatic.getstartposition = function getstartposition() { return this.startposition } function child(x, y) { this.position = { x: x, y: y } } child = object.assign(parentwithstatic) child.prototype = object.create(parentwithstatic.prototype) child.prototype.constructor = child child.prototype.getoffsetbyinitialposition = function getoffsetbyinitialposition() { let position = this.position let startposition = this.constructor.getstartposition() // error undefined is not a function, since the constructor is child return { offsetx: startposition.x - position.x, offsety: startposition.y - position.y } }; for this example we need either to stay parent constructor to continue to wor...
... summary: manually updating or setting the constructor can lead to differrent and sometimes confusing consequences.
Promise.any() - JavaScript
also, unlike promise.race(), which returns the first settled value (either fulfillment or rejection), this method returns the first fulfilled value.
...this is in contrast to promise.race(), which resolves or rejects with the first promise to settle.
... const perr = new promise((resolve, reject) => { reject("always fails"); }); const pslow = new promise((resolve, reject) => { settimeout(resolve, 500, "done eventually"); }); const pfast = new promise((resolve, reject) => { settimeout(resolve, 100, "done quick"); }); promise.any([perr, pslow, pfast]).then((value) => { console.log(value); // pfast fulfils first }) // expected output: "done quick" rejections with aggregateerror promise.any() rejects with an aggregateerror if no promise fulfils.
Proxy() constructor - JavaScript
by defining any of a set group of functions on the handler object, you can customise specific aspects of the proxy's behavior.
... handler.set() a trap for setting property values.
... handler.setprototypeof() a trap for object.setprototypeof.
Reflect - JavaScript
reflect.set(target, propertykey, value[, receiver]) a function that assigns values to properties.
... reflect.setprototypeof(target, prototype) a function that sets the prototype of an object.
...my name is ${this.name}`); } } reflect.has(duck, 'color'); // true reflect.has(duck, 'haircut'); // false returning the object's own keys reflect.ownkeys(duck); // [ "name", "color", "greeting" ] adding a new property to the object reflect.set(duck, 'eyes', 'black'); // returns "true" if successful // "duck" now contains the property "eyes: 'black'" specifications specification ecmascript (ecma-262)the definition of 'reflect' in that specification.
String.prototype.charCodeAt() - JavaScript
backward compatibility: in historic versions (like javascript 1.2) the charcodeat() method returns a number indicating the iso-latin-1 codeset value of the character at the given index.
... the iso-latin-1 codeset ranges from 0 to 255.
... the first 0 to 127 are a direct match of the ascii character set.
TypedArray.prototype.byteLength - JavaScript
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
...if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned.
... examples using the bytelength property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.bytelength; // 8 (matches the bytelength of the buffer) var uint8 = new uint8array(buffer, 1, 5); uint8.bytelength; // 5 (as specified when constructing the uint8array) var uint8 = new uint8array(buffer, 2); uint8.bytelength; // 6 (due to the offset of the constructed uint8array) specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.bytelength' in that specification.
TypedArray.prototype.length - JavaScript
description the length property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
...if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned.
... examples using the length property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.length; // 8 (matches the length of the buffer) var uint8 = new uint8array(buffer, 1, 5); uint8.length; // 5 (as specified when constructing the uint8array) var uint8 = new uint8array(buffer, 2); uint8.length; // 6 (due to the offset of the constructed uint8array) specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.length' in that specification.
Uint16Array() constructor - JavaScript
syntax new uint16array(); // new in es2017 new uint16array(length); new uint16array(typedarray); new uint16array(object); new uint16array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Uint32Array() constructor - JavaScript
syntax new uint32array(); // new in es2017 new uint32array(length); new uint32array(typedarray); new uint32array(object); new uint32array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Uint8Array() constructor - JavaScript
syntax new uint8array(); // new in es2017 new uint8array(length); new uint8array(typedarray); new uint8array(object); new uint8array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros.
... buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the specified arraybuffer.
... the byteoffset and length parameters specify the memory range that will be exposed by the typed array view.
Uint8ClampedArray - JavaScript
the uint8clampedarray typed array represents an array of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead; if you specify a non-integer, the nearest integer will be set.
... uint8clampedarray.prototype.byteoffset returns the offset (in bytes) of the uint8clampedarray from the start of its arraybuffer.
... uint8clampedarray.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Iteration protocols - JavaScript
{ value: 'bye', done: (this._first = false) } : { done: true } }, _first: true }; }; notice how redefining @@iterator affects the behavior of built-in constructs that use the iteration protocol: console.log([...somestring]); // ["bye"] console.log(somestring + ''); // "hi" iterable examples built-in iterables string, array, typedarray, map, and set are all built-in iterables, because each of their prototype objects implements an @@iterator method.
...some examples include: new map([iterable]) new weakmap([iterable]) new set([iterable]) new weakset([iterable]) new map([[1, 'a'], [2, 'b'], [3, 'c']]).get(2); // "b" let myobj = {}; new weakmap([ [{}, 'a'], [myobj, 'b'], [{}, 'c'] ]).get(myobj); // "b" new set([1, 2, 3]).has(3); // true new set('123').has('2'); // true new weakset(function* () { yield {} yield myobj yield {} }()).has(myobj); // true see also promise.all(iterable) pr...
...s some statements and expressions expect iterables, for example the for...of loops, the spread operator), yield*, and destructuring assignment: for (let value of ['a', 'b', 'c']) { console.log(value); } // "a" // "b" // "c" console.log([...'abc']); // ["a", "b", "c"] function* gen() { yield* ['a', 'b', 'c']; } console.log(gen().next()); // { value: "a", done: false } [a, b, c] = new set(['a', 'b', 'c']); console.log(a); // "a" non-well-formed iterables if an iterable's @@iterator method doesn't return an iterator object, then it's considered a non-well-formed iterable.
super - JavaScript
class rectangle { constructor(height, width) { this.name = 'rectangle'; this.height = height; this.width = width; } sayname() { console.log('hi, i am a ', this.name + '.'); } get area() { return this.height * this.width; } set area(value) { this._area = value; } } class square extends rectangle { constructor(length) { this.height; // referenceerror, super needs to be called first!
...this works with the help of object.setprototypeof() with which we are able to set the prototype of obj2 to obj1, so that super is able to find method1 on obj1.
... var obj1 = { method1() { console.log('method 1'); } } var obj2 = { method2() { super.method1(); } } object.setprototypeof(obj2, obj1); obj2.method2(); // logs "method 1" specifications specification ecmascript (ecma-262)the definition of 'super' in that specification.
Transitioning to strict mode - JavaScript
setting a value to an undeclared variable function f(x) { 'use strict'; var a = 12; b = a + x * 35; // error!
...if you really want to set a value to the global object, pass it as an argument and explicitly assign it as a property: var global = this; // in the top-level context, "this" always // refers to the global object function f(x) { 'use strict'; var a = 12; global.b = a + x * 35; } f(42); trying to delete a non-configurable property 'use strict'; delete object.prototype; // error!
...the only legitimate use case would be to reuse a function as in: // example taken from vanillajs: http://vanilla-js.com/ var s = document.getelementbyid('thing').style; s.opacity = 1; (function() { if ((s.opacity-=.1) < 0) s.display = 'none'; else settimeout(arguments.callee, 40); })(); which can be rewritten as: 'use strict'; var s = document.getelementbyid('thing').style; s.opacity = 1; (function fadeout() { // name the function if((s.opacity-=.1) < 0) s.display = 'none'; else settimeout(fadeout, 40); // use the name of the function })(); semantic differences these differences are very subtle differences.
Authoring MathML - MathML
prior to gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28), it was a bit tedious to setup math fonts, see the font instructions for mozilla 2.0.
... pros: this is very easy setup: only a few javascript and css files to upload and/or a link to add to your document header.
... cons: this might be a bit more difficult to set up, since you need some admin right on your server.
<mo> - MathML
WebMathMLElementmo
(it is the default value if the operator is the last argument in a <mrow> element with more than one argument.) href used to set a hyperlink to a specified uri.
... largeop specifies whether the operator should be drawn larger than normal when displaystyle="true" is set.
... the default value is true if stretchy is set to true and otherwise false.
MathML documentation index - MathML
WebMathMLIndex
use the following syntax: <mover> base overscript </mover> 23 <mpadded> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mpadded> element is used to add extra padding and to set the general adjustment of position and size of enclosed contents.
...by default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display.
... 28 <mspace> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mspace> element is used to display a blank space, whose size is set by its attributes.
Image file type and format guide - Web media technologies
svg (scalable vector graphics) svg is an xml-based vector graphics format that specifies the contents of an image as a set of drawing commands that create shapes, lines, apply colors, filters, and so forth.
... greyscale with alpha n/a n/a true color with alpha n/a n/a compression lossless licensing open source choosing an image format picking the best image format for your needs is likely easier than video formats, as there are fewer options with broad support, and each tends to have a specific set of use-cases.
... for example, if you're displaying a diagram best displayed with svg, but wish to offer a fallback to a png or gif of the diagram, you would do something like this: <picture> <source srcset="diagram.svg" type="image/svg+xml"> <source srcset="diagram.png" type="image/png"> <img src="diagram.gif" width="620" height="540" alt="diagram showing the data channels"> </picture> you can specify as many <source>s as you wish, though typically 2 or 3 is all you need.
Web media technologies
positional audio in a 3d environment in 3d environments, which may either be 3d scenes rendered to the screen or a mixed reality experience experienced using a headset, it's important for audio to be performed so that it sounds like it's coming from the direction of its source.
...this can be used with media in many ways, including by setting a <canvas> element as the destination for video playback or camera capture so that you can capture and manipulate video frames.
...the mixed reality content can then be displayed on the device's screen or using goggles or a headset.
Introduction to progressive web apps - Progressive web apps (PWAs)
an app could be considered a pwa when it meets certain requirements, or implements a set of given features: works offline, is installable, is easy to synchronize, can send push notifications, etc.
... modern web apps can have this native app feel via properties set inside the web app manifest, and via a feature available in modern smartphone browsers called web app installation.
... this is achieved using a combination of technologies: service workers to control page requests (for example storing them offline), the cache api for storing responses to network requests offline (very useful for storing site assets), and client-side data storage technologies such as web storage and indexeddb to store application data offline.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
they finally fix issues that front-end developers have struggled with for years — most notably how to properly cache the assets of a website and make them available when the user’s device is offline.
...if you want to experiment first before pushing your code to production, you can always test on a localhost or setup github pages — both support https.
... updates there is still one point to cover: how do you upgrade a service worker when a new version of the app containing new assets is available?
SVG Presentation Attributes - SVG: Scalable Vector Graphics
ont-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering solid-color solid-opacity stop-color stop-opacity stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering transform unicode-bidi vector-effect visibility word-spacing writing-mode attributes alignment-baseline it specifies how an object is aligned along the font baseline with respect to its parent.
... value: none|<dasharray>; animatable: yes stroke-dashoffset defines an offset on the rendering of the associated dash array.
... value: start|middle|end|inherit; animatable: yes text-decoration sets the appearance of decorative lines on text.
class - SVG: Scalable Vector Graphics
WebSVGAttributeclass
« svg attribute reference home assigns a class name or set of class names to an element.
... an element's class name serves two key roles: as a style sheet selector, for when an author assigns style information to a set of elements.
...ss" 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> <lineargradient> <marker> <mask> <missing-glyph> <path> <pattern> <polygon> <polyline> <radialgradient> <rect> <stop> <svg> <switch> <symbol> <text> <textpath> <title> <tref> <tspan> <use> ...
cx - SVG: Scalable Vector Graphics
WebSVGAttributecx
three elements are using this attribute: <circle>, <ellipse>, and <radialgradient> html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <radialgradient cx="25%" id="mygradient"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="45"/> <ellipse cx="150" cy="50" rx="45" ry="25" /> <rect x="205" y="5" width="90" height="90" fill="url(#mygradient)" /> </svg> circle for <circle>, cx defines the x-axis coordinate of the center of the shape.
... value <length> default value 50% animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 34 10" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient cx="0" id="mygradient000"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> <radialgradient cx="50%" id="mygradient050"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> <radialgradient cx="100%" id="myg...
...radient100"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> </defs> <rect x="1" y="1" width="8" height="8" fill="url(#mygradient000)" stroke="black" /> <rect x="13" y="1" width="8" height="8" fill="url(#mygradient050)" stroke="black" /> <rect x="25" y="1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'cx' in that specification.
cy - SVG: Scalable Vector Graphics
WebSVGAttributecy
three elements are using this attribute: <circle>, <ellipse>, and <radialgradient> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <radialgradient cy="25%" id="mygradient"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cy="50" cx="50" r="45"/> <ellipse cy="150" cx="50" rx="45" ry="25" /> <rect x="5" y="205" width="90" height="90" fill="url(#mygradient)" /> </svg> circle for <circle>, cy defines the y-axis coordinate of the center of the shape.
... value <length> default value 50% animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 34 10" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient cy="0" id="mygradient000"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> <radialgradient cy="50%" id="mygradient050"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> <radialgradient cy="100%" id="myg...
...radient100"> <stop offset="0%" stop-color="gold" /> <stop offset="50%" stop-color="green" /> <stop offset="100%" stop-color="white" /> </radialgradient> </defs> <rect x="1" y="1" width="8" height="8" fill="url(#mygradient000)" stroke="black" /> <rect x="13" y="1" width="8" height="8" fill="url(#mygradient050)" stroke="black" /> <rect x="25" y="1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'cy' in that specification.
externalResourcesRequired - SVG: Scalable Vector Graphics
in particular, if an element sets externalresourcesrequired="true", then all style sheets must be available since any style sheet might affect the rendering of that element.
... the externalresourcesrequired attribute is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container.
... because setting externalresourcesrequired="true" on a container element will have the effect of disabling progressive display of the contents of that container, if that container includes elements that reference external resources, authors should avoid simply setting externalresourcesrequired="true" on the outermost <svg> element on a universal basis.
fill - SVG: Scalable Vector Graphics
WebSVGAttributefill
for animation five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>.
... html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- simple color fill --> <circle cx="50" cy="50" r="40" fill="pink" /> <!-- fill circle with a gradient --> <defs> <radialgradient id="mygradient"> <stop offset="0%" stop-color="pink" /> <stop offset="100%" stop-color="black" /> </radialgradient> </defs> <circle cx="150" cy="50" r="40" fill="url(#mygradient)" /> <!-- keeping the final state of an animated circle which is a circle with a radius of 40.
... set for <set>, fill defines the final state of the animation.
href - SVG: Scalable Vector Graphics
WebSVGAttributehref
fifteen elements are using this attribute: <a>, <animate>, <animatemotion>, <animatetransform>, <discard>, <feimage>, <image>, <lineargradient>, <mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 160 40" xmlns="http://www.w3.org/2000/svg"> <a href="https://developer.mozilla.org/"><text x="10" y="25">mdn web docs</text></a> </svg> in svg a for <a>, href defines the location of the referenced object, expressed as a url reference.
... value <url> default value none animatable yes animate, animatemotion, animatetransform, set for the <animate>, <animatemotion>, <animatetransform>, and <set>, href defines a url referring to the element which is the target of this animation element and which therefore will be modified over time.
... svg animations level 2the definition of 'href for <animate>, <animatemotion>, <animatetransform>, and <set>' in that specification.
kerning - SVG: Scalable Vector Graphics
WebSVGAttributekerning
the kerning attribute indicates whether the spacing between glyphs should be adjusted based on kerning tables that are included in the relevant font (i.e., enable auto-kerning) or instead disable auto-kerning and set the spacing between them to a specific length (typically, zero).
...instead, inter-character spacing is set to the given length.
... the most common scenario, other than auto, is to set kerning to a value of 0 so that auto-kerning is disabled.
<feComponentTransfer> - SVG: Scalable Vector Graphics
example svg <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 600 300"> <defs> <lineargradient id="rainbow" gradientunits="userspaceonuse" x1="0" y1="0" x2="100%" y2="0"> <stop offset="0" stop-color="#ff0000"></stop> <stop offset="0.2" stop-color="#ffff00"></stop> <stop offset="0.4" stop-color="#00ff00"></stop> <stop offset="0.6" stop-color="#00ffff"></stop> <stop offset="0.8" stop-color="#0000ff"></stop> <stop offset="1" stop-color="#800080"></stop> </lineargradient> <filter id="identity" x="0" y="0" width="100%" height="100%"> <fec...
... <fefuncr type="linear" slope="0.5" intercept="0"></fefuncr> <fefuncg type="linear" slope="0.5" intercept="0.25"></fefuncg> <fefuncb type="linear" slope="0.5" intercept="0.5"></fefuncb> </fecomponenttransfer> </filter> <filter id="gamma" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" amplitude="4" exponent="7" offset="0"></fefuncr> <fefuncg type="gamma" amplitude="4" exponent="4" offset="0"></fefuncg> <fefuncb type="gamma" amplitude="4" exponent="1" offset="0"></fefuncb> </fecomponenttransfer> </filter> </defs> <g font-weight="bold"> <text x="0" y="20">default</text> <rect x="0" y="30" width="100%" height="20"></rect> <text x="0" y="70">identity</text> <rect x="0"...
... working draft specified that missing transfer function elements are treated like they were specified with their type attributes set to identity.
<feDropShadow> - SVG: Scalable Vector Graphics
eviation="0" flood-color="pink" flood-opacity="0.5"/> </filter> </defs> <circle cx="5" cy="50%" r="4" style="fill:pink; filter:url(#shadow);"/> <circle cx="15" cy="50%" r="4" style="fill:pink; filter:url(#shadow2);"/> <circle cx="25" cy="50%" r="4" style="fill:pink; filter:url(#shadow3);"/> </svg> attributes dx this attribute defines the x offset of the drop shadow.
... value type: <number>; default value: 2; animatable: yes dy this attribute defines the y offset of the drop shadow.
...mber>; default value: 2; animatable: yes global attributes core attributes most notably: id styling attributes class, style filter primitive attributes height, in, result, x, y, width presentation attributes most notably: flood-color, flood-opacity usage notes categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <script>, <set> specifications specification status comment filter effects module level 1the definition of '<fedropshadow>' in that specification.
<polygon> - SVG: Scalable Vector Graphics
WebSVGElementpolygon
the <polygon> element defines a closed shape consisting of a set of connected straight line segments.
...ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<polygon>' in that sp...
SVG element reference - SVG: Scalable Vector Graphics
WebSVGElement
rm> c <circle> <clippath> <color-profile> d <defs> <desc> <discard> e <ellipse> f <feblend> <fecolormatrix> <fecomponenttransfer> <fecomposite> <feconvolvematrix> <fediffuselighting> <fedisplacementmap> <fedistantlight> <fedropshadow> <feflood> <fefunca> <fefuncb> <fefuncg> <fefuncr> <fegaussianblur> <feimage> <femerge> <femergenode> <femorphology> <feoffset> <fepointlight> <fespecularlighting> <fespotlight> <fetile> <feturbulence> <filter> <foreignobject> g <g> h <hatch> <hatchpath> i <image> l <line> <lineargradient> m <marker> <mask> <mesh> <meshgradient> <meshpatch> <meshrow> <metadata> <mpath> p <path> <pattern> <polygon> <polyline> r <radialgradient> <rect> s <script> <set> <solidcol...
...or> <stop> <style> <svg> <switch> <symbol> t <text> <textpath> <title> <tspan> u <unknown> <use> v <view> svg elements by category animation elements <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <discard>, <mpath>, <set> basic shapes <circle>, <ellipse>, <line>, <polygon>, <polyline>, <rect> container elements <a>, <defs>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, <symbol>, <unknown> descriptive elements <desc>, <metadata>, <title> filter primitive elements <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>,<fefunca>, <fefuncb>, <fefuncg>, <fefuncr>,<fegaussianblur>, <feimage>, <femerge>, <femergenode>, <femorp...
...hology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence> font elements <font>, <font-face>, <font-face-format>, <font-face-name>, <font-face-src>, <font-face-uri>, <hkern>, <vkern> gradient elements <lineargradient>, <meshgradient>, <radialgradient>, <stop> graphics elements <circle>, <ellipse>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <text>, <use> graphics referencing elements <mesh>, <use> light source elements <fedistantlight>, <fepointlight>, <fespotlight> never-rendered elements <clippath>, <defs>, <hatch>, <lineargradient>, <marker>, <mask>, <meshgradient>, <metadata>, <pattern>, <radialgradient>, <script>, <style>, <symbol>, <title> paint server elements <hatch>, <lineargradient>, <meshgradient>, <pattern>, <radialgradient>, <solidcolor>...
Example - SVG: Scalable Vector Graphics
= display(); var width = parseint( display.getattributens(null,'width') ); var height = parseint( display.getattributens(null,'height') ); return [width,height]; } // this is called by mouse move events var mouse_x = 200, mouse_y = 150; function onmousemove(evt) { mouse_x = evt.clientx; mouse_y = evt.clienty; var widget = document.getelementbyid('cursor'); widget.setattributens(null,'cx',mouse_x); widget.setattributens(null,'cy',mouse_y); } document.onmousemove = onmousemove; // determine (x,y) of the cursor function cursor() { return [mouse_x, mouse_y]; } // determine average (x,y) of the swarm function averagemoteposition() { if( !motes ) return [0,0]; if( motes.length == 0 ) return [0,0]; var i; var sum_x=0, ...
... if( this.elt === null ) { var svg = 'http://www.w3.org/2000/svg'; this.elt = document.createelementns(svg,'line'); this.elt.setattributens(null,'stroke','green'); this.elt.setattributens(null,'stroke-width','3'); this.elt.setattributens(null,'stroke-opacity','0.5'); display().appendchild( this.elt ); } this.elt.setattributens(null,'x1',old_x); this.elt.setattributens(null,'y1',old_y); this.elt.setattributens(null,'x2',this.x); this.elt.setattributens(null,'y2',this.y); } function update(...
... if( num == 0 ) motes = []; else if( motes.length > num ) motes = motes.slice(0,num-1); // move a random mote if( motes.length > 0 ) motes[ rand( motes.length ) ].move(); // and do this again in 1/100 sec settimeout('update()', 10); } ]]> </script> </body> </html> ...
Getting started - SVG: Scalable Vector Graphics
the background is set to red by drawing a rectangle <rect> that covers the complete image area.
... a green circle <circle> with a radius of 80px is drawn atop the center of the red rectangle (center of circle offset 150px to the right, and 100px downward from the top left corner).
...the text is positioned by setting an anchor where we want the midpoint to be: in this case, the midpoint should correspond to the center of the green circle.
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
therefore, to create a cubic bézier, three sets of coordinates need to be specified.
... c x1 y1, x2 y2, x y (or) c dx1 dy1, dx2 dy2, dx dy the last set of coordinates here (x,y) specify where the line should end.
...for the second arc, though, the x-axis-rotation is set to -45 degrees.
SVG Filters Tutorial - SVG: Scalable Vector Graphics
by adding feoffset and result, the effect layer is defined <result> attribute is a reference that can be use later.
...<feoffset> primitive has the blur result from the gaussian blur.
... <femerge> primitive contains the nodes <femergenode> taking as input the result offsetblur , this will allow it to appear below the sourcegraphic implementation of more primitives <defs> <filter id="drop-shadow"> <fegaussianblur in="sourcealpha" stddeviation="3" result="blur"/> <feoffset in="blur" dx="4" dy="4" result="offsetblur"/> </filter> <femerge> <femergenode in="offsetblur"/> <femergenode in="sourcegraphic"/> </femerge> </defs> ...
Transport Layer Security - Web security
in tls 1.2 and earlier, the negotiated cipher suite includes a set of cryptographic algorithms that together provide the negotiation of the shared secret, the means by which a server is authenticated, and the method that will be used to encrypt data.
...the configuration file may need some adjustments to include custom settings, so be sure to review the generated configuration before using it; installing the configuration file without ensuring any references to domain names and the like are correct will result in a server that just doesn't work.
... tls 1.3 defines a new set of cipher suites that are exclusive to tls 1.3.
Using custom elements - Web Components
// create a shadow root this.attachshadow({mode: 'open'}); // sets and returns 'this.shadowroot' // create (nested) span elements const wrapper = document.createelement('span'); wrapper.setattribute('class','wrapper'); const icon = wrapper.appendchild(document.createelement('span')); icon.setattribute('class','icon'); icon.setattribute('tabindex', 0); // insert icon from defined attribute or default icon const img = icon.appendchild(document.createelement('img...
...this.getattribute('img') : 'img/default.png'; const info = wrapper.appendchild(document.createelement('span')); info.setattribute('class','info'); // take attribute content and put it inside the info span info.textcontent = this.getattribute('data-text'); // create some css to apply to the shadow dom const style = document.createelement('style'); style.textcontent = '.wrapper {' + // css truncated for brevity // attach the created elements to the shadow dom this.shadowroot.append(style,wrapper); finally, we register our custom element on the customelementregistry using the define() method we mentioned earlier — in the parameters we specify the element name, and then the class name that defines its functionality: customelements.define('popup-i...
... for example, take a look at this code from our popup-info-box-external-stylesheet example (see the source code): // apply external styles to the shadow dom const linkelem = document.createelement('link'); linkelem.setattribute('rel', 'stylesheet'); linkelem.setattribute('href', 'style.css'); // attach the created element to the shadow dom shadow.appendchild(linkelem); note that <link> elements do not block paint of the shadow root, so there may be a flash of unstyled content (fouc) while the stylesheet loads.
count - XPath
WebXPathFunctionscount
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the count function counts the number of nodes in a node-set and returns an integer.
... syntax count(node-set ) arguments node-set the node set to be counted.
... returns an integer representing the number of nodes in a node-set.
key - XPath
WebXPathFunctionskey
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the key function returns a node-set of nodes that have the given value for the given key.
... value the returned node-set will contain every node that has this value for the given key.
... returns a node set.
sum - XPath
WebXPathFunctionssum
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the sum function returns a number that is the sum of the numeric values of each node in a given node-set.
... syntax sum(node-set ) arguments node-set the node-set to be evaluated.
... each node in this node-set is evaluated as if it were passed to the number() function, and a sum of the resulting numbers is returned.
<xsl:apply-templates> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:apply-templates> element selects a set of nodes in the input tree and instructs the processor to apply the proper templates to them.
...an asterisk(*) selects the entire node-set.
... if this attribute is not set, all child nodes of the current node are selected.
<xsl:copy> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementcopy
syntax <xsl:copy use-attribute-sets=list-of-names> template </xsl:copy> required attributes none.
... optional attributes use-attribute-sets lists attribute sets that should be applied to the output node, if it is an element.
... names of the sets should be separated with whitespace characters.
Caching compiled WebAssembly modules - WebAssembly
it is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object.
... setting up a caching library because indexeddb is a somewhat old-fashioned api, we wanted to provide a library function to speed up writing caching code, and make it work better along with today's more modern apis.
... the function starts off by defining some necessary constants: function instantiatecachedurl(dbversion, url, importobject) { const dbname = 'wasm-cache'; const storename = 'wasm-cache'; setting up the database the first helper function contained inside instantiatecachedurl() — opendatabase() — creates an object store for storing wasm modules, and also handles clearing out the database if the dbversion is updated; it returns a promise resolving to the new database.
WebAssembly Concepts - WebAssembly
a set of web apis that the web app can call to control web browser/device functionality and make things happen (dom, cssom, webgl, indexeddb, web audio api, etc.).
... instance: a module paired with all the state it uses at runtime including a memory, table, and set of imported values.
... an instance is like an es2015 module that has been loaded into a particular global with a particular set of imports.
Loading and running WebAssembly code - WebAssembly
again, assuming our module is called simple.wasm: create a new xmlhttprequest() instance, and use its open() method to open a request, setting the request method to get, and declaring the path to the file we want to fetch.
... the key part of this is to set the response type to 'arraybuffer' using the responsetype property.
... the final code looks like this: request = new xmlhttprequest(); request.open('get', 'simple.wasm'); request.responsetype = 'arraybuffer'; request.send(); request.onload = function() { var bytes = request.response; webassembly.instantiate(bytes, importobject).then(results => { results.instance.exports.exported_func(); }); }; note: you can see an example of this in action in xhr-wasm.html.
Porting the Library Detector - Archive of obsolete content
this means we'll need two additional content scripts: one in the widget's context, which listens for icon mouseover events and sends a message to main.js containing the name of the corresponding library: function setlibraryinfo(element) { self.port.emit('setlibraryinfo', element.target.title); } var elements = document.getelementsbytagname('img'); for (var i = 0; i &lt; elements.length; i++) { elements[i].addeventlistener('mouseover', setlibraryinfo, false); } one in the panel, which updates the panel's content with the library information: self.on("message", function(libraryinfo) { window.docum...
...ent.body.innerhtml = libraryinfo; }); finally main.js relays the library information from the widget to the panel: widget.port.on('setlibraryinfo', function(libraryinfo) { widget.panel.postmessage(libraryinfo); }); ...
XUL Migration Guide - Archive of obsolete content
using the supported apis the sdk provides a set of high level apis providing some basic user interface components and functionality commonly required by add-ons.
...this simple example modifies the selected tab's css to enable the user to highlight the selected tab: function highlightactivetab() { var window = require("sdk/window/utils").getmostrecentbrowserwindow(); var tab = require("sdk/tabs/utils").getactivetab(window); if (tab.style.getpropertyvalue('background-color')) { tab.style.setproperty('background-color','','important'); } else { tab.style.setproperty('background-color','rgb(255,255,100)','important'); } } require("sdk/ui/button/action").actionbutton({ id: "highlight-active-tab", label: "highlight active tab", icon: "./icon-16.png", onclick: highlightactivetab }); security implications the sdk implements a security model in which an add-on only get...
self - Archive of obsolete content
it comes from the id property set in the package.json file in the main package (i.e.
...it comes from the version property set in the package.json file in the main package.
simple-storage - Archive of obsolete content
be careful to set properties on the storage object and not the module itself, as demonstrated below: // this is not good!
...here's an add-on that adds three buttons to write, read, and delete a value: var ss = require("sdk/simple-storage"); require("sdk/ui/button/action").actionbutton({ id: "write", label: "write", icon: "./write.png", onclick: function() { ss.storage.value = 1; console.log("setting value"); } }); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.value); } }); require("sdk/ui/button/action").actionbutton({ id: "delete", label: "delete", icon: "./delete.png", onclick: function() { delete ss.storage.value; console.log("deleting value"); } }); if you...
content/loader - Archive of obsolete content
loader adds code to initialize and validate a set of properties for managing content scripts: contenturl contentscript contentscriptfile contentscriptwhen contentscriptoptions allow when certain of these properties are set, the loader emits a propertychange event, enabling its users to take the appropriate action.
... this.on('propertychange', this._onchange = this._onchange.bind(this)); let self = this; hiddenframes.add(hiddenframes.hiddenframe({ onready: function onready() { let frame = self._frame = this.element; self._emit('propertychange', { contenturl: self.contenturl }); } })); }, _onchange: function _onchange(e) { if ('contenturl' in e) this._frame.setattribute('src', this._contenturl); } }); loader properties contentscriptfile the local file urls of content scripts to load.
core/promise - Archive of obsolete content
lets see the implementation of readasync that we used in several of the examples above: const { defer } = require('sdk/core/promise'); function readasync(url) { var deferred = defer(); let xhr = new xmlhttprequest(); xhr.open("get", url, true); xhr.onload = function() { deferred.resolve(xhr.responsetext); }; xhr.onerror = function(event) { deferred.reject(event); }; xhr.send(); return deferred.promise; } so defer returns an object that contains a promise and two resolve, reject functions that can be used to resolve / reject that promise.
... 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 discover some missing pieces and this section of documentation may help you to discover them.
net/url - Archive of obsolete content
options : object optional options: name type sync boolean if this option is set to true, the promise returned will be resolved synchronously.
... charset string the character set to use when read the content of the uri given.
places/history - Archive of obsolete content
an options object may be specified to determine overall settings, like sorting and how many objects should be returned.
...if left undefined, no limit is set.
test/assert - Archive of obsolete content
usage to use the assert module, write a set of unit tests following the instructions in the unit testing tutorial.
... 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.
test/runner - Archive of obsolete content
experimental sets up unit tests.
... this module contains the package's main program, which does a bit of high-level setup and then delegates test finding and running to the harness module.
util/match-pattern - Archive of obsolete content
in particular: the pattern must match the entire value, not just any subset.
...the matchpattern constructor will throw an exception if you try to set any of these flags.
Adding a Button to the Toolbar - Archive of obsolete content
the button is added to the toolbar at the top of the browser window: you can't set the initial location for the button, but the user can move it using the browser's customization feature.
... you can change the icon at any time by setting the button's icon property.
Displaying annotations - Archive of obsolete content
this function: initializes the content script instance with the current set of annotations provides a handler for messages from that content script, handling the three messages - show, hide and detach - that the content script might send adds the worker to an array, so we it can send messages back later.
... annotation panel content script the annotation panel has a minimal content script that sets the text: self.on('message', function(message) { $('#annotation').text(message); }); save this in data/annotation as annotation.js.
Getting Started (jpm) - Archive of obsolete content
during development, or if you don't plan to distribute, you can open about:config and set xpinstall.signatures.required to false to run it unsigned.
... this setting applies to any add-on, so take extra care to not accidently install a malicious one from elsewhere.
Bootstrapped extensions - Archive of obsolete content
all the application does is call into this script file; the extension is responsible for adding and removing its user interface and handling any other setup and shutdown tasks it requires.
... note: an add-on may be upgraded/downgraded at application startup, in this case the startup method reason is app_startup, and the oldversion property is not set.
Autocomplete - Archive of obsolete content
first, declare a panel with the "autocomplete" type, like so: <panel id="popup_autocomplete" type="autocomplete" noautofocus="true" /> now set the autocompletepopup attribute of your <browser> element to the id of the panel you just declared: <browser id="my_browser" ...
... autocompletepopup="popup_autocomplete" /> finally, make sure that the value of the browser.formfill.enable pref is set to true.
Canvas code snippets - Archive of obsolete content
function canvas2dcontext(canvas) { if (typeof canvas === 'string') { canvas = document.getelementbyid(canvas); } if (!(this instanceof canvas2dcontext)) { return new canvas2dcontext(canvas); } this.context = this.ctx = canvas.getcontext('2d'); if (!canvas2dcontext.prototype.arc) { canvas2dcontext.setup.call(this, this.ctx); } } canvas2dcontext.setup = function() { var methods = ['arc', 'arcto', 'beginpath', 'beziercurveto', 'clearrect', 'clip', 'closepath', 'drawimage', 'fill', 'fillrect', 'filltext', 'lineto', 'moveto', 'quadraticcurveto', 'rect', 'restore', 'rotate', 'save', 'scale', 'settransform', 'stroke', 'strokerect', 'stroketext', 'transform', 'translate']; var gett...
...etext', // drawfocusring not currently supported // the following might instead be wrapped to be able to chain their child objects 'createimagedata', 'createlineargradient', 'createradialgradient', 'getimagedata', 'putimagedata' ]; var props = ['canvas', 'fillstyle', 'font', 'globalalpha', 'globalcompositeoperation', 'linecap', 'linejoin', 'linewidth', 'miterlimit', 'shadowoffsetx', 'shadowoffsety', 'shadowblur', 'shadowcolor', 'strokestyle', 'textalign', 'textbaseline']; for (let m of methods) { let method = m; canvas2dcontext.prototype[method] = function() { this.ctx[method].apply(this.ctx, arguments); return this; }; } for (let m of gettermethods) { let method = m; canvas2dcontext.prototype[method] = function() { return...
Dialogs and Prompts - Archive of obsolete content
add ok and cancel buttons in an order that is consistent with os default (but the button set and layout is highly customizable, see below).
... for each of these buttons you can set their label, accesskey and oncommand handler by adding buttonlabel<buttonname>, buttonaccesskey<buttonname> and ondialog<buttonname> attributes to the dialog element.
Downloading Files - Archive of obsolete content
ete = math.round((acurtotalprogress / amaxtotalprogress) * 100); progresselement.textcontent = percentcomplete +"%"; }, onstatechange: function(awebprogress, arequest, astateflags, astatus) { // do something } } persist.saveuri(obj_uri, null, null, null, "", targetfile, privacy); downloading files that require credentials before calling nsiwebbrowserpersist.saveuri(), you need to set the progresslistener property of the nsiwebbrowserpersist instance to an object that implements nsiauthprompt.
...rvice(components.interfaces.nsiioservice); var channel = ioserv.newchannel(url, 0, null); var stream = channel.open(); if (channel instanceof components.interfaces.nsihttpchannel && channel.responsestatus != 200) { return ""; } var bstream = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bstream.setinputstream(stream); var size = 0; var file_data = ""; while(size = bstream.available()) { file_data += bstream.readbytes(size); } return file_data; } see also nsidownloadprogresslistener saving an arbitrary url to a local file customizing the download progress bar appearance ...
Examples and demos from articles - Archive of obsolete content
[article] pure-css editable (pseudo)<select> [html] this example shows how it's possible to simulate an editable <select> through a fieldset of radioboxes and textboxes.
... using setinterval within animations sometimes a page uses dozens and dozens of animations.
Post data to window - Archive of obsolete content
createinstance(ci.nsistringinputstream); if ("data" in stringstream) // gecko 1.9 or newer stringstream.data = datastring; else // 1.8 or older stringstream.setdata(datastring, datastring.length); var postdata = cc["@mozilla.org/network/mime-input-stream;1"].
... createinstance(ci.nsimimeinputstream); postdata.addheader("content-type", "application/x-www-form-urlencoded"); postdata.addcontentlength = true; postdata.setdata(stringstream); // postdata is ready to be used as apostdata argument ...
SVG General - Archive of obsolete content
svg requires you to use setattributens to add attributes to a newly created svg dom element.
...attr_map[attribute] : attribute); var value = attributes[attribute]; if (attribute in ns_map) elem.setattributens(ns_map[attribute], name, value); else elem.setattribute(name, value); } return elem; } attributes are packed in a literal object and the helper script unpacks them and adds them to the element.
Common Pitfalls - Archive of obsolete content
how to create a uri object in almost all cases, when creating a uri object you want to use the newuri method on the nsiioservice interface, like so: javascript: try { var ioserv = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uriobj = ioserv.newuri(uristring, uricharset, baseuri); } catch (e) { // may want to catch ns_error_malformed_uri for some applications } c++: nsresult rv; nscomptr<nsiioservice> ioserv = do_getservice("@mozilla.org/network/io-service;1"); ns_ensure_success(rv, rv); nscomptr<nsiuri> uriobj; rv = ioserv->newuri(uristring, uricharset, baseuri, getter_addrefs(uriobj)); if (ns_failed(rv)) { // may want to handle ns_e...
...rror_malformed_uri for // some applications return rv; } or, if the code can include nsnetutil.h: nscomptr<nsiuri> uriobj; nsresult rv = ns_newuri(getter_addrefs(uriobj), uristring, uricharset, baseuri); in all cases the baseuri can be null if the uristring should be treated as an absolute uri and uricharset can be null if there is no clear origin charset for the string (e.g.
Multiple item extension packaging - Archive of obsolete content
for the firefox and thunderbird 1.5 extension manager to determine that the package is a multiple item package, the em:type specified in your install.rdf must be 32 and specified as <em:type nc:parsetype="integer">32</em:type>.
...<rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type nc:parsetype="integer">32</em:type> ...
Offering a context menu for form controls - Archive of obsolete content
window.addeventlistener("load", function() { let settargetoriginal = nscontextmenu.prototype.settarget; components.utils.reporterror(settargetoriginal); nscontextmenu.prototype.settarget = function(anode, arangeparent, arangeoffset) { settargetoriginal.apply(this, arguments); if (this.istargetaformcontrol(anode)) this.shoulddisplay = true; }; }, false); this code, which is run when the window is opened up, works ...
...by replacing the settarget() routine for the prototype of nscontextmenu with one that forces the context menu to display if the target of the menu is a form control.
Adding sidebars - Archive of obsolete content
--> </tabpanel> </tabpanels> </tabbox> the first tab is selected by default, but you can change the default selection by setting the selected attribute to true in the « xul reference « element.
...the « xul reference « element is placed as a child for john's « xul reference « element, and the container attribute must be set.
Appendix A: Add-on Performance - Archive of obsolete content
if there is, just use an nsitimer or the settimeout function to delay running this code .
... window.settimeout(function() { that.postinit(); }, 500); }, postinit: function() { // actual init code goes here.
Intercepting Page Loads - Archive of obsolete content
few modern sites use framesets, but it is common for ads to appear inside iframe elements.
... asubject.setrequestheader("referer", "http://example.com", false); } else if (re_url_to_cancel.test(url)) { // re_url_to_cancel is a regular expression.
Performance best practices in extensions - Archive of obsolete content
use javascript code modules you can create your own javascript code modules incorporating sets of features that are only needed under specific circumstances.
... if there is anything that can be done even a fraction of a second later, you can use an nsitimer or the window.settimeout() method to schedule that work for later.
Signing an extension - Archive of obsolete content
set the trust for the root and intermediate certificates.
...id" \ -p $mypassword \ -x -z ~/desktop/myextension/dest/myextension-1.0.xpi \ ~/desktop/myextension/source unset mypassword then a signed xpi file will be generated.
Supporting search suggestions in search plugins - Archive of obsolete content
if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed.
... implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <url> element with its type attribute set to "application/x-suggestions+json".
Add-ons - Archive of obsolete content
setting up an extension development environment this article provides suggestions for how to set up your mozilla application for extension development.
... tabbed browser here you should find a set of useful code snippets to help you work with firefox's tabbed browser.
Creating reusable content with CSS and XBL - Archive of obsolete content
quare"><![cdata[ document.getanonymouselementbyattribute(this, "anonid", "square") ]]></field> <field name="button"><![cdata[ document.getanonymouselementbyattribute(this, "anonid", "button") ]]></field> <method name="dodemo"> <body><![cdata[ this.square.style.backgroundcolor = "#cf4" this.square.style.marginleft = "20em" this.button.setattribute("disabled", "true") settimeout(this.cleardemo, 2000, this) ]]></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> <h...
...copy and paste the content from here: /*** xbl demonstration ***/ [anonid="square"] { width: 20em; height: 20em; border: 2px inset gray; } [anonid="button"] { margin-top: 1em; padding: .5em 2em; } open the document in your browser and press the button.
List of Mozilla-Based Applications - Archive of obsolete content
a rhino javalikescript javascript extensible tooling framework uses nspr and spidermonkey jaxer ajax server jslibs javascript development runtime environment uses spidermonkey (note: this is separate from the javascript library jslib) joybidder ebay auction tool standalone version uses xulrunner just (fr) audio a tool for setting temporal tags in audio documents jsdoc toolkit documentation tool uses mozilla rhino k-meleon gecko-based web browser for windows embeds gecko in mfc kairo.at mandelbrot creates images of mandelbrot sets xulrunner application kazehakase gecko-based web browser for unix kirix strata data browser kiwix offl...
... application to manage tomtom gps devices review article from gps magazine; over 2.4m users topstyle html, xhtml and css editor seems to have optional gecko embedding but doesn't use it by default toxtox media browser for tv 5000 downloads trixul gui toolkit uses mozilla spidermonkey trustedbird email client thunderbird bundled with a set of extensions (formerly known as milimail) tuneup music collection organizer listed on xulrunner hall of fame but haven't seen information elsewhere tuxguitar tabulature editor uses xulrunner twitfactory standalone twitter/identi.ca client uis university information system intranet application, 1000 users, thin client based on ff3 ...
Localizing an extension - Archive of obsolete content
the chrome registry resolves the uris based on the user's current locale setting and the data you provide in your chrome manifest.
...we do this by creating a string bundle, using the following code: <stringbundleset id="stringbundleset"> <stringbundle id="string-bundle" src="chrome://stockwatcher2/locale/stockwatcher2.properties"/> </stringbundleset> this establishes a new string bundle, referenced by the id "string-bundle", whose keys and values are to be loaded from the stockwatcher2.properties file we've already created.
Protecting Mozilla's registry.dat file - Archive of obsolete content
in other windows versions, internet explorer (which is hard to kick off completely) likes to install "personnalized settings" when the user logs in for the first time, and this seems to have the interesting "side-effect" of wiping any non-microsoft subfolders from %userprofile%\application data, including mozilla's .
...moreover, it's advisable to "protect" the mozilla registry using attrib +r +s in case the logon script is finished before ie's "personnalized settings" have completed their dirty deed...
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
the valid values are: 0x5 automatically ignore 0x4 automatically retry 0x3 automatically abort note that you can also force windbgdlg to prompt, by setting a value of 0xfffffffe.
... to "comment out" a value, set its value to 0xffffffff.
Bookmark Keywords - Archive of obsolete content
for example, a keyworded bookmark could be set up so that a user could type <tt>google spam and eggs</tt> and thereby trigger a google search for the words "spam and eggs." because these tools require bookmarks with specific keywords in order to work, they will be referred to hereafter as keymarks, as distinct from regular bookmarks.
... setting up a google keymark to set up a keymark that will search google directly form the address bar, go to google and run a search for any word.
Enabling the behavior - updating the status bar panel - Archive of obsolete content
function updatetinderboxstatus() { var icon = document.getelementbyid('tinderbox-status'); if (gxmlhttprequest.responsetext.match("ee0000")) icon.setattribute("status", "busted"); else if (gxmlhttprequest.responsetext.match("ffaa00")) icon.setattribute("status", "testfailed"); else if (gxmlhttprequest.responsetext.match("11dd11")) icon.setattribute("status", "success"); else icon.setattribute("status", ""); } updatetinderboxstatus() retrieves a reference to the statusbarpanel element then searches through the retrieved html document (stored in the responsetext property of the xmlhttprequest instance) for one of several color references.
...when it finds a color, it sets the panel's status attribute to the corresponding status, which causes the previously defined css rules to switch to the icon appropriate for that status.
Specifying the appearance - Archive of obsolete content
for this we have to first create four icons, one for each tinderbox state (none, success, test failed, and busted), then create a set of css rules that displays the icon corresponding to the current tinderbox state: statusbarpanel#tinderbox-status { list-style-image: url("chrome://navigator/content/tb-nostatus.png"); } statusbarpanel#tinderbox-status[status="success"] { list-style-image: url("chrome://navigator/content/tb-success.png"); } statusbarpanel#tinderbox-status[status="testfailed"] { list-style-image: url("chrome://navigator/content/tb-testfailed.png"); } statusbarpanel#tinderbox-status[status="busted"] { list-style-image: url("chrome://navigator/content/tb-bu...
...sted.png"); } mozilla can have multiple sets of stylesheets that govern its appearance, and we don't want to have to add these rules to each set (and have our extension break when a new set gets installed), so we'll put this stylesheet in a file called tinderstatus.css in the same directory as navigator.xul and reference it at the top of that file right under the global stylesheet reference: <?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> <?xml-stylesheet href="chrome://navigator/content/tinderstatus.css" type="text/css"?> our css rules use the list-style-image property to define an image to appear when our status bar panel, identified by its id attribute, has a given value for its status attribute.
Creating a Microsummary - Archive of obsolete content
warning: microsummary support was removed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) a microsummary generator is a set of instructions for creating a microsummary from the content of a page.
...r xmlns="http://www.mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> </transform> </template> </generator> using a simple xslt <template> the xslt processor transforms documents by comparing each xslt <template> element in the transform sheet to a set of nodes in the document.
Dehydra Object Reference - Archive of obsolete content
often, the best way to become familiar with the dehydra objects is to print out the objects: dehydra example code an online tool for pretty-printing dehydra data understanding properties dehydra only sets properties that are applicable.
...dehydra only sets boolean flags when they are true.
Developing New Mozilla Features - Archive of obsolete content
and of course, we have a set of coding practices to help everyone live together.
...this is a painful setting and we hope it doesn’t happen often.
Download Manager preferences - Archive of obsolete content
on other oses the default value is true if a preference is not set when the download manager looks it up, the download manager assumes the default value but doesn't necessarily add the missing preference.
...migration of other browser settings may also set this path.
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
for example: mozilla mozilla = mozilla.getinstance(); windowcreator creator = new windowcreator(); // implements nsiwindowcreator nsiservicemanager servicemanager = mozilla.getservicemanager(); nsiwindowwatcher windowwatcher = (nsiwindowwatcher) servicemanager .getservicebycontractid(ns_windowwatcher_contractid, nsiwindowwatcher.ns_iwindowwatcher_iid); windowwatcher.setwindowcreator(creator); in this example, we have a java class called windowcreator, which implements the nsiwindowcreator interface, and we want to register it with mozilla.
.../ get the nsiwindowwatcher interface to the above nsiwindowcreator windowcreator = (nsiwindowcreator)appstartup.queryinterface(nsiwindowcreator.ns_iwindowcreator_iid); // get the window watcher service nsiwindowwatcher windowwatcher = (nsiwindowwatcher)servicemanager.getservicebycontractid("@mozilla.org/embedcomp/window-watcher;1", nsiwindowwatcher.ns_iwindowwatcher_iid); // set the window creator (from step 6) windowwatcher.setwindowcreator(windowcreator); // create the root xul window: nsidomwindow win = windowwatcher.openwindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null); // set this as the active window windowwatcher.setactivewindow(win); // hand over the application to xpcom/xul, t...
Error Console - Archive of obsolete content
the error console is deprecated in firefox, and is now only made available if you set the devtools.errorconsole.enabled preference to true.
...see setting up extension development environment#development preferences for the preferences you should set if you want to see errors from firefox and extensions in the error console.
Downloading Nightly or Trunk Builds - Archive of obsolete content
box builds", also known as "hourly builds" though it usually takes more than one hour to make one; they are followed by automatic tests and their main purpose is to check that nothing is horridly wrong with the latest change to the source: what they are doing is to constantly check that the current source can be built into an executable and that that executable passes a certain more-or-less fixed set of tests.
...this should provide all the build flags and configuration settings used for building this executable.
Code snippets - Archive of obsolete content
mainwindow.gbrowser.addtab(url); } } partially corrupt a server components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); function deletepath(path) { let resource = new resource(weave.service.storageurl + path); resource.setheader("x-confirm-delete", "1"); return resource.delete(); } // delete meta/global: deletepath("meta/global"); // delete keys: deletepath("crypto/keys"); // delete server: deletepath(""); corrupt a single engine on the server let engine = "bookmarks"; components.utils.import("resource://services-sync/main.js"); components.utils.import("resource://services-sync/resource.js"); components.utils...
... watch live sync logs set services.sync.log.appender.console to trace.
Syncing custom preferences - Archive of obsolete content
the whitelist is determined as follows: for each services.sync.prefs.sync.<pref> preference that is set to true, firefox sync will sync the <pref> preference.
... for example, if your add-on had a pref called extension.frobnaz.foobar, to have it synced, create a bool preference called services.sync.prefs.sync.extension.frobnaz.foobar and set it to true.
GRE - Archive of obsolete content
dependent libraries and environment variables the xulrunner gre is designed so that the embedder does not need to set any environment variables such as path or ld_library_path before calling xpcomgluestartup(), because it dynamically loads the correct dependent libraries.
...embedders will need to set the ld_library_path environment variable and start a new process in order to embed a suite-based gre correctly.
Microsummary topics - Archive of obsolete content
note: when web sites install generators via window.sidebar.addmicrosummarygenerator(), firefox sets their uri attribute to urn:source:sourceurl, where sourceurl is the url from which the generator was downloaded.
...it sets the value of the header to the string microsummary.
Modularization techniques - Archive of obsolete content
ucture is this: struct nsid { pruint32 m0; pruint16 m1, m2; pruint8 m3[8]; }; frequently you see them represented as strings, like this: {221ffe10-ae3c-11d1-b66c-00805f8a2676} to initialize an id struct you declare them like this: id = {0x221ffe10, 0xae3c, 0x11d1, {0xb6, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x26, 0x76}}; why the b66c couplet gets broken up and grouped with the last set of bytes is probably a footnote somewhere.
...iid); int main(int argc, char *argv[]) { nsifactory *factory; getsamplefactory(&factory); nsisample *sample; nsresult res = factory->createinstance(null, kisampleiid, (void **) &sample); if (res == ns_ok) { sample->hello(); ns_release(sample); } return 0; } moving to a dynamically linked library implementing a dll once you've set a factory, moving it to a dll is a relatively trivial thing.
Mozilla Crypto FAQ - Archive of obsolete content
however this ruling did not settle the issue of the constitutionality of u.s.
...a set of ten essays on various aspects of privacy and technological developments affecting it.
How to Write and Land Nanojit Patches - Archive of obsolete content
here's how to clone and build nanojit-central: $ hg clone ssh://hg.mozilla.org/projects/nanojit-central $ cd nanojit-central $ autoconf $ mkdir build $ cd build $ ../configure $ make $ make check learn and setup automated testing for all three repositories.
...at this point the set of changes you are about to push will consist of a sequence of converted revisions from nanojit-central, followed by one of more "fixups" to tr/tm to make them work properly.
Plug-n-Hack Phase1 - Archive of obsolete content
for testing); plug-n-hack requires tool and service manifests to be served from the same origin as the api endpoints but, for testing purposes, ringleader (the firefox addon implementation of the browser component) allows you to set a preference to relax or disable origin checks.
... the preference is ringleader.check.origin this can be set to 'off' to disble origin checks completely, or 'noport' to disable only port checks.
PyDOM - Archive of obsolete content
once you set the script type for a node, it is the default for that node and all children.
... this means that if you set the script-type to python for the window, python is the default script type for all child elements in the window.
Frequently Asked Questions - Archive of obsolete content
this is probably because there is an <embed> or <object> tag in the html page and its 'type' attribute is set to the wrong mime type.
...to be able to use it, you must make sure the svg.enabled pref is set to false.
Safely loading URIs - Archive of obsolete content
all three methods take three arguments: the first argument identifies the source of the uri, the second argument is the uri that one plans to load, and the third argument is a set of flags that can be used to impose additional restrictions on the uris that may be loaded.
... this boolean preference, which defaults to true, can be set to false if the user doesn't want to strictly enforce the same origin policy on file: uris.
File object - Archive of obsolete content
getting started in order to use the file object from your javascript programs, you must enable it by setting the make variable js_has_file_object during the compilation of your spidermonkey engine.
... file.currentdir a file object referring to the current directory; this property may be set.
Actionscript Performance Tests - Archive of obsolete content
similar to the acceptance tests set the environment variables avm, asc, builtinabc.
...# to set vm args (e.g.
Venkman - Archive of obsolete content
using breakpoints in venkman this article describes breakpoints in javascript and how to use venkman to set and examine breakpoints.
...this api augments the existing javascript api, providing clients with a useful set of debugger functionality implemented in c.
Windows Install - Archive of obsolete content
winreg.setrootkey(winreg.hkey_current_user) ;// current_user subkey = "software\\microsoft\\windows\\currentversion\\runonce" ; winreg.createkey(subkey,""); valname = "ren8dot3"; value = fprogram + "ren8dot3.exe " + ftemp + "ren8dot3.ini"; err = winreg.setvaluestring(subkey, valname, value); } } function prepareren8dot3(listlongfilepaths) { var ftemp = getfolder("t...
...h, flongfilepath); binicreated = true; } } if(binicreated) updatewinreg4ren8dot3() ; } return(0); } // main var srdest; var err; var fprogram; srdest = 449; err = initinstall(prettyname, regname, "6.0.0.2000110801"); logcomment("initinstall: " + err); fprogram = getfolder("program"); logcomment("fprogram: " + fprogram); if(verifydiskspace(fprogram, srdest)) { setpackagefolder(fprogram); err = adddirectory("", "6.0.0.2000110801", "bin", // dir name in jar to extract fprogram, // where to put this file // (returned from getfolder) "", // subdir name to create relative to fprogram true); // force flag logcomment("adddirectory() returned: " + err); // check return value if(err == success) { err = performinstall...
execute - Archive of obsolete content
the optional blocking argument, when set to true, specifies that the installation should wait for this executable to finish before processing the next queued install command.
... if you do not set this flag and launch an executable that is not a part of the installation, you will raise an error when you restart the browser.
patch - Archive of obsolete content
description the patch method to update an existing component by applying a set of differences between two known versions.
... the set of differences is in gdiff format and is created by the nsdiff utility.
Return Codes - Archive of obsolete content
read_only -215 the specified file cannot be deleted because its permissions are set to read only.
... package_folder_not_set -224 install folder not set in installation script extraction_failed -225 extraction of xpi file failed.
XPInstall API reference - Archive of obsolete content
ctory 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 enabled getversion install installchrome startsoftwareupdate installversion properties methods compareto init tostring file no properties methods copy ...
...gisterserver windowsshortcut winprofile no properties methods getstring writestring winreg no properties methods createkey deletekey deletevalue enumkeys enumvaluenames getvalue getvaluenumber getvaluestring iskeywritable keyexists setrootkey setvalue setvaluenumber setvaluestring valueexists winregvalue constructor other information return codes see complete list examples trigger scripts and install scripts code samples file.macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate...
afterselected - Archive of obsolete content
« xul reference home afterselected type: boolean this is set to true if the tab is immediately after the currently selected tab.
... this is automatically set when needed and you shouldn't adjust it manually.
autoFillAfterMatch - Archive of obsolete content
« xul reference home autofillaftermatch obsolete since gecko 1.9.1 type: boolean if set to true, the entire text of the best match will be displayed at the end of the input.
...the textbox.autofill attribute must be set to true to use this feature.
autoscroll - Archive of obsolete content
« xul reference home autoscroll type: boolean set to false to disable autoscroll for this browser.
... if this attribute is set to true or omitted, autoscroll will be enabled or depending on the user preference general.autoscroll.
beforeselected - Archive of obsolete content
« xul reference home beforeselected type: boolean this is set to true if the tab is immediately before the currently selected tab.
... this is set automatically set when needed and you shouldn't adjust it manually.
checked - Archive of obsolete content
use hasattribute() to determine whether this attribute is set instead of getattribute().
... for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect.
closebutton - Archive of obsolete content
« xul reference home closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends.
...you can set an image to the "new tab" and "close" buttons by applying them to the tabs-newbutton and tabs-closebutton classes respectively.
command - Archive of obsolete content
« xul reference home command type: id set to the id of a command element that is being observed by the element.
... example <command id="cmd_openhelp" oncommand="alert('help');"/> <button label="help" command="cmd_openhelp"/> <button label="more help" command="cmd_openhelp"/> see also command element, oncommand and commandset ...
container - Archive of obsolete content
« xul reference home container type: boolean set to true if the element is to act as a container which can have child elements.
...this will be set by the template builder as needed.
customizable - Archive of obsolete content
« xul reference home customizable not in seamonkey 1.x type: boolean set this attribute to true on toolbars that can be customized.
... this causes the set of buttons to be persisted across sessions.
defaultButton - Archive of obsolete content
« xul reference home defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
...this should be set to one of the same values as those for the buttons attribute.
dragging - Archive of obsolete content
« xul reference home dragging type: boolean this attribute will be set to true if the column is being dragged.
... this attribute is set automatically; you shouldn't adjust it yourself.
empty - Archive of obsolete content
« xul reference home empty type: boolean set to true if the element is a container that contains no children.
... this will be set by the template builder as needed.
first-tab - Archive of obsolete content
« xul reference home first-tab type: boolean this attribute will be set to true for the first tab.
... this attribute should not be set manually, but is useful in a theme if the first tab should be styled differently.
grippyhidden - Archive of obsolete content
« xul reference home grippyhidden seamonkey only type: boolean when set to true, the grippy will be hidden.
... when set to false, the default, the grippy will be shown.
handleCtrlTab - Archive of obsolete content
« xul reference home handlectrltab type: boolean if set to true or omitted, the tabbox will switch to the next tab when the control and tab keys are pressed.
...if this attribute is set to false, these keys do not navigate between tabs.
hidden - Archive of obsolete content
« xul reference home hidden type: boolean if set to true, the element is not displayed.
... this is similar to setting the css display property to 'none'.
hidecolumnpicker - Archive of obsolete content
« xul reference home hidecolumnpicker type: boolean when set to false, a drop-down will appear in the upper right corner of the tree, which the user may use to show and hide columns.
... when set to true, the column picker will be hidden.
hideheader - Archive of obsolete content
« xul reference home hideheader type: boolean set this to true to indicate that the tree column header should be displayed without any column header styling.
... if you don't set a label for that column either, the header is not displayed at all.
last-tab - Archive of obsolete content
« xul reference home last-tab type: boolean this attribute will be set to true for the last tab.
... this attribute should not be set manually, but is useful in a theme if the last tab should be styled differently.
next - Archive of obsolete content
ArchiveMozillaXULAttributenext
« xul reference home next type: id set to the pageid of the next wizardpage after this one.
... when set, the page with this pageid is displayed when the next button is pressed.
noautohide - Archive of obsolete content
« xul reference home noautohide type: boolean if this attribute is set to false or omitted, the tooltip will automatically disappear after a few seconds.
... if this attribute is set to true, this will not happen and the tooltip will only hide when the user moves the mouse to another element.
oninput - Archive of obsolete content
example <!-- this sets the label's text to the textbox value on each keystroke.
... --> <script language="javascript"> function setlabel(txtbox){ document.getelementbyid('lbl').value = txtbox.value; } </script> <label id="lbl"/> <textbox oninput="setlabel(this);"/> this is similar to the onkeypress event used in html documents.
pending - Archive of obsolete content
« xul reference home pending type: boolean this attribute is set to true if the tab is currently in the process of being restored by the session store service.
...if the user has turned on the "don't load tabs until selected" preference, the pending attribute is set on tabs until they get loaded.
persistence - Archive of obsolete content
« xul reference home persistence type: integer the persistence may be set to a non-zero value so that the notificationbox's removetransientnotifications method does not remove them.
... this may be used to close a set of notifications as a group without affecting other notifications.
primary - Archive of obsolete content
« xul reference home primary type: boolean if set to true, the treecol will have indentation and twisties drawn to the left of it to indicate the hierarchy level of the rows.
... 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.
script.type - Archive of obsolete content
usually, you would set this to application/javascript.
... note: if the javascript file is in chrome://, setting this attribute to application/javascript will always use the latest available javascript version.
searchSessions - Archive of obsolete content
« xul reference home searchsessions obsolete since gecko 26 type: space-separated list of session names set to a keyword indicating what type of data to look up for autocomplete.
... you may set multiple types by separating their names by spaces.
statustext - Archive of obsolete content
« xul reference home statustext type: string used to set the text that appears on the status bar when the user moves the mouse over the element.
... example <!-- sets the status message when mouse is over buttons --> <button label="connect" statustext="connect to remote server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <button label="ping" statustext="ping the server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <statusbar> <statusbarpanel id="mystatuspanel" label="" flex="1"/> <spacer flex="1"/> </statusbar> <script> function setstatusmessage(obj){ document.getelementbyid('mystatuspanel').label = obj.getattribute('statustext'); } function clearstat...
titlebar - Archive of obsolete content
« xul reference home titlebar type: string set the panel's titlebar attribute to the value normal to display a panel with a titlebar.
... the noautohide attribute must be set to true.
toolbarbutton.type - Archive of obsolete content
you can set this attribute to the value menu to create a button with a menu popup.
... menu: set the type attribute to the value menu to create a button with a menu popup.
tooltip - Archive of obsolete content
« xul reference home tooltip type: id should be set to the value of the id of the tooltip or panel element that should be used as a tooltip window when the mouse hovers over the element for a moment.
...if this attribute is set to '_child', the first tooltip child element inside the element is used.
treecol.src - Archive of obsolete content
« xul reference home src type: uri set this attribute to have the treecol element use an image for the header instead of a label.
...set this to the url of an image to appear on the tree column header.
visuallyselected - Archive of obsolete content
the visuallyselected attribute is set asynchronously, once the browser has switched to the selected tab.
...to change the selection, set either the selectedindex or selecteditem property of the containing element.
wait-cursor - Archive of obsolete content
« xul reference home wait-cursor type: boolean set this attribute to true to have the cursor switch to a waiting cursor while the mouse is hovering over the element.
... see also https://developer.mozilla.org/docs/talk:xul/attribute/wait-cursor this seems to work instead of trying to set a wait-cursor attribute: window.setcursor('wait') and window.setcursor('auto') ...
Dynamically modifying XUL-based user interface - Archive of obsolete content
you may also have used other calls, such as element.setattribute(), or, if you wrote an extension, the addeventlistener() method.
... function createmenuitem(alabel) { const xul_ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var item = document.createelementns(xul_ns, "menuitem"); // create a new xul menuitem item.setattribute("label", alabel); return item; } var popup = document.getelementbyid("mypopup"); // a <menupopup> element var first = createmenuitem("first item"); var last = createmenuitem("last item"); popup.insertbefore(first, popup.firstchild); popup.appendchild(last); you can also use appendchild() and insertbefore() to move existing elements.
Working With Directories - Archive of obsolete content
thus, you do not have to create a series of directories individually, the set will all be created if needed.
...the result is that lastmod will be set to the file with the latest modification time.
Reading from Files - Archive of obsolete content
the first argument is the file to read from, and the second is a set of flags which control the reading.
...for a list of supported character encodings, see supported character sets.
Uploading and Downloading Files - Archive of obsolete content
the formdata object can then simply be passed to xmlhttprequest: function upload(posturl, fieldname, filepath) { var formdata = new formdata(); formdata.append(fieldname, new file(filepath)); var req = new xmlhttprequest(); req.open("post", posturl); req.onload = function(event) { alert(event.target.responsetext); }; req.send(formdata); } http put you can also upload a file using an http put operation.
... function uploadput(posturl, filepath) { var req = new xmlhttprequest(); req.open("put", posturl); req.setrequestheader("content-type", "text/plain"); req.onload = function(event) { alert(event.target.responsetext); } req.send(new file(filepath)); } in this example, a new input stream is created for a file, and is passed to the xmlhttprequest's send method.
List of commands - Archive of obsolete content
browser:searchinternet browser:sendpage browser:uploadfile cmd_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 cm...
...d_neweditortemplate cmd_newnavigator cmd_newnavigatortab cmd_newtabwithtarget cmd_openhelp cmd_paste - paste a selection 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 .
advanceSelectedTab - Archive of obsolete content
« xul reference home advanceselectedtab( dir, wrap ) return type: no return value if the argument dir is set to 1, the currently selected tab changes to the next tab.
... if the argument dir is set to -1, the currently selected tab changes to the previous tab.
getElementsByAttribute - Archive of obsolete content
« xul reference home getelementsbyattribute( attrib, value ) return type: dom nodelist returns a nodelist of all the child elements of the element that have the attribute given by the first argument set to the value given by the second argument.
... if the second argument is '*', the method will match the given attribute set to any value.
getElementsByAttributeNS - Archive of obsolete content
if the namespace (first argument) is set to '*', elements with any attribute namespace will be retrieved.
... if the third argument is '*', the elements retrieved may have the attribute (second argument) set to any value.
loadURIWithFlags - Archive of obsolete content
« xul reference home loaduriwithflags( uri, flags, referrer, charset, postdata ) return type: no return value load a url into the document, with the specified load flags, the given referrer, character set, and post data.
...the http referer header is set accordingly.
openPopup - Archive of obsolete content
to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored.
... x, y for an anchored popup, the x and y arguments may be used to offset the popup from its anchored position by some number, measured in css pixels.
replaceGroup - Archive of obsolete content
« xul reference home replacegroup( group ) not in firefox return type: array of session history objects replaces existing tabs with a new set.
...a referreruri property may also be optionally used to set the referrer page.
showPopup - Archive of obsolete content
if either x or y are set to values, the popup will appear at the screen coordinate (x,y).
... to have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the boxobject.screenx and boxobject.screeny properties of the element, and use those as the x and y arguments offset by the desired values.
Floating Panels - Archive of obsolete content
when set to true, the popup will not close when the user clicks outside of it, nor when the user presses the escape key.
...a label for the titlebar may be set using the label attribute, as in the following example: <panel id="info-panel" noautohide="true" titlebar="normal" label="image properties"> closing a floating panel unlike other panels, a floating panel does not close when clicking outside of it.
buttons - Archive of obsolete content
you can set its label with the buttonlabelextra1 attribute and its command with the ondialogextra1 attribute.
...you can set its label with the buttonlabelextra2 attribute and its command with the ondialogextra2 attribute.
defaultButton - Archive of obsolete content
« xul reference defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
...this should be set to one of the same values as those for the buttons attribute.
maxWidth - Archive of obsolete content
« xul reference maxwidth type: integer gets and sets the value of the maxwidth attribute.
...use the size to set the maximum width of input fields.
menu.open - Archive of obsolete content
« xul reference open type: boolean this property will be set to true when the menu is open.
... the menu may be opened by setting the open property to true and closed by setting it to false.
next - Archive of obsolete content
ArchiveMozillaXULPropertynext
« xul reference next type: string wizardpage id set to the pageid of the next page after this one.
... when set, the page with this pageid is displayed when the next button is pressed.
richlistitem.label - Archive of obsolete content
does not support setting label values.
... use the child elements directly to set label text.
smoothScroll - Archive of obsolete content
« xul reference smoothscroll type: boolean can be set to enable or disable smooth scrolling for the corresponding arrowscrollbox.
... if not set explicitly, it will fall back to the smoothscroll attribute and then to the toolkit.scrollbox.smoothscroll preference.
tag - Archive of obsolete content
ArchiveMozillaXULPropertytag
« xul reference tag type: tag name this may be set to a tag name.
... if set, the conditions will only match if the template builder is parsing content for an element directly inside this tag.
value - Archive of obsolete content
ArchiveMozillaXULPropertyvalue
« xul reference value type: string gets and sets the value of the value attribute.
... for textbox and user editable menulist elements, the contents, as visible to the user, are read and set using the textbox.value and menulist.value syntax.
Property - Archive of obsolete content
clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customtoolbarcount database datasources date dateleadingzero datevalue decimalplaces decimalsymbol defaultbutton defaultvalue description dir disableautocomplete disableautocomplete disableautoselect disabled disablekeynavigation dlgtype docshell documentcharsetinfo editable editingcolumn editingrow editingsession editor editortype ...
... selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxobject type uri useraction value valuenumber view webbrowserefind webnavigation webprogress width wizardpages wraparound year yearleadingzero related dom element properties dom:element.attributes dom:element.baseuri dom:element.childelementcount dom:element.childnodes dom:element.children dom:element.clientheight d...
listcell-iconic - Archive of obsolete content
note that both an image and a label are added when this style is set.
... the label will take up extra space even when no label text is set.
Introduction - Archive of obsolete content
the template syntax allows for different rules to generate different content based on particular criteria as well as set attribute values from returned results.
...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.
Result Generation - Archive of obsolete content
eventually, you will end up with a set of nodes you consider the endpoints of your query.
...so, to summarize: start out with a one possible result as the seed iterate over the results determined so far and augment them with additional data add any new possible results remove any rejected results repeat steps 2 to 4 for each query statement once done, all remaining results become matches each possible result is made up of a set of variable-value pairs.
The Joy of XUL - Archive of obsolete content
xul provides a rich set of ui components.the user interface for the calendar is written entirely in xul, javascript, and css, which is a testament to the power and flexibility of this application building framework.
...developers who are equipped with the software and knowledge required to compile mozilla can set an optional environment variable and build the calendar themselves.
Adding Buttons - Archive of obsolete content
disabled if this attribute is set to true, the button is disabled.
... accesskey this should be set to a letter that is used as a shortcut key.
Creating Dialogs - Archive of obsolete content
the following values may be used, seperated by commas: accept - an ok button cancel - a cancel button help - a help button disclosure - a disclosure button, which is used for showing more information you can set code to execute when the buttons are pressed using the ondialogaccept, ondialogcancel, ondialoghelp and ondialogdisclosure attributes.
... example dialog with more features <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel" buttonlabelaccept="set favourite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog" description="example dialog"/> <groupbox flex="1"> <c...
Localization - Archive of obsolete content
type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> <!doctype window system "chrome://findfile/locale/findfile.dtd"> <window id="findfile-window" title="&findwindow.title;" persist="screenx screeny width height" orient="horizontal" onload="initsearchlist()" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="findfile.js"/> <popupset> <menupopup id="editpopup"> <menuitem label="&cutcmd.label;" accesskey="&cutcmd.accesskey;"/> <menuitem label="&copycmd.label;" accesskey="&copycmd.accesskey;"/> <menuitem label="&pastecmd.label;" accesskey="&pastecmd.accesskey;" disabled="true"/> </menupopup> </popupset> <keyset> <key id="cut_cmd" modifiers="accel" key="&cutcmd.commandkey;"/> <key id="copy_cmd" modifi...
...ers="accel" key="&copycmd.commandkey;"/> <key id="paste_cmd" modifiers="accel" key="&pastecmd.commandkey;"/> <key id="close_cmd" keycode="vk_escape" oncommand="window.close();"/> </keyset> <vbox flex="1"> <toolbox> <menubar id="findfiles-menubar"> <menu id="file-menu" label="&filemenu.label;" accesskey="&filemenu.accesskey;"> <menupopup id="file-popup"> <menuitem label="&opencmd.label;" accesskey="&opencmd.accesskey;"/> <menuitem label="&savecmd.label;" accesskey="&savecmd.accesskey;"/> <menuseparator/> <menuitem label="&closecmd.label;" accesskey="&closecmd.accesskey;" key="close_cmd" oncommand="window.close();"/> </menupopup> </menu> <menu id="edit-menu" label="&...
Manifest Files - Archive of obsolete content
packages a package is a set of xul files and scripts that define the functionality of a user interface.
...the following describes how to set up a package for earlier versions.
Persistent Data - Archive of obsolete content
this method has the advantage that it works with mozilla user profiles, so that each user can have different settings.
...the persist attribute should be set to a space-separated list of attributes of the element that you want to save.
Skinning XUL Files by Hand - Archive of obsolete content
a button is styled by the global skin when its class attribute is set to a class which is defined in the global skin.
... reading the global skin it's very important to familiarize yourself with the basic style definitions in the global skin before you set out creating your own stylesheet.
Tree Box Objects - Archive of obsolete content
the doscroll() function gets the box object and calls the scrolltorow() function with an argument set to the value of the textbox.
...if the coordinate is not over a row, the row value will be set to -1.
Using Spacers - Archive of obsolete content
you'll notice that the cancel button in the dialogs has always set its width so that it fits the text inside it.
...what if you want to set one element to grow twice as large an another?
XBL Inheritance - Archive of obsolete content
<textbox type="autocomplete" searchsessions="history"/> set the type to autocomplete to add the autocomplete feature to an existing textbox.
... set the searchsessions to indicate what type of data to look up.
XPCOM Interfaces - Archive of obsolete content
an interface in mozilla is a definition of a set of functionality that could be implemented by components.
...services provide general functions which either get or set global data or perform operations on other objects.
assign - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
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.
... when set to false, the default, the toolbar is visible.
binding - Archive of obsolete content
ties object, predicate, subject examples fixme: (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties object type: string the object of the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related tbd ...
column - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, rows, row ...
columns - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, column, rows, row.
conditions - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
dialogheader - Archive of obsolete content
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements dialog, window ...
dropmarker - Archive of obsolete content
examples properties accessibletype attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
elements - Archive of obsolete content
a action arrowscrollbox b bbox binding bindings box broadcaster broadcasterset button browser c checkbox caption colorpicker column columns commandset command conditions content d deck description dialog dialogheader e editor grid grippy groupbox h hbox i iframe image k key keyset l label listbox listcell listcol listcols listhead listheader listitem m member menu menubar menuitem menulist menupopup menuseparator o observes overlay p page popup popupset preference preferences prefpane prefwindow progressmeter r radio radiogroup resizer richlistbox richlistitem resizer row rows rule s script scrollbar scrollbox scrollcorn...
...er separator spacer splitter stack statusbar statusbarpanel stringbundle stringbundleset t tab tabbrowser tabbox tabpanel tabpanels tabs template textnode textbox titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple v vbox w window wizard wizardpage ...
grid - Archive of obsolete content
ArchiveMozillaXULgrid
p> </menulist> </row> </rows> </grid> </groupbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements columns, column, rows, row.
grippy - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
hbox - Archive of obsolete content
ArchiveMozillaXULhbox
ex="1"/> <button label="connect"/> <button label="ping"/> </hbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, vbox ...
image - Archive of obsolete content
ArchiveMozillaXULimage
src type: url gets and sets the value of the src attribute.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata style classes alert-icon class that adds an alert icon.
listcol - Archive of obsolete content
bel="john"/> <listcell label="painter"/> </listitem> </listbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcols, listhead, listheader, listitem ...
listcols - Archive of obsolete content
bel="john"/> <listcell label="painter"/> </listitem> </listbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements listbox, listcell, listcol, listhead, listheader, listitem ...
member - Archive of obsolete content
properties child, container examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties child type: ?
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
page - Archive of obsolete content
ArchiveMozillaXULpage
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
preferences - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes ...
query - Archive of obsolete content
ArchiveMozillaXULquery
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
row - Archive of obsolete content
ArchiveMozillaXULrow
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, column, rows.
rows - Archive of obsolete content
ArchiveMozillaXULrows
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements grid, columns, column, row.
scrollbox - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollcorner - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
separator - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata style classes the following classes may be used to style the element.
spacer - Archive of obsolete content
label="left"/> <spacer flex="1"/> <button label="right"/> </box> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements separator, splitter ...
spinbuttons - Archive of obsolete content
attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
statusbar - Archive of obsolete content
ned" value="82"/> <statusbarpanel label="right panel"/> </statusbar> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements statusbarpanel interfaces nsiaccessibleprovider ...
tabpanel - Archive of obsolete content
examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tabbox, tabs, tab, tabpanels.
textnode - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
toolbargrippy - Archive of obsolete content
properties accessible examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessible type: nsiaccessible returns the accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbaritem - Archive of obsolete content
utton2" class="toolbarbutton-1" label="labe2l" /> </toolbaritem> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarpalette - Archive of obsolete content
ext;" oncommand="somefunction()"/> </toolbarpalette> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarseparator, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarseparator - Archive of obsolete content
tor /> <toolbarbutton label="button 2"/> </toolbar> </toolbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarset, toolbarspacer, toolbarspring, toolbox ...
toolbarspacer - Archive of obsolete content
properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspring, toolbox interfaces nsiaccessibleprovider ...
toolbarspring - Archive of obsolete content
properties accessibletype examples (example needed) attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements toolbar, toolbarbutton, toolbargrippy, toolbaritem, toolbarpalette, toolbarseparator, toolbarset, toolbarspacer, toolbox interfaces nsiaccessibleprovider ...
treechildren - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata example <tree flex="1"> <treecols> <treecol id="sender" label="sender" flex="1"/> <treecol id="subject" label="subject" flex="2"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> </treer...
treecols - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties accessibletype type: integer a value indicating the type of accessibility object for the element.
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements tree, treecol, treechildren, treeitem, treerow, treecell and treeseparator.
triple - Archive of obsolete content
inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
vbox - Archive of obsolete content
ArchiveMozillaXULvbox
acer flex="1"/> <label value="one"/> <label value="two"/> </vbox> attributes inherited from xul element align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, databas...
..., getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related elements box, hbox ...
Deploying XULRunner - Archive of obsolete content
an example of one such solution may be found in the article: creating a windows inno setup installer for xulrunner applications.
... edit this as you need to, but cfbundleexecutable must be xulrunner, and cfbundleiconfile and cfbundleurliconfile should be set to the filename of your application icon (app_icon.icns).
Dialogs in XULRunner - Archive of obsolete content
here is an example xul dialog: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="mydialog" title="my dialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="window.sizetocontent();" buttons="accept,cancel" buttonlabelaccept="set favorite" buttonaccesskeyaccept="s" ondialogaccept="return dosave();" buttonlabelcancel="cancel" buttonaccesskeycancel="n" ondialogcancel="return docancel();"> <script> function dosave(){ //dosomething() return true; } function docancel(){ return true; } </script> <dialogheader title="my dialog" description="example ...
...firefox and thunderbird both support nearly native page setup and print dialogs.
Using LDAP XPCOM with XULRunner - Archive of obsolete content
moz_dll_suffix; nsresult nsgetmodule(nsicomponentmanager* acompmgr, nsifile* alocation, nsimodule* *aresult) { nsresult rv; nscomptr<nsifile> libraries; rv = alocation->getparent(getter_addrefs(libraries)); if (ns_failed(rv)) return rv; nscomptr<nsilocalfile> library(do_queryinterface(libraries)); if (!library) return ns_error_unexpected; library->setnativeleafname(ns_literal_cstring("libraries")); library->appendnative(ns_literal_cstring("dummy")); // loop through and load dependent libraries for (char const *const *dependent = kdependentlibraries; *dependent; ++dependent) { library->setnativeleafname(nsdependentcstring(*dependent)); prlibrary *lib; library->load(&lib); // 1) we don't care if this failed!
... } library->setnativeleafname(ns_literal_cstring(krealcomponent)); prlibrary *lib; rv = library->load(&lib); if (ns_failed(rv)) return rv; nsgetmoduleproc getmoduleproc = (nsgetmoduleproc) pr_findfunctionsymbol(lib, ns_get_module_symbol); if (!getmoduleproc) return ns_error_failure; return getmoduleproc(acompmgr, alocation, aresult); } then change your .mozconfig to add this line: ac_add_options --enable-extensions=ldapstub rebuild xulrunner.
MacFAQ - Archive of obsolete content
need is the window.arguments[0]) <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="myxul_hidden" windowtype="myxul:hiddenwindow" title="" width="0" height="0" persist="screenx screeny width height sizemode" > <!-- load the mozilla helpers --> <script type="application/javascript" src="chrome://global/content/nsusersettings.js" /> <script><![cdata[ function debug(alogstring) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) mconsoleservice.logstringmessage("myxul: " + alogstring + "\n"); } function checkotherwindows() { var singletonwindowtype = nspreferences.copyunicha...
....arguments && window.arguments[0]){ try { var cmdline = window.arguments[0] .queryinterface(components.interfaces.nsicommandline); for (var i = 0; i < cmdline.length; ++i) { debug(cmdline.getargument(i)) } } catch(ex) { debug(window.arguments[0]) // do something with window.arguments[0] //nspreferences.setunicharpref("myxul.cmdlinevalue", window.arguments[0]) } window.addeventlistener("load", checkotherwindows , false); } ]]></script> </window> ...
Opening a Link in the Default Browser - Archive of obsolete content
to suppress this warning for particular protocols that are safe to open in the default application, you must set default prefs (thunderbird sets the following prefs): // suppress external-load warning for standard browser schemes pref("network.protocol-handler.warn-external.http", false); pref("network.protocol-handler.warn-external.https", false); pref("network.protocol-handler.warn-external.ftp", false); you can also check whether an external handler for a scheme exists.
... it: var extps = components.classes["@mozilla.org/uriloader/external-protocol-service;1"] .getservice(components.interfaces.nsiexternalprotocolservice); if (extps.externalprotocolhandlerexists("http")) { // handler for http:// urls exists } link within an iframe to enable a link inside an html document that is the "src" of an iframe to be opened in the default browser, setting the preference: pref("network.protocol-handler.expose-all", false); seems to work.
Specifying Startup Chrome Window - Archive of obsolete content
an application wishing to have only one main window should set the toolkit.singletonwindowtype preference and specify the windowtype attribute on the main application window.
...this default can be changed by setting the toolkit.defaultchromefeatures preference.
Using SOAP in XULRunner 1.9 - Archive of obsolete content
etween jqsoapclient.js and sasoapclient.js 42c42 < var jsout = $.xmltojson(xdata.responsexml); --- > var jsout = xmlobjectifier.xmltojson(xdata.responsexml); 46,60c46,62 < $.ajax({ < type: "post", < url: soapclient.proxy, < datatype: "xml", < processdata: false, < data: content, < complete: getresponse, < contenttype: soapclient.contenttype + "; charset=\"" + soapclient.charset + "\"", < beforesend: function(req) { < req.setrequestheader("method", "post"); < req.setrequestheader("content-length", soapclient.contentlength); < req.setrequestheader("soapserver", soapclient.soapserver); < req.setrequestheader("soapaction", soapreq.action); < } < }); --- > var xhr = new xmlhttprequest(); > xhr.mozbackgroun...
...drequest = true; > xhr.open('post', soapclient.proxy, true); > xhr.onreadystatechange = function() { > if (4 != xhr.readystate) { return; } > getresponse(xhr); > }; > var headers = { > 'method': 'post', > 'content-type': soapclient.contenttype + '; charset="' + > soapclient.charset + '"', > 'content-length': soapclient.contentlength, > 'soapserver': soapclient.soapserver, > 'soapaction': soapreq.action > }; > for (var h in headers) { xhr.setrequestheader(h, headers[h]); } > xhr.send(content); ...
ant script to assemble an extension - Archive of obsolete content
the current page in your blogmarks"/> xpi file is created after "chrome/blogmark.jar" is created, which is then stuffed into "blogmark.xpi" <target name="createxpi" depends="createjar" description="assemble the final build blogmark.xpi"> <zip destfile="blogmark-${version}.xpi"> <zipfileset dir="." includes="chrome/blogmark.jar" /> <zipfileset dir="." includes="install.rdf" /> </zip> </target> everything inside the chrome directory is zipped into chrome/blogmark.jar <target name="createjar" depends="templates" description="assemble the jar"> <jar destfile="chrome/blogmark.jar"> <fil...
...eset dir="chrome/"> <include name="**/*"/> <exclude name="**/*~"/> <exclude name="**/*.tpl.*"/> <exclude name="blogmark.jar"/> </fileset> </jar> </target> <target name="templates" description="generate files from templates."> <copy file="chrome/content/blogmark/contents.rdf.tpl.xml" tofile="chrome/content/blogmark/contents.rdf" overwrite="true"> <filterchain> <replacetokens> <token key="version" value="${version}"/> <token key="des...
2006-10-13 - Archive of obsolete content
he has disabled xft and has tried looking at related postings by benjamin smedberg gcc-40-workarounds and gcc-and-visibility-one-step-forward-hit-a-brick-wall announcements please help us test the new tinderbox and bonsai server installations paul reed announced that they are setting up a new installation of the tinderbox and bonsai servers onto new, supported hardware.
... some testing and validation has been done, but they would like other people to look at the installations and complete the setup before they switch over.
2006-11-03 - Archive of obsolete content
originally posted on november 1st: dale dale has set up a windows machine in order to perform mozilla builds but has been unsuccessful to do so.
...paul explains that his goal is to do only singular sets of builds where the coverage of all the platforms is constant.
2006-11-24 - Archive of obsolete content
gecko 1.9 intl rendering peformance november 20th: boris zbarskyannounced that: we need to create an intl performance page set or multiple intl performance page sets and run at least the pageload tests for all of these pagesets, and preferably also some sort of dhtml tests using pages of the different types.
... he stated that the goal here is that once the tests are set up we can do a gecko 1.8 baseline so that we know what our performance goals for gecko 1.9 are.
2006-11-03 - Archive of obsolete content
firefox table captions discussion on how ie displays captions depending on the size of the content while ff uses a default setting.
... perf question (reflow branch) a look into bug #352367 and the mention of possibly reducing the number of times nsframe::intrinsicwidthoffsets is called for each cell within a table.
2006-12-24 - Archive of obsolete content
discussions [reset issue for overflow='hidden' in ie and opera there is a very modest horizontal shift of the document due to reflow associated with the removal of the vertical scroll bar (because the document content is using a horizontal centering style).
... but in firefox the document is reset (shifted both horizontally and vertically) to its 0,0 position before being centered horizontally.
2006-12- 02 - Archive of obsolete content
discussions [reset issue for overflow='hidden' in ie and opera there is a very modest horizontal shift of the document due to reflow associated with the removal of the vertical scroll bar (because the document content is using a horizontal centering style).
... but in firefox the document is reset (shifted both horizontally and vertically) to its 0,0 position before being centered horizontally.
NPN_PostURL - Archive of obsolete content
to post to a temporary file, set the flag file to true, the buffer buf to the path name string for a file, and len to the length of the path string.
... to post data from a memory buffer, set the flag file to false, the buffer buf to the data to post, and len to the length of buffer.
NPObject - Archive of obsolete content
npobject behavior is implemented using the set of callback functions defined in npclass.
... functions npn_createobject() npn_retainobject() npn_releaseobject() npn_invoke() npn_invokedefault() npn_evaluate() npn_getproperty() npn_setproperty() npn_removeproperty() npn_hasproperty() npn_hasmethod() npn_setexception() see also npclass ...
NPP_NewStream - Archive of obsolete content
the plugin should set this value to request a mode for the stream.
... implementation note: some plugins, notably silverlight, do not set this outparam, and rely on the outparam being initialized to a default np_normal value.
NPStream - Archive of obsolete content
end offset in bytes of the end of the stream (equivalent to the length of the stream in bytes).
... for these streams, notifydata is set to the value of the notifydata parameter to npn_geturlnotify or npn_posturlnotify.
Adobe Flash - Archive of obsolete content
example 2 shows the use of macromedia flash's setvariable method being invoked from javascript.
... var myflash = document.getelementbyid("myflash").setvariable("myvar", sendtext); a more expanded code example that shows how example 2 was created is shown in this source listing.
SAX - Archive of obsolete content
to create one, use the following code: var xmlreader = components.classes["@mozilla.org/saxparser/xmlreader;1"] .createinstance(components.interfaces.nsisaxxmlreader); after you created the sax parser, you need to set the handlers for the events you're interested in and fire off the parsing process.
... set the handlers handlers are user-defined objects implementing sax handler interfaces, depending on what kind of information they need to get from the parser.
Encryption and Decryption - Archive of obsolete content
the rsa cipher used for public-key encryption, for example, can use only a subset of all possible values for a key of a given length, due to the nature of the mathematical problem on which it is based.
... other ciphers, such as those used for symmetric key encryption, can use all possible values for a key of a given length, rather than a subset of those values.
Solaris 10 Build Prerequisites - Archive of obsolete content
/opt/jdsbld/bin/env.sh to import the jds cbe settings into your environment.
...--- env.sh.orig tue jul 1 02:38:35 2008 +++ env.sh tue jun 24 01:08:01 2008 @@ -95,7 +95,8 @@ echo setting ld=$ld export ld -path="$cbe_prefix/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/sbin:/bin:/usr /sfw/bin:$ccdir" +path="/opt/sfw/bin:$cbe_prefix/bin:/usr/ccs/bin:/usr/gnu/bin:/usr/bin:/usr/s bin:/bin:/usr/sfw/bin:$ccdir" test "x$jds_cbe_env_quiet" != x1 && \ echo setting path=$path export path +export pkg_config_path=/opt/sfw/lib/pkgconfig:/usr/lib/pkgconfig 3.
Theme changes in Firefox 3.5 - Archive of obsolete content
you might have to set the width and height of .checkbox-check and .radio-check to 16px to avoid that problem.
...if you don't want the shadow, you can turn it off by setting the new -moz-window-shadow css property to none on the affected element.
-moz-border-bottom-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-bottom-colors css property sets a list of colors for the bottom border.
... /* single <color> value */ -moz-border-bottom-colors: #f0f0f0; /* multiple <color> values */ -moz-border-bottom-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-bottom-colors: inherit; -moz-border-bottom-colors: initial; -moz-border-bottom-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in.
-moz-border-left-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-left-colors css property sets a list of colors for the left border.
... /* single <color> value */ -moz-border-left-colors: #f0f0f0; /* multiple <color> values */ -moz-border-left-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-left-colors: inherit; -moz-border-left-colors: initial; -moz-border-left-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in.
-moz-border-right-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-right-colors css property sets a list of colors for the right border.
... /* single <color> value */ -moz-border-right-colors: #f0f0f0; /* multiple <color> values */ -moz-border-right-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-right-colors: inherit; -moz-border-right-colors: initial; -moz-border-right-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in.
-moz-border-top-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-top-colors css property sets a list of colors for the top border.
... /* single <color> value */ -moz-border-top-colors: #f0f0f0; /* multiple <color> values */ -moz-border-top-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-top-colors: inherit; -moz-border-top-colors: initial; -moz-border-top-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color specified in this property, from the outside in.
-ms-scroll-chaining - Archive of obsolete content
in this case the image container has its -ms-scroll-chaining property set to chained, which means that when a user is scrolling through a nested scrollable element and it hits its boundary the parent scrollable element will begin to scroll in the same direction.
... had the -ms-scroll-chaining property been set to none, the user would observe a bounce effect when the nested element reaches its boundary.
-ms-scroll-translation - Archive of obsolete content
by setting the -ms-scroll-translation property to vertical-to-horizontal, you are specifying that vertical scroll events should be interpreted as their corresponding horizontal scroll events.
... the default css templates for windows apps using javascript, "ui-light.css" and "ui-dark.css", set this property to vertical-to-horizontal by default on the <html> element.
::-ms-clear - Archive of obsolete content
syntax ::-ms-clear example html <form> <label for="firstname">first name:</label> <input type="text" id="firstname" name="firstname" placeholder="first name"> <br> <label for="lastname">last name:</label> <input type="text" id="lastname" name="lastname" placeholder="second name"> </form> css input, label { display: block; } input[type=text]::-ms-clear { color: red; /* this sets the cross color as red.
... */ /* the cross can be hidden by setting the display attribute as "none" */ } result the following screenshot shows what the feature will look like: specifications not part of any specification.
::-ms-fill - Archive of obsolete content
(a progress bar is determinate if it has a value attribute set; otherwise it is indeterminate.
...by setting animation-name on ::-ms-fill, you can change the animation, as shown in this table: value description none turns off the animation so that no dots are displayed.
::-ms-track - Archive of obsolete content
to do so would create three sets of tick marks, but the best user experience is one set.
... to remove tick marks altogether, set the color property to transparent.
Array.unobserve() - Archive of obsolete content
the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers.
... the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer.
ActiveXObject - Archive of obsolete content
to use the activexobject, you may need to adjust security settings in internet explorer for the relevant security zone.
... for example, for the local intranet zone, you typically need to change a custom setting to "initialize and script activex controls not marked as safe for scripting." to identify members of an automation object that you can use in your code, you may need to use a com object browser, such as the ole/com object viewer, if no reference documentation is available for the automation object.
Enumerator.moveFirst - Archive of obsolete content
the enumerator.movefirst method resets the current item in the collection to the first item.
... if there are no items in the collection, the current item is set to undefined.
New in JavaScript 1.8.1 - Archive of obsolete content
new features in javascript 1.8.1 object.getprototypeof() support for native json string.prototype.trim() string.prototype.trimleft() string.prototype.trimright() changed functionality in javascript 1.8.1 implicit setting of properties in object and array initializers no longer execute setters in javascript.
... this makes the behavior of setting the values of properties more predictable.
New in JavaScript 1.8.5 - Archive of obsolete content
bug 429507 new ecmascript5 features get and set operators now allows the identifier to be numeric or a string.
... other standardization work various non-standard syntaxes for defining getters and setters have been removed; ecmascript 5 defined syntax has not been changed.
Object.unobserve() - Archive of obsolete content
the object.unobserve() method was used to remove observers set by object.observe(), but has been deprecated and removed from browsers.
... the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer.
Object.prototype.unwatch() - Archive of obsolete content
you can usually use setters and getters or proxies instead.
... the unwatch() method removes a watchpoint set with the watch() method.
Archived JavaScript Reference - Archive of obsolete content
you can use the more general proxy object instead.array.unobserve()the array.unobserve() method was used to remove observers set by array.observe(), but has been deprecated and removed from browsers.
...led on an object, but this function is no longer available.object.prototype.__parent__the __parent__ property used to point to an object's context, but it has been removed.object.prototype.eval()the object.eval() method used to evaluate a string of javascript code in the context of an object, however, this method has been removed.object.prototype.unwatch()the unwatch() method removes a watchpoint set with the watch() method.object.prototype.watch()the watch() method watches for a property to be assigned a value and runs a function when that occurs.object.unobserve()the object.unobserve() method was used to remove observers set by object.observe(), but has been deprecated and removed from browsers.
Packages - Archive of obsolete content
examples example: javascript function to create a java dialog box the following javascript function creates a java dialog box: function createwindow() { var theowner = new packages.java.awt.frame(); var thewindow = new packages.java.awt.dialog(theowner); thewindow.setsize(350, 200); thewindow.settitle("hello, world"); thewindow.setvisible(true); } in the previous example, the function instantiates thewindow as a new packages object.
... the setsize, settitle, and setvisible methods are all available to javascript as public methods of java.awt.dialog.
background-size - Archive of obsolete content
feel free to put it inside, nothing is set in stone.
... and anyway, it's more the -moz-border-image that seems to be the problem - that gets inherited even if i add in -moz-border-image: none, to <body> or <html>, and setting the height to 100% is more a matter of covering it up rather than stopping it happening (see further examples a, b and c - b and c look ok, but adding margin or padding reveals that the image applies to both <body> and <html> even though explicitly set to none) user:robertc 2009-08-14 see also bug 509681 and bug 497995.
Reference - Archive of obsolete content
a subset of the "object > (function, everything else)" chain could be object > function > (object, function, array, string, boolean, number, date, regexp, error).
...the confusion sets in when you consider that object is also a constructor function, therefore an instance of function, and, furthermore, an instance of object; this is where the recursion is introduced, and why you can infinitely do function.constructor; //function function.constructor.constructor; //function .
Correctly Using Titles With External Stylesheets - Archive of obsolete content
to quote from html 4.01 specification, section 14.3.1: to make a style sheet persistent, set the rel attribute to "stylesheet" and don't set the title attribute.
... to make a style sheet preferred, set the rel attribute to "stylesheet" and name the style sheet with the title attribute.
Popup Window Controls - Archive of obsolete content
mozilla will attempt to suppress all calls to window.open() which occur in the following circumstances: global script which is executed as the document is loading script executed as part of a onload event handler script executed in settimeout() or setinterval() what popup windows are not suppressed?
... detecting suppressed popups windows if a user has popup controls enabled for your site, any attempt to call window.open in global script, in an onload handler or in settimeout() or setinterval() will return null rather than a reference to the opened window.
Game monetization - Game development
a totally new set of levels with new characters, weapons and story is a good material for dlc, but to have enough sales the game itself has to be popular, or else there won't be any players interested in spending their hard earned money on it.
... selling resources if you're a graphic designer, you can sell the assets from the games you've created, or something brand new exclusively for that purpose at online shops like envato market.
Unconventional controls - Game development
leapmotion is becoming more and more popular due to very good integration with vr headsets — demoing rainbow membrane on an oculus rift with leap motion attached to it was voted one of the best webvr experiences by javascript developers visiting demo booths at conferences around the world.
... to get the leap motion working on your computer you have to first install it by following the steps at leapmotion.com/setup.
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.
...the below image shows an example of an atlas for an isometric tileset.
WebRTC data channels - Game development
this library provides a simple api for creating peer connections and setting up streams and data channels.
... there's also a broker server component and a hosted broker you can use instead of having to set one up for yourself.
Collision detection - Game development
update your drawbricks() function as follows: function drawbricks() { for(var c=0; c<brickcolumncount; c++) { for(var r=0; r<brickrowcount; r++) { if(bricks[c][r].status == 1) { var brickx = (c*(brickwidth+brickpadding))+brickoffsetleft; var bricky = (r*(brickheight+brickpadding))+brickoffsettop; bricks[c][r].x = brickx; bricks[c][r].y = bricky; ctx.beginpath(); ctx.rect(brickx, bricky, brickwidth, brickheight); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } } } } ...
... tracking and updating the status in the collision detection function now we need to involve the brick status property in the collisiondetection() function: if the brick is active (its status is 1) we will check whether the collision happens; if a collision does occur we'll set the status of the given brick to 0 so it won't be painted on the screen.
Create the Canvas and draw on it - Game development
using your favourite text editor, create a new html document, save it as index.html, in a sensible location, and add the following code to it: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>gamedev canvas workshop</title> <style> * { padding: 0; margin: 0; } canvas { background: #eee; display: block; margin: 0 auto; } </style> </head> <body> <canvas id="mycanvas" width="480" height="320"></canvas> <script> // javascript code goes here </script> </body> </html> we have a charset defined, <title> and some basic css in the header.
... next steps now we've set up the basic html and learned a bit about canvas, lets continue to the second chapter and work out how to move the ball in our game.
Mouse controls - Game development
add the following function to your code, below the previous line you added: function mousemovehandler(e) { var relativex = e.clientx - canvas.offsetleft; if(relativex > 0 && relativex < canvas.width) { paddlex = relativex - paddlewidth/2; } } in this function we first work out a relativex value, which is equal to the horizontal mouse position in the viewport (e.clientx) minus the distance between the left edge of the canvas and left edge of the viewport (canvas.offsetleft) — effectively this is equal to the distance between...
...if the relative x pointer position is greater than zero and lower than the canvas width, the pointer is within the canvas boundaries, and the paddlex position (anchored on the left edge of the paddle) is set to the relativex value minus half the width of the paddle, so that the movement will actually be relative to the middle of the paddle.
Track the score and win - Game development
the font definition looks exactly like the one in css — you can set the size and font type in the font() method.
... then use fillstyle() to set the color of the font and filltext() to set the actual text that will be placed on the canvas, and where it will be placed.
Bounce off the walls - Game development
to make this occur we have to set its bounciness.
... add the following line below the previous one: ball.body.bounce.set(1); try reloading index.html again — now you should see the ball bouncing off all the walls and moving inside the canvas area.
Scaling - Game development
the stage object has a backgroundcolor property for this purpose, which we can set using css color definition syntax.
... add the following line below the other three you added earlier: game.stage.backgroundcolor = '#eee'; compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps now we've set up the scaling for our game, let's continue to the third lesson and work out how to load the assets and print them on screen.
2D breakout game using Phaser - Game development
lesson details all the lessons — and the different versions of the mdn breakout game we are building together — are available on github: initialize the framework scaling load the assets and print them on screen move the ball physics bounce off the walls player paddle and controls game over build the brickfield collision detection the score win the game extra lives animations and tweens buttons randomizing gameplay as a note on learning paths — starting with pure javascript is the best way to get a solid knowledge of web game development.
... after that, you can pick any framework you like and use it for your projects; we have chosen phaser as it is a good solid framework, with a good support and community available, and a good set of plugins.
Visual JS GE - Game development
installation and setup first of all download visual-js from bitbucket.
... installing modules navigate to server_instance/, then in the node.js command prompt or console enter the following installation commands: npm install mysql npm install delivery npm install express npm install mkdirp npm install socket.io npm install nodemailer@0.7.0 setting up config.js you will find config.js in the server_instance folder: all node.js applications use the same folder — server_instance.
API - MDN Web Docs Glossary: Definitions of Web-related terms
an api (application programming interface) is a set of features and rules that exist inside a software program (the application) enabling interaction with it through software - as opposed to a human user interface.
... in web development, an api is generally a set of code features (e.g.
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — i...
...t can now be set in a fetch headers object, or via xhr setrequestheader().
Lazy load - MDN Web Docs Glossary: Definitions of Web-related terms
lazy loading is a strategy that delays the loading of some assets (e.g., images) until they are needed by the user based on the user's activity and navigation pattern; typically, these assets are only loaded when they are scrolled into view.
... if correctly implemented, this delay in asset loading is seamless to the user experience and might help improve initial load performance, including time to interactive, as fewer assets are required for the page to start working.
Locale - MDN Web Docs Glossary: Definitions of Web-related terms
locale is a set of language- or country-based preferences for a user interface.
... a program draws its locale settings from the language of the host system.
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
a state machine reads a set of inputs and changes to a different state based on those inputs.
...a transition is a set of actions to execute when a condition is fulfilled or an event received.
Loop - MDN Web Docs Glossary: Definitions of Web-related terms
example: for(var i = 0; i < 10; i++){ console.log(i) } //this loop will print numbers 0-9, will stop when condition is met (i = 10) for the above example, the syntax is as follows: statement 1 sets the variable for the loop (var i = 0).
... statement 2 sets the loop condition (i < 10).
MDN Web Docs Glossary: Definitions of Web-related terms
t buffer c cache cacheable caldav call stack callback function canonical order canvas card sorting carddav caret cdn certificate authority certified challenge-response authentication character character encoding character set chrome cia cipher cipher suite ciphertext class client hints closure cms code splitting codec compile compile time computer programming conditional constant constructor continuous media control flow cookie copy...
...ebvtt whatwg whitespace world wide web wrapper x xforms xhr (xmlhttprequest) xhtml xinclude xlink xml xpath xquery xslt other 404 502 alpn at-rule attack byte-order mark character set client cryptosystem debug digital signature execution flex-direction glsl interface library memory management routers self-executing anonymous function stylesheet vector image ...
HTML: A good basis for accessibility - Learn web development
note: it is a good idea to have a screen reader set up on your local computer so that you can do some testing of the examples shown below.
... onclick events anchor tags are often abused with the onclick event to create pseudo-buttons by setting href to "#" or "javascript:void(0)" to prevent the page from refreshing.
HTML: A good basis for accessibility - Learn web development
note: it is a good idea to have a screen reader set up on your local computer so that you can do some testing of the examples shown below.
... onclick events anchor tags are often abused with the onclick event to create pseudo-buttons by setting href to "#" or "javascript:void(0)" to prevent the page from refreshing.
Debugging CSS - Learn web development
perhaps you have realised that you don't want your box to inherit the <body> element's font size, and want to set its own specific size?
...this includes a description of properties that you may not have explicitly used on the element, but which do have initial values set.
Handling different text directions - Learn web development
so the writing-mode property is in reality setting the direction in which block-level elements are displayed on the page — either from top-to-bottom, right-to-left, or left-to-right.
... to make this easier, css has recently developed a set of mapped properties.
Type, class, and ID selectors - Learn web development
this kind of behavior can sometimes be seen in "reset stylesheets", which strips out all of the browser styling.
...it can select an element that has the id set on it, and you can precede the id with a type selector to only target the element if both the element and id match.
Test your skills: values and units - Learn web development
the fourth should use rgb color but with the alpha channel set to .2.
... task two in this task you need to set the size of various items of text.
CSS building blocks - Learn web development
just looking at it, consuming the content.) a basic work environment set up as detailed in installing basic software, and an understanding of how to create and manage files, as detailed in dealing with files.
... css values and units every property used in css has a value or set of values that are allowed for that property.
Test Your Skills: Fundamental layout comprehension - Learn web development
basic setup you can download the html, css, and a set of six images here.
...you will need to upload the images using their assets functionality and replace the value in the src attribute to point to the new image location.
Multiple-column layout - Learn web development
in this case the content breaks when the spanning element is introduced and continues below creating a new set of column boxes.
... to cause an element to span all of the columns use the column-span property set to all.
Getting started with CSS - Learn web development
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>getting started with css</title> </head> <body> <h1>i am a level one heading</h1> <p>this is a paragraph of text.
...most of the time that isn't the case and so you will need to find a way to select a subset of the elements without changing the others.
How does the Internet work? - Learn web development
prerequisites: none, but we encourage you to read the article on setting project goals first objective: you will learn the basics of the technical infrastructure of the web and the difference between internet and the web.
...but it's not really possible to set cables up between your house and the rest of the world, so how can you handle this?
How do I start to design my website? - Learn web development
as a side note, your goals are not necessarily set in stone.
... second, setting out actionable steps leads to new questions you'll need to answer.
How do you upload your files to a web server? - Learn web development
you must also know how to set up a basic environment and how to write a simple webpage.
...this directory is effectively the root of your website — where your index.html file and other assets will go.
How do I use GitHub Pages? - Learn web development
basic github setup first of all, install git on your machine.
...to do this, from the homepage of your repository choose settings, then scroll down until you get to the github pages section.
What software do I need to build a website? - Learn web development
once you settle on which provider to use, the provider will email you the access information, usually in the form of an sftp url, username, password, and other information needed to connect to their server.
...alternatively, you can set up your own virtual machine, but that takes some expertise.
HTML forms in legacy browsers - Learn web development
<label for="mycolor"> pick a color <input type="color" id="mycolor" name="color"> </label> supported not supported form buttons there are two ways to define buttons within html forms: the <input> element with its attribute type set to the values button, submit, reset or image the <button> element <input> the <input> element can make things a little difficult if you want to apply some css by using the element selector: <input type="button" value="click me"> if we remove the border on all inputs, can we restore the default appearance on input buttons only?
...while resolved in all modern browsers, it is still recommended to always set the type attribute on <button> elements.
Test your skills: Form validation - Learn web development
remove the length validation from the phone number field if it is present, and set it so that it accepts 10 digits — either 10 digits in a row, or a pattern of three digits, three digits, then four digits, separated by either spaces, dashes, or dots.
... form validation 3 in our final task for this set, we are providing you with a similar example to what you saw in the accompanying article — a simple email address entry input.
Use HTML to solve common problems - Learn web development
LearnHTMLHowto
how to create a basic html document how to divide a webpage into logical sections how to set up a proper structure of headings and paragraphs basic text-level semantics html specializes in providing semantic information for a document, so html answers many questions you might have about how to get your message across best in your document.
...tions and citations to web pages how to define terms with html hyperlinks one of the main reasons for html is making navigation easy with hyperlinks, which can be used in many different ways: how to create a hyperlink how to create a table of contents with html images & multimedia how to add images to a webpage how to add video content to a webpage scripting & styling html only sets up document structure.
Structuring the web with HTML - Learn web development
you should have a basic work environment set up as detailed in installing basic software, and understand how to create and manage files, as detailed in dealing with files — both are parts of our getting started with the web complete beginner's module.
... introduction to html this module sets the stage, getting you used to important concepts and syntax, looking at applying html to text, how to create hyperlinks, and how to use html to structure a webpage.
What is JavaScript? - Learn web development
css is a language of style rules that we use to apply styling to our html content, for example setting background colors and fonts, and laying out our content in multiple columns.
... apis are ready-made sets of code building blocks that allow a developer to implement programs that would otherwise be hard or impossible to implement.
Solve common problems in your JavaScript code - Learn web development
for example: function myfunction() { alert('this is my function.'); }; this code won't do anything unless you call it with the following statement: myfunction(); function scope remember that functions have their own scope — you can't access a variable value set inside a function from outside the function, unless you declared the variable globally (i.e.
... how do you get and set the methods and properties of an object?
Object-oriented JavaScript for beginners - Learn web development
further exercises to start with, try adding a couple more object creation lines of your own, and try getting and setting the members of the resulting object instances.
... note that this set of tests relies on some of the knowledge taught in the next two articles, so you might want to read them first before you try the tests.
HTML performance features - Learn web development
elements & attributes impacting performance the <picture> element the <video> element the <source> element the <img> srcset attribute responsive images preloading content with rel="preload" - (https://w3c.github.io/preload/ ) async / defer attributes <iframe> <object> <script> rel attribute conclusion previous overview: performance next in this module the "why" of web performance what is web performance?
... html performance features css performance features fonts and performance mobile performance focusing on performance see also the <picture> element the <video> element the <source> element the <img> srcset attribute responsive images preloading content with rel="preload" - (https://w3c.github.io/preload/ ) ...
Web performance resources - Learn web development
to load css asynchronously one can simpy set the media type to print and then change to all once loaded.
... <style type="text/css"> // insert your css here </style> javascript avoid javascript blocking by using the async or defer attributes, or link javascript assets after the page's dom elements.
The "why" of web performance - Learn web development
in a sense, web performance can be considered a subset of web accessibility.
... good performance is an asset.
Website security - Learn web development
django, for example, ensures that any user-data passed to querysets (model queries) is escaped.
...as a defense, your site can prevent itself from being embedded in an iframe in another site by setting the appropriate http headers.
Routing in Ember - Learn web development
add the following below the existing getters: get completed() { return this.todos.filter(todo => todo.iscompleted); } models now we need to add models to our route javascript files to allow us to easily return specific data sets to display in those models.
...o back to todomvc/app/components/footer.hbs, and find the following bit of markup: <a href="#">all</a> <a href="#">active</a> <a href="#">completed</a> update it to <linkto @route='index'>all</linkto> <linkto @route='active'>active</linkto> <linkto @route='completed'>completed</linkto> <linkto> is a built-in ember component that handles all the state changes when navigating routes, as well as setting an "active" class on any link that matches the url, in case there is a desire to style it differently from inactive links.
Rendering a list of Vue components - Learn web development
in this artcle we'll look at adding a set of todo item data to our app.vue component, which we'll then loop through and display inside todoitem components using the v-for directive.
...in addition, we want their checked status to reflect their done properties, not always be set to done="false".
Cross browser testing - Learn web development
handling common html and css problems with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur.
... setting up your own test automation environment in this article, we will teach you how to install your own automation environment and run your own tests using selenium/webdriver and a testing library such as selenium-webdriver for node.
Git and GitHub - Learn web development
note: github is not the only site/toolset you can use with git.
... 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.
Understanding client-side web development tools - Learn web development
we'll go all the way from setting up a sensible development environment and putting transformation tools in place to actually deploying your app on netlify.
... in this article we'll introduce the case study, set up our development environment, and set up our code transformation tools.
Tools and testing - Learn web development
working out what tools you should be using can be a difficult process, so we have written this set of articles to inform you of what types of tool are available, what they can do for you, and how to make use of the current industry favourites.
...this module gives you some fundamental background knowledge about how client-side frameworks work and how they fit into your toolset, before moving on to tutorial series covering some of today's most popular ones.
Accessibility information for UI designers and developers
text spacing users should be able to make the following changes to their text spacing: set line height (leading) to at least 1.5 times the font size set spacing following paragraphs to at least 2 times the font size set letter spacing (tracking) to at least 0.12 times the font size set word spacing to at least 0.16 times the font size this does not mean that your page needs to offer controls to make such changes, merely that if someone does these things in a custom stylesheet, the...
... to help these users, you could offer a setting to turn off animations, or wrap the css in the prefers-reduce-motion media query.
Information for Governments and Other Organizations Evaluating Mozilla
mozilla's section 508 compliance section 508 is a set of accessibility requirements that help us federal agencies decide what software applications they can use.
... mozilla's w3c user agent guidelines evaluation report w3c's wai is advancing another important set of accessibility standards called uaag.
Frequently Asked Questions for Lightweight themes
we are big fans of creativity, but want to ensure that the art displayed in the themes gallery meets a basic set of guidelines.
...by clicking on each, you can make changes to each design's settings.
Add-ons
developing extensions in the past, there were several toolsets for developing firefox extensions, but as of november 2017, extensions must be built using webextensions apis.
... other toolsets, such as overlay add-ons, bootstrapped add-ons, and the add-on sdk, are no longer supported.
Adding a new event
however, there are some hints: set meventisinternal in the constructor of the most descendant class because each constructor creates dummy internal event instance at calling constructors of its super class.
... therefore, super classes always set it false.
Android-specific test suites
however, the existing configuration can be tweaked and the set of files checked can be modified.
...however, the existing configuration can be tweaked and the set of files checked can be modified.
Testopia
a fresh install only requires that you untar the tarball in your bugzilla root directory and run checksetup.
... new reports: worst offender and case roll-up set priorities on indidual case-runs new clone options uses the latest extjs 3.0 library converts testopia into a true bugzilla extension numerous bug fixes integration points testopia integrates with bugzilla products, components, versions, and milestones to allow a single management interface for high level objects.
Creating a Login Manager storage module
to see some debugging output in the console set signon.debug to true using about:config.
... this.stub(arguments); }, getalllogins: function slms_getalllogins(count) { this.stub(arguments); }, removealllogins: function slms_removealllogins() { this.stub(arguments); }, getalldisabledhosts: function slms_getalldisabledhosts(count) { this.stub(arguments); }, getloginsavingenabled: function slms_getloginsavingenabled(hostname) { this.stub(arguments); }, setloginsavingenabled: function slms_setloginsavingenabled(hostname, enabled) { this.stub(arguments); }, findlogins: function slms_findlogins(count, hostname, formsubmiturl, httprealm) { this.stub(arguments); }, countlogins: function slms_countlogins(ahostname, aformsubmiturl, ahttprealm) { this.stub(arguments); } }; function nsgetmodule(compmgr, filespec) xpcomutils.generate...
Debugging OpenGL
the moz_gl_debug_abort_on_error environment variable, if set, causes firefox to abort as soon as an opengl error occurs.
... you don't have to define more than one of these; for example, if you set moz_gl_debug_abort_on_error, the moz_gl_debug setting is assumed.
Building Firefox with Debug Symbols
use the following mozconfig settings to do a build with symbols: building firefox with symbols there is a single configure option to enable building with symbols on all platforms.
...this value takes precedence over the flags set in moz_debug_flags note that this will override the values provided for cflags and cxxflags.
Simple Thunderbird build
.h 02/06/2009 17:02 97,301 mapival.h 02/06/2009 17:02 9,334 mapiwin.h 02/06/2009 17:02 1,906 mapiwz.h 02/06/2009 17:02 18,277 mapix.h 02/06/2009 17:02 5,012 mspst.h get the source note: on windows, you won't be able to build the thunderbird source code if it's under a directory with spaces in the path (e.g., don't use "documents and settings").
...on linux, this can manifest as problems setting up the virtualenv for running tests (failure to install pip or virtualenv because of os access denied errors, where access is denied not because of permission problems, but because the paths being accessed have been truncated, and so do not exist).
Creating Custom Events That Can Pass Data
myevent = do_queryinterface(event); myevent->setmyproperty(45); //set my property of my event to (e.g.) 45.
... prbool defaultactionenabledwin; prbool defaultactionenableddoc; nscomptr<nsiprivatedomevent> privevt(do_queryinterface(event)); privevt->settrusted(pr_true); //make the event trusted twindow->dispatchevent(event, &defaultactionenabledwin); //dispatch it (i.e.
Runtime Directories
vista/7 c:\program files\mozilla firefox\ c:\users\<username>\appdata\roaming\mozilla\firefox\ (or %appdata%\mozilla\firefox\) c:\users\<username>\appdata\local\mozilla\firefox\ (or %localappdata%\mozilla\firefox) and c:\users\<username>\appdata\local\virtualstore\program files\mozilla firefox\ windows 2000/xp c:\program files\mozilla firefox\ c:\documents and settings\<username>\application data\mozilla\firefox\ (or %appdata%\mozilla\firefox\) c:\documents and settings\<username>\local settings\application data\mozilla\firefox\ os x /applications/firefox.app ~/library/application support/firefox/profiles/xxxxxxxx.default/ ~/library/caches/firefox/profiles/xxxxxxxx.default/ linux ????
...ows vista/7 c:\program files\mozilla thunderbird\ c:\users\<username>\appdata\roaming\thunderbird\ (or %appdata%\thunderbird\) c:\users\<username>\appdata\local\thunderbird\ (or %localappdata%\thunderbird\) and c:\users\<username>\appdata\local\virtualstore\program files\mozilla thunderbird\ windows 2000/xp c:\program files\mozilla thunderbird\ c:\documents and settings\<username>\application data\thunderbird\ (or %appdata%\thunderbird\) c:\documents and settings\<username>\local settings\application data\thunderbird\ os x /applications/thunderbird.app ~/library/thunderbird/profiles/xxxxxxxx.default/ ~/library/caches/thunderbird/profiles/xxxxxxxx.default/ linux ????
Index
the most useful is the url about:config, which displays preferences and settings that can be inspected and changed.
... 143 multiple firefox profiles beginner, firefox, guide, intro, profiles, qa a profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox.
Message manager overview
communicate with frame scripts using message-passing apis there are various types of frame message managers, as depicted in this diagram: this diagram shows the setup when there are 2 browser windows open, one with 2 tabs open and one with 1 tab open.
...the diagram below shows the setup that would result from having two child processes: with the gppmm, you can broadcast messages to the cipmm and all cpmms.
Tracking Protection
you will also be able to disable tracking protection entirely if you choose by accessing the tracking settings.
... if tracking cookies were present, you would be able to view the list by clicking on "blocking tracking cookies" in the above image to view the following popup: you can click "manage content blocking" to change the blocking settings: how does firefox choose what to block?
Firefox
the most useful is the url about:config, which displays preferences and settings that can be inspected and changed.firefox ui considerations for web developersthere are a number of places within the firefox user interface where web sites are listed for the user to choose a destination to visit or a site to manage in some way.
... linux compatibility matrixthe following table lists the available library versions for the mozilla.org-distributed firefox builds dependencies, and/or to build firefox.multiple firefox profilesa profile in firefox is the collection of settings, customizations, add-ons, and other personalizations that a user has made or installed into their copy of firefox.
HTMLIframeElement.removeNextPaintListener()
the removenextpaintlistener() method of the htmliframeelement interface is used to remove a handler previously set with the addnextpaintlistener method.
... parameters listener a function handler previously set with addnextpaintlistener.
Gecko's "Almost Standards" Mode
triggering "almost standards" the doctypes that will trigger "almost standards" mode are those which contain: the public identifier "-//w3c//dtd xhtml 1.0 transitional//en" the public identifier "-//w3c//dtd xhtml 1.0 frameset//en" the public identifier "-//w3c//dtd html 4.01 transitional//en", with a system identifier the public identifier "-//w3c//dtd html 4.01 frameset//en", with a system identifier the ibm system doctype "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" a complete doctype contains a public identifier and a system identifier.
...for example, consider the following doctype: <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> the parts are as follows: public identifier: "-//w3c//dtd html 4.01 transitional//en" system identifier: "http://www.w3.org/tr/html4/loose.dtd" thus any html 4.01 transitional or frameset doctype with a uri (system identifier) will trigger "almost standards" mode, as will any xhtml 1.0 transitional or frameset doctype, with or without the uri.
PBackground
but some things, such as apis that need to manipulate files or device settings (e.g.
...instead, it simply turns all of its operations into ipdl calls on a set of pbackground-based actors and the processing, file i/o, etc, can be controlled from the pbackground thread regardless of where the dom calls are being made.
IPDL Tutorial
ninstance; rpc protocol pplugin { manages pplugininstance; child: rpc init(nscstring pluginpath) returns (bool ok); // this part creates constructor messages rpc pplugininstance(nscstring type, nscstring[] args) returns (int rv); }; // ----- file pplugininstance.ipdl include protocol pplugin; rpc protocol pplugininstance { manager pplugin; child: rpc __delete__(); setsize(int width, int height); }; this example has several new elements: `include protocol` imports another protocol declaration into this file.
... this is useful for actors with lifetimes outside of ipdl - for instance, a flag could be set indicating that ipdl-related functions are no longer safe to use.
Widget Wrappers
is currently in the overflow panel of the toolbar isgroup false, will be true for the group widget label for api-provided widgets, convenience getter for the label attribute of the dom node tooltiptext for api-provided widgets, convenience getter for the tooltiptext attribute of the dom node disabled for api-provided widgets, convenience getter and setter for the disabled state of this single widget.
... note that you may prefer to use the group wrapper's getter/setter instead.
DeferredTask.jsm
set up a function or an asynchronous task whose execution can be triggered after a defined delay.
... the timer can be disarmed to reset the delay, or just to cancel execution: savedeferredtask.disarm(); savedeferredtask.arm(); // the task will be executed in 2 seconds from now.
DownloadLastDir.jsm
using the downloadlastdir object to determine or set the path into which the last download occurred: // file is an nsifile var file = downloadlastdir.file; downloadlastdir.file = file; you can also set and retrieve this information on a site-by-site basis.
... to set the path, use setfile: // file is an nsifile downloadlastdir.setfile(uri, file); to retrieve the path in firefox 26 or later, use getfileasync: downloadlastdir.getfileasync(uri, function (file) { // file is an nsifile console.log(file); }); deprecated since gecko 26.0 to retrieve the path in firefox 25 or earlier, use getfile: // file is an nsifile var file = gdownloadlastdir.getfile(uri); console.log(file); private browsing mode when browsing normally, the browser uses the browser.download.lastdir preference to store the last download directory path.
JavaScript OS.Constants
debug set to true on debug build configurations, non-existent otherwise.
... o_excl raise an error if o_creat is set and the file exists.
Deferred
* if the promise is already settled it does nothing.
... * if the promise is already settled it does nothing.
Task.jsm
the task.jsm javascript code module implements a subset of task.js to make sequential, asynchronous operations simple, using the power of javascript's yield operator.
... to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/task.jsm"); introduction for an introduction to tasks, you may start from the task.js documentation, keeping in mind that only the core subset is implemented in this module.
Timer.jsm
the timer.jsm javascript code module contains pure-javascript implementations of settimeout, cleartimeout, setinterval, and clearinterval that are compatible with the dom window functions, but that can be used by code that does not have access to a dom window (for example, javascript code modules or content frame scripts).
... to use timer.jsm, first import it: components.utils.import("resource://gre/modules/timer.jsm"); then call settimeout and cleartimeout just as you would in a dom window, for example: let timeoutid = settimeout(function() { console.log("hello!"); }, 500); cleartimeout(timeoutid); similarly, you can use setinterval and clearinterval like so: let intervalid = setinterval(function() { console.log("happening every 500ms!"); }, 500); clearinterval(intervalid); ...
Using JavaScript code modules
there are multiple pre-defined aliases set up by the xul runtime: app - alias to the location of the xul application gre - alias to the location of the xul runtime the <relative-path> can be multiple levels deep and is always relative to the location defined by the <alias>.
....jsm"); var resprot = services.io.getprotocolhandler("resource") .queryinterface(components.interfaces.nsiresprotocolhandler); var aliasfile = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); aliasfile.initwithpath("/some/absolute/path"); var aliasuri = services.io.newfileuri(aliasfile); resprot.setsubstitution("myalias", aliasuri); // assuming the code modules are in the alias folder itself notes custom modules and xpcom components note that prior to gecko 2.0 javascript xpcom components are loaded before chrome registration.
WebChannel.jsm
id - webchannel id of the incoming messages message - incoming message object sendercontext - incoming message context - this should be treated as an opaque object and passed to the .send() method stoplistening() resets the callback for messages on this channel.
... examples setting up a webchannel between chrome code and a webpage chrome code let channel = new webchannel(webchannelid, services.io.newuri("https://mozilla.org", null, null)); // receive messages channel.listen(function (webchannelid, message, sendercontext) { // send messages channel.send({ data: { greeting: true } }, sendercontext); }); webpage code receive messages from an existing webchannel in content code window.addeventlistener("webchannelmessagetocontent", f...
Webapps.jsm
aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) doinstallpackage: function doinstallpackage(adata, amm) pushcontentaction: function(windowid) popcontentaction: function(windowid) actioncancelled: function(windowid) denyinstall: function(adata) _setupapp: function(adata, aid) _cloneapp: function(adata, anewapp, alocalemanifest, amanifest, aid, alocalid) _writemanifestfile: function(aid, aispackage, ajsonmanifest) _nextlocalid: function() _appidformanifesturl: function(auri) makeappid: function() _saveapps: function() _readmanifests: function(adata) _ensuresufficientstorage: function(anewapp) _checkdownloadsize: function(afreebytes, ...
...nstall: function(adata, areason = "error_unknown_failure") getself: function(adata, amm) checkinstalled: function(adata, amm) getinstalled: function(adata, amm) getnotinstalled: function(adata, amm) geticon: function(adata, amm) getall: function(acallback) isreceipt: function(data) addreceipt: function(adata, amm) removereceipt: function(adata, amm) replacereceipt: function(adata, amm) setenabled: function(adata) getmanifestfor: function(amanifesturl, aentrypoint) getappbymanifesturl: function(amanifesturl) getfullappbymanifesturl: function(amanifesturl, aentrypoint, alang) getmanifestcspbylocalid: function(alocalid) getdefaultcspbylocalid: function(alocalid) getapplocalidbystoreid: function(astoreid) getappbylocalid: function(alocalid) getmanifesturlbylocalid: function(alo...
XPCOMUtils.jsm
when set to true, and only if 'value' // is not specified, the concatenation of the string "service," and the // object's contractid is passed as avalue parameter of addcategoryentry.
... examples definelazygetter var myservices = {}; cu.import('resource://gre/modules/xpcomutils.jsm'); //set it up xpcomutils.definelazygetter(myservices, 'as', function () { return cc['@mozilla.org/alerts-service;1'].getservice(ci.nsialertsservice) }); //when you need to use it myservices.as.showalertnotification('chrome://branding/content/icon64.png', 'this was lazyloaded', 'this is a notification from myservices.as', null, null); ...
JavaScript code modules
task.jsm implements a subset of task.js to make sequential, asynchronous operations simple, using the power of javascript's yield operator.
... timer.jsm a pure js implementation of window.settimeout.
L10n testing with xcode
setting up your l10n testing environment once you have your l10n testing environment set up in xcode, testing your firefox on ios localization is a breeze.
... navigate to the settings app, open it, and go to general > accessibility.
Translation phase
congratulations on completing the initial setup!
... in-product pages a set of pages used to interact with and give information to the end-user as part of their first experience with their mozilla applications.
MathML Demo: <mo> - operator, fence, separator, or accent
[ a b c d ] ⁢ [ a b c d ] we want the row vector to typeset at the same level as the top row of the column vector, but this is difficult to achieve.
...the commands \big, \big, \bigg and \bigg produce a discreet set of increasingly taller fences, | 1 + | 2 + | 3 + | 4 + | .
Mozilla Web Developer FAQ
these aspects of the layout can be changed by explicitly setting the display css property of the images (and possible surrounding <a> elements) to block.
...a block is centered by setting its margin-left and margin-right to auto and its width to a value that makes the block narrower than its containing block.
Mozilla Development Strategies
it's easier to tell someone set a pref, or apply a small patch, or set a #define than to apply a monster patch.
...cvs commit client.mak nmake -f client.mak original document information author(s): seth spitzer and alec flett last updated date: september 3, 2006 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Power profiling overview
devices such as ammeters give the best results, but these can be expensive and difficult to set up.
... power profiling how-to this section aims to put together all the above information and provide a set of strategies for finding, diagnosing and fixing cases of high power consumption.
Reporting a Performance Problem
make sure to choose an appropriate setting for the recording (if you're not sure, choose firefox platform), and then choosing "start recording".
...if you choose custom settings (and then clicking edit settings) for the profiler, you can adjust the size of the buffer (presently defaults to 90 mb) and the time interval between data collection (presently defaults to 1 ms).
TimerFirings logging
set the following environment variable to enable it.
...there are also timers for settimer or setinterval calls in javascript code, as the following sample shows.
TraceMalloc
leaksoup also finds sets of objects that are rooted by a cycle (i.e., a set of reference counted objects that own references to each other in a cycle).
...the roots are either listed as single objects or as strongly connected components (minimal sets of nodes in the graph in which any node is reachable from all other nodes).
browser.dom.window.dump.enabled
this setting enables the dump function, which sends messages to the system console.
... set it to true to enable it, or false to disable it.
L20n Javascript API
the error object is passed as the first argument to callback and can be one of the following: context.error, when there are problems with setting up resources (e.g.
...otherwise it sets the event listener and fire as soon as the context is ready.
NSPR Poll Method
for pr_recv, you should pass pr_poll_read as the in_flags argument to the poll method for pr_send, you should pass pr_poll_write as the in_flags argument to the poll method out_flags [output argument] if an i/o layer is ready to satisfy the i/o request defined by in_flags without involving the underlying network transport, its poll method sets the corresponding event in *out_flags on return.
...if the caller wishes to test for read ready (that is, pr_poll_read is set in in_flags) and the layer has input data buffered, the poll method would set the pr_poll_read event in *out_flags.
Anonymous Shared Memory
first protocol server: fm = pr_openanonfilemap(dirname, size, filemapprot); addr = pr_memmap(fm); attr = pr_newprocessattr(); pr_processattrsetinheritablefilemap( attr, fm, shmname ); pr_createprocess(client); pr_destroyprocessattr(attr); ...
...pr_memunmap(addr); pr_closefilemap(fm); anonymous shared memory functions pr_openanonfilemap pr_processattrsetinheritablefilemap pr_getinheritedfilemap pr_exportfilemapasstring pr_importfilemapfromstring ...
Dynamic Library Linking
library linking types these data types are defined for dynamic library linking: prlibrary prstaticlinktable library linking functions the library linking functions are: pr_setlibrarypath pr_getlibrarypath pr_getlibraryname pr_freelibraryname pr_loadlibrary pr_unloadlibrary pr_findsymbol pr_findsymbolandlibrary finding symbols defined in the main executable program pr_loadlibrary cannot open a handle that references the main executable program.
... platform notes to use the dynamic library loading functions on some platforms, certain environment variables must be set at run time, and you may need to link your executable programs using special linker options.
I/O Types
directory type file descriptor types file info types network address types types used with socket options functions type used with memory-mapped i/o offset interpretation for seek functions directory type prdir file descriptor types nspr represents i/o objects, such as open files and sockets, by file descriptors of type prfiledesc.
... file info types prfileinfo prfileinfo64 prfiletype network address types prnetaddr pripv6addr types used with socket options functions prsocketoptiondata prsockoption prlinger prmcastrequest type used with memory-mapped i/o prfilemap offset interpretation for seek functions prseekwhence ...
NSPR LOG FILE
set nspr_log_file to the name of the log file you want to use.
... for ms windows systems, you can set nspr_log_file to the special (case-sensitive) value windebug.
Named Shared Memory
these limits may be adjusted on some platforms either via boot-time options or by setting the size of the system paging space to accommodate more and/or larger shared memory segment(s).
...set permissions and or access controls at create and attach time to ensure you get the desired security.
PRThreadPriority
a thread's priority setting.
... see also setting thread priorities.
PRTimeParamFn
this type defines a callback function to calculate and return the time parameter offsets from a calendar time object in gmt.
... syntax #include <prtime.h> typedef prtimeparameters (pr_callback_decl *prtimeparamfn) (const prexplodedtime *gmt); description the type prtimeparamfn represents a callback function that, when given a time instant in gmt, returns the time zone information (offset from gmt and dst offset) at that time instant.
PR_Bind
if you do not care about the exact ip address assigned to the socket, set the inet.ip field of prnetaddr to pr_htonl(pr_inaddr_any).
... if you do not care about the tcp/udp port assigned to the socket, set the inet.port field of prnetaddr to 0.
PR_Connect
returns the function returns one of the following values: upon successful completion of connection setup, pr_success.
... if the socket is a udp socket, there is no connection setup to speak of, since udp is connectionless.
PR EnumerateAddrInfo
to begin an enumeration, this argument is set to null.
... to continue an enumeration (thereby getting successive addresses from the praddrinfo structure), the value should be set to the function's last returned value.
PR_EnumerateHostEnt
to begin an enumeration, this argument is set to zero.
... to continue an enumeration (thereby getting successive addresses from the host entry structure), the value should be set to the function's last returned value.
PR_GetError
returns the current thread's last set platform-independent error code.
...nspr does use pr_seterror to set error numbers defined in error codes.
PR_GetSocketOption
retrieves the socket options set for a specified socket.
...on input, the option field of this structure must be set to indicate which socket option to retrieve for the socket represented by the fd parameter.
PR_Interrupt
sets the interrupt request for a target thread.
... syntax #include <prthread.h> prstatus pr_interrupt(prthread *thread); parameter pr_interrupt has the following parameter: thread the thread whose interrupt request you want to set.
PR_NewTCPSocket
a tcp connection is established by a passive socket (the server) accepting a connection setup request from an active socket (the client).
... typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup requests, and calls pr_accept to accept a connection.
PR_NormalizeTime
you can set tm_mday to 3, tm_month to 2, and tm_year to 1998, and all the other fields to 0, then call pr_normalizetime() with pr_gmtparameters.
... on return, tm_wday (and tm_yday) are set for you.
PR_OpenSharedMemory
when parameter create is (pr_shm_excl | pr_shm_create) and the shared memory already exists, the function returns null with the error set to pr_file_exists_error.
...if the shared memory does not exist, null is returned with the error set to pr_file_not_found_error.
PR_OpenTCPSocket
a tcp connection is established by a passive socket (the server) accepting a connection setup request from an active socket (the client).
... typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup requests, and calls pr_accept to accept a connection.
PR_Sleep
if you set ticks to pr_interval_no_wait, the thread yields.
... calling pr_sleep with the value of ticks set to pr_interval_no_wait simply surrenders the processor to ready threads of the same priority.
PR_strtod
if the parameter se is not null the location it references is also set.
...if no number can be formed, se is set to s00, and 0 is returned.
Building NSS
below are some of the variables, along with possible values they may be set to.
... other subdirectories of nss/tests contain scripts that run a subset of the full suite.
Certificate functions
t_makecanickname mxr 3.4 and later cert_mergeextensions mxr 3.10 and later cert_nametoascii mxr 3.2 and later cert_newcertlist mxr 3.2 and later cert_newtempcertificate mxr 3.12 and later cert_nicknamestringsfromcertlist mxr 3.4 and later cert_opencertdbfilename mxr 3.2 and later cert_ocspcachesettings mxr 3.11.7 and later cert_pkixverifycert mxr 3.12 and later cert_removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsloptime mxr 3.2 and later cert_setocspfailuremode mxr 3.11.7 and later cert_setocsptimeout ...
... mxr 3.12 and later cert_setusepkixforvalidation mxr 3.12 and later cert_startcertextensions mxr 3.5 and later cert_startcertificaterequestattributes mxr 3.10 and later cert_startcrlentryextensions mxr 3.10 and later cert_startcrlextensions mxr 3.10 and later cert_uncachecrl mxr 3.10 and later cert_verifycertname mxr 3.2 and later cert_verifycacertforusage mxr 3.6 and later cert_verifycert mxr 3.2 and later.
Cryptography functions
mxr 3.6 and later pk11_pubunwrapsymkeywithflagsperm mxr 3.9 and later pk11_pubwrapsymkey mxr 3.2 and later pk11_randomupdate mxr 3.2 and later pk11_readrawattribute mxr 3.9.2 and later pk11_referencesymkey mxr 3.2 and later pk11_resettoken mxr 3.4 and later pk11_restorecontext mxr 3.2 and later pk11_savecontext mxr 3.2 and later pk11_savecontextalloc mxr 3.6 and later pk11_setfortezzahack mxr 3.2 and later pk11_setpasswordfunc mxr 3.2 and later pk11_setprivateke...
...ynickname mxr 3.4 and later pk11_setpublickeynickname mxr 3.4 and later pk11_setslotpwvalues mxr 3.2 and later pk11_setsymkeynickname mxr 3.4 and later pk11_setsymkeyuserdata mxr 3.11 and later pk11_setwrapkey mxr 3.2 and later pk11_sign mxr 3.2 and later pk11_signaturelen mxr 3.2 and later pk11_symkeyfromhandle mxr 3.2 and later pk11_tokenexists mxr 3.2 and later pk11_tokenkeygen mxr 3.6 and later pk11_tokenkeygenwithflags mxr 3.10.2 and later pk11_tokenrefresh ...
Introduction to Network Security Services
network security services (nss) is a set of libraries designed to support cross-platform development of communications applications that support ssl, s/mime, and other internet security standards.
... libnssckbi.so/libnssckbi.sl/nssckbi.dll defines the default set of trusted root certificates.
Using JSS
MozillaProjectsNSSJSSUsing JSS
gather components setup your runtime environment initialize jss in your application gather components you need the jss classes and the nspr, nss, and jss shared libraries.
... setup your runtime environment you need to set some environment variables before building and running java applications with jss.
NSS Memory allocation
to accomplish that, set an environment variable prior to the initialization of nss and nspr.
...set the environment variable nss_disable_arena_free_list to have any non-empty value, e.g.
NSS_3.12.2_release_notes.html
bug 455424: nssilckt.h defines the enumeration constant 'lock' bug 456036: stubs for deprecated functions in lib/certdb/stanpcertdb.c should set the pr_not_implemented_error error.
... bug 456854: cert_decodecertpackage does not set nspr error code upon error bug 457980: hundreds of kilobytes of useless strings in libpkix bug 457984: enable pkcs11 module logging in optimized builds bug 458905: memory leaks in pkix bridge certificates.
NSS 3.18 release notes
in pk11pub.h __pk11_setcertificatenickname - this is an internal symbol for nss use only, as with all exported nss symbols that have a leading underscore '_'.
...t: 8c:f4:27:fd:79:0c:3a:d1:66:06:8d:e8:1e:57:ef:bb:93:22:72:d4 cn = entrust root certification authority - ec1 sha1 fingerprint: 20:d8:06:40:df:9b:25:f5:12:25:3a:11:ea:f7:59:8a:eb:14:b5:47 cn = cfca ev root sha1 fingerprint: e2:b8:29:4b:55:84:ab:6b:58:c2:90:46:6c:ac:3f:b8:39:8f:84:83 the version number of the updated root ca list has been set to 2.3 bugs fixed in nss 3.18 this bugzilla query returns all the bugs fixed in nss 3.18: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.18 compatibility nss 3.18 shared libraries are backward compatible with all older nss 3.x shared libraries.
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.1 once again requires nss_enable_tls_1_3 to be deliberately set to enable tls 1.3 (draft).
NSS 3.33 release notes
when using certutil to set an inacceptable password in fips mode, a correct explanation of acceptable passwords will be printed.
... port_zallocalignedoffset - allocate aligned memory for structs.
NSS 3.34.1 release notes
it was previously removed in nss 3.34, but now re-added with only the email trust bit set.
... the version of the ca list was set to 2.20.
NSS Config Options
flags: turn on the following flags: ssl-lock: turn off the ability for applications to change policy with the ssl_setcipherpolicy (or ssl_setpolicy).
... policy-lock: turn off the ability for applications to change policy with the call nss_setalgorithmpolicy.
NSS Sample Code sample2
ap * to indicate the key was unwrapped - which is what should be done * normally anyway - using raw keys isn't a good idea */ symkey = pk11_importsymkey(slot, ciphermech, pk11_originunwrap, cka_encrypt, &keyitem, null); if (symkey == null) { fprintf(stderr, "failure to import key into nss (err %d)\n", pr_geterror()); goto out; } /* set up the pkcs11 encryption paramters.
... * when not using cbc mode, ivitem.data and ivitem.len can be 0, or you * can simply pass null for the iv parameter in pk11_paramfromiv func */ ivitem.type = sibuffer; ivitem.data = giv; ivitem.len = sizeof(giv); secparam = pk11_paramfromiv(ciphermech, &ivitem); if (secparam == null) { fprintf(stderr, "failure to set up pkcs11 param (err %d)\n", pr_geterror()); goto out; } /* sample data we'll encrypt and decrypt */ strcpy(data, "encrypt me!"); fprintf(stderr, "clear data: %s\n", data); /* ========================= start section ============================= */ /* if using the the same key and iv over and over, stuff before this */ /* section and after this section needs to be done only once */ /* encrypt data into bu...
nss tech note3
each of the above seccertusages translates into a required set of cert type and key usage for the certificate itself, and into another set of required cert type and key usage for all the ca certs in the cert chain.
... netscape has its own openly defined cert type extension, which can be used to explicitly set the cert type in any cert.
nss tech note5
if not using cbc mode, just pass a null iv parm to pk11_paramfromiv function secitem ivitem; ivitem.data = /* ptr to an array of iv bytes */ ivitem.len = /* length of the array of iv bytes */ secitem *secparam = pk11_paramfromiv(ciphermech, &ivitem);</big> <big>now encrypt and decrypt using the key and parameter setup in above steps</big> create encryption context pk11context* enccontext = pk11_createcontextbysymkey(ciphermech, cka_encrypt or cka_decrypt, symkey, secparam); do the operation.
...</big></big> <big><big>set up the args to the function pk11_unwrapsymkey, most of which are illustrated above.
PKCS 12 functions
sec_pkcs12decoderfinish mxr 3.2 and later sec_pkcs12decodergetcerts mxr 3.4 and later sec_pkcs12decoderimportbags mxr 3.2 and later sec_pkcs12decoderiterateinit mxr 3.10 and later sec_pkcs12decoderiteratenext mxr 3.10 and later sec_pkcs12decodersettargettokencas mxr 3.8 and later sec_pkcs12decoderstart mxr 3.2 and later sec_pkcs12decoderupdate mxr 3.2 and later sec_pkcs12decodervalidatebags mxr 3.2 and later sec_pkcs12decoderverify mxr 3.2 and later sec_pkcs12destroyexportcontext mxr 3.2 and...
... later sec_pkcs12enablecipher mxr 3.2 and later sec_pkcs12encode mxr 3.2 and later sec_pkcs12isencryptionallowed mxr 3.2 and later sec_pkcs12setpreferredcipher mxr 3.2 and later ...
Installation guide
if you install the libraries in a directory other than /usr/lib, you usually need to set the ld_library_path environment variable.
...ecurity/sour...platlibs.mk#53 53 ifeq ($(os_arch), linux) 54 ifeq ($(use_64), 1) 55 extra_shared_libs += -wl,-rpath,'$$origin/../lib64:$$origin/../lib' 56 else 57 extra_shared_libs += -wl,-rpath,'$$origin/../lib' 58 endif 59 endif for example, if you install certutil in /foo/bar/nss/bin and the .so's in /foo/bar/nss/lib, then you only need to add /foo/bar/nss/bin to your path; you don't need to set ld_library_path.
FC_Initialize
nss_nodb_init(""), which initializes nss with no databases: "configdir='' certprefix='' keyprefix='' secmod='' flags=readonly,nocertdb,nomod db,forceopen,optimizespace " mozilla firefox initializes nss with this string (on windows): "configdir='c:\\documents and settings\\wtc\\application data\\mozilla\\firefox\\profiles\\default.7tt' certprefix='' keyprefix='' secmod='secmod.db' flags=optimizespace manufacturerid='mozilla.org' librarydescription='psm internal crypto services' cryptotokendescription='generic crypto services' dbtokendescription='software security device' cryptoslotdescription='psm internal cryptographic services' dbslotdescription='psm priva...
... ckr_cant_lock: the ckf_os_locking_ok flag is not set in pinitargs->flags.
NSS_Initialize
the following limitation applies when this is set : secmod_waitforanytokenevent will not use c_waitforslotevent, in order to prevent the need for c_finalize.
...nss_init_cooperate - sets the above four recommended options for applications that use both nss and the java sunpkcs11 provider.
FIPS mode of operation
general-purpose functions fc_getfunctionlist fc_initialize fc_finalize fc_getinfo slot and token management functions fc_getslotlist fc_getslotinfo fc_gettokeninfo fc_waitforslotevent fc_getmechanismlist fc_getmechanisminfo fc_inittoken fc_initpin fc_setpin session management functions fc_opensession fc_closesession fc_closeallsessions fc_getsessioninfo fc_getoperationstate fc_setoperationstate fc_login fc_logout object management functions these functions manage certificates and keys.
... fc_createobject fc_copyobject fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjectsinit fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes.
NSS tools : pk12util
in 2009, nss introduced a new set of databases that are sqlite databases rather than berkleydb.
...for example: # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
NSS reference
secmod_loadusermodule secmod_unloadusermodule secmod_closeuserdb secmod_openuserdb pk11_findcertfromnickname pk11_findkeybyanycert pk11_getslotname pk11_gettokenname pk11_ishw pk11_ispresent pk11_isreadonly pk11_setpasswordfunc ssl functions based on "ssl functions" in the ssl reference and "ssl functions" and "deprecated ssl functions" in nss public functions.
...ec_pkcs12createpasswordprivsafe sec_pkcs12createunencryptedsafe sec_pkcs12addcertandkey sec_pkcs12addpasswordintegrity sec_pkcs12enablecipher sec_pkcs12encode sec_pkcs12destroyexportcontext sec_pkcs12decoderstart sec_pkcs12decoderimportbags sec_pkcs12decoderupdate sec_pkcs12decoderfinish sec_pkcs12decodervalidatebags sec_pkcs12decoderverify sec_pkcs12decodergetcerts sec_pkcs12decodersettargettokencas sec_pkcs12decoderiterateinit sec_pkcs12decoderiteratenext sec_pkcs12isencryptionallowed sec_pkcs12setpreferredcipher nspr functions a small number of nspr functions are required for using the certificate verification and ssl functions in nss.
TLS Cipher Suite Discovery
at any time, any real implementation implements some subset of the complete set of well-defined cipher suites.
...to that end, nss's libssl offers a way for applications to discover at run time the set of cipher suites supported by that version of libssl.
NSS tools : pk12util
in 2009, nss introduced a new set of databases that are sqlite databases rather than berkleydb.
...for example: # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent.
Network Security Services
network security services (nss) is a set of libraries designed to support cross-platform development of security-enabled client and server applications.
... strings nss uses to load pkcs #11 modules pkcs #11 faq using the jar installation manager to install a pkcs #11 cryptographic module pkcs #11 conformance testing - archived version ca certificates pre-loaded into nss mozilla ca certificate policy list of pre-loaded ca certificates consumers of this list must consider the trust bit setting for each included root certificate.
Necko Architecture
the uri interface does resource-generic things like getting/setting the scheme, or getting/setting the spec (everything beyond the first colon ':').
... urls provide getting/setting of paths, hosts, ports, filenames, etc.
Personal Security Manager (PSM)
personal security manager (psm) consists of a set of libraries that perform cryptographic operations on behalf of a client application.
... these operations include setting up an ssl connection, object signing and signature verification, certificate management (including issuance and revocation), and other common pki functions.
Pork Tool Development
source locations ast nodes have a location associated with them; sourceloc is defined to be an integer corresponding to an string offset.
... this can be translated to an unboxedloc, which has a line and column offset (see renamer.cc:65).
Rhino optimization
optimization settings the currently supported optimization settings are: -1 interpretive mode is always used.
...so if a script is compiled with the context's optimizationlevel set to 1, it will be executed with those optimizations, regardless of the optimizationlevel of the context in which it is executed.
Scripting Java
a javabean property foo is defined by the methods getfoo and setfoo.
...function can use it to distinguish on behalf of which method it was called: js> var frame = new packages.javax.swing.jframe(); js> frame.addwindowlistener(function(event, methodname) { if (methodname == "windowclosing") { print("calling system.exit()..."); java.lang.system.exit(0); } }); js> frame.setsize(100, 100); js> frame.visible = true; true js> calling system.exit()...
Statistics API
when logging to a file is used in combination with multi-process firefox (e10s) it is necessary to set security.sandbox.content.level = 0, otherwise the content process will crash.
... var prefs = require("api-utils/preferences-service"); components.utils.import('resource://gre/modules/services.jsm'); function observer(subject, topic, json) { var data = json.parse(json); // process the data } prefs.set("javascript.options.mem.notify", true); services.obs.addobserver(observer, "garbage-collection-statistics", false); the toplevel json object contains these fields: timestamp: integer (microseconds) - time at which the gc ended, measured from epoch.
Self-hosted builtins in SpiderMonkey
a select set of c++-implemented builtins is installed via the intrinsic_functions array in selfhosting.cpp, as described below.
...to include self-hosted frames in stack traces (in debug builds only), set the environment variable moz_show_all_js_frames.
JS::MutableHandle
void set(t v) sets the value of *ptr to v.
...it is used in the same way as js::handle&lt;t&gt; and includes a |set(const t &v)| method to allow updating the value of the referenced js::rooted&lt;t&gt;.
JS::Rooted
const t *address() const t &operator=(t value) sets the value of ptr to value.
... t &operator=(const rooted &value) void set(t value) bool operator!=(const t &other) const compares ptr and other.
JSConstDoubleSpec
obsolete since jsapi 35 description jsconstdoublespecs is used to define a set of double values that are assigned as properties to an object using js_defineconstdoubles.
... jsconstintegerspecs is used to define a set of double values that are assigned as properties to an object using js_defineconstintegers.
JSDeletePropertyOp
if no error occurred, but the deletion attempt wasn't allowed (perhaps because the property was non-configurable), set *succeeded to false and return true.
... if no error occurred and the deletion wasn't disallowed (this is *not* the same as saying that a deletion actually occurred -- deleting a non-existent property, or an inherited property, is allowed -- it's just pointless), set *succeeded to true and return true.
JSExtendedClass
(this is a feature of the c and c++ languages.) otherwise, use memset.
... set the jsclass_is_extended flag in myextendedclass.base.flags.
JSExtendedClass.wrappedObject
description if a class has the jsclass_is_extended bit set in its jsclass.flags and has a non-null jsextendedclass.wrappedobject, then objects of that class may be wrappers.
... wrapper objects typically have no prototype, do not allow setting __proto__, and inherit properties from the wrapped object rather than the prototype chain (see jsnewresolveop).
JSFinalizeOp
implementing weak references), see js_setgccallback.
... see also mxr id search for jsfinalizeop jsclass js_setgccallback ...
JSObjectOps.getAttributes
the jsobjectops.getattributes and setattributes callbacks are called to access the attributes of a property.
... description get or set attributes of the property obj[id].
JSVersion
the functions js_getversion, js_setversion, js_stringtoversion, and js_versiontostring use these values.
... jsversion_ecma_5 185 ecma 262 edition 5 "ecmav5" jsversion_default 0 latest javascript version, but omitting web-incompatible extensions "default" jsversion_unknown -1 unknown javascript version null jsversion_latest jsversion_ecma_5 latest javascript version null see also mxr id search for jsversion js_getversion js_setversion js_stringtoversion js_versiontostring bug 824312 ...
JS_CStringsAreUTF8
syntax jsbool js_cstringsareutf8(void); void js_setcstringsareutf8(void); // added in spidermonkey 1.8 description by default, all c/c++ strings passed into the jsapi are treated as iso/iec 8859-1, also known as iso-latin-1.
...there are two ways to enable this: at compile time, by building spidermonkey with js_c_strings_are_utf8 defined; or at run time, by calling js_setcstringsareutf8 before the first call to js_newruntime.
JS_CheckAccess
otherwise, if a runtime-wide check-object-access callback has been installed by calling js_setcheckobjectaccesscallback, then that is called to perform the check.
... on success, js_checkaccess returns js_true, *vp is set to the current value of the specified property, and *attrsp is set to the property's attributes.
JS_DefineConstDoubles
the attributes for each property is set to jsprop_readonly | jsprop_permanent.
...if flags is set to 0, the attributes for the property are automatically set to jsprop_permanent | jsprop_readonly.
JS_DefineProperties
ps const jspropertyspec * pointer to the first element of an array containing names, ids, flags, and getproperty and setproperty method for the properties to create.
...each array element defines a single property: its name, attributes, getter, and setter.
JS_DeleteProperty2
then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the specified property from its prototype, then *succeeded is set to true and obj's jsclass.delproperty hook is called (which may change *succeeded).
...in this case, *succeeded is set to true and obj's jsclass.delproperty hook is called (which may change *succeeded).
JS_GetOptions
this function returns a uint32 value that is the logical or of zero or more of the jsoption flags described in js_setoptions.
... see also mxr id search for js_getoptions js_setoptions js_toggleoptions bug 880330 ...
JS_GetParent
the preferred way to set an object's parent is by using the parent parameter to js_newobject or js_constructobject.
... an application can also use js_setparent, but see the caveats on that page.
JS_GetPropertyAttributes
if obj does not have the specified property, or if it inherits it from some other object (on its prototype chain, for example), then *foundp is set to js_false.
... if the property exists and belongs to obj, then *foundp is set to js_true, *attrsp is set to the logical or of zero or more property attributes flags, and the function returns js_true.
JS_GetPrototype
to set an object's prototype, use js_setprototype.
... see also mxr id search for js_getprototype js_setprototype ...
JS_GetVersion
to configure a context to run scripts using a specific version of javascript, use js_setversion.
... see also mxr id search for js_getversion js_versiontostring js_stringtoversion js_setversionforcompartment ...
JS_HasOwnProperty
if the property exists, this function sets *foundp to true and returns true.
... if the object obj has no such property, the function sets *foundp to false and returns true (to indicate that no error occurred).
JS_HasProperty
if the property exists, this function sets *foundp to true and returns true.
... if the object obj has no such property, the function sets *foundp to false and returns true (to indicate that no error occurred).
JS_InitStandardClasses
this object must be of a jsclass that has the jsclass_global_flags bits set.
...see js_setglobalobject for details.
JS_LinkConstructorAndPrototype
this article covers features introduced in spidermonkey 17 set up ctor.prototype = proto and proto.constructor = ctor with the right property flags.
... description js_linkconstructorandprototype sets the prototype property of class constructor function, ctor, to prototype object, proto with jsprop_permanent | jsprop_readonly flags, and sets the constructor property of proto to ctor with no flag.
JS_PreventExtensions
before then, js_preventextensions did not accept a succeeded argument; in those cases where *succeeded would be set to false, js_preventextensions would throw a typeerror and return false.
... var target = {}; var handler = { preventextensions: function(obj) { return false; } }; var obj = new proxy(target, handler); // bool succeeded; // bool rv = js_preventextensions(cx, obj, &succeeded); // // rv == true, succeeded == false note that as with most jsapi methods, *succeeded is only set if js_preventextensions returns true (that is, does not fail).
JS_ReportErrorNumber
description these functions create a jserrorreport, populate it with an error message obtained from the given jserrorcallback, and either report it to the current error reporter callback or create an error object and set it as the pending exception.
...if the jsoption_dont_report_uncaught option is set, (???
SpiderMonkey 17
h uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a jsuintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types.
... js_isscriptframe jsclass_new_resolve_gets_start flag js_newnumbervalue js_finalizestub js_clearnewbornroots jsclass_mark_is_trace flag js_setscriptstackquota api changes break out and discuss all api changes here...
Running Automated JavaScript Tests
both sets of tests can be used from a normal build of the js shell.
...now that the full set of test262 tests is included in the tree, jstests take a long time to complete.
TPS Pref Lists
a prefs asset list is an array of objects with name and value keys, representing browser preferences.
... for example: var prefs1 = [ { name: "browser.startup.homepage", value: "http://www.getfirefox.com" }, { name: "browser.urlbar.maxrichresults", value: 20 }, { name: "browser.tabs.autohide", value: true } ]; pref lists and phase actions the only actions supported for preference asset lists are modify and verify: prefs.modify prefs.verify sync only syncs certain preferences.
WebReplayRoadmap
set a breakpoint and right click on it to change it to a log point.
...doubles, or objects that have the same set of properties.
Security and the jar protocol
you may re-enable the feature if necessary by setting the network.jar.block-remote-files preference to false.
... this ordinarily isn't a big deal, since site developers wouldn't put up dangerous files and set them up to download like zip archives.
AT APIs Support
iaccessible2 is a set of interfaces that overlay the msaa (iaccessible) and dom (isimpledom*) interface support.
... mac platform we currently support only a subset of universal access.
Frecency algorithm
developer notes there are various development notes you can read about places that may offer additional insights: initial algorithm ideas implementation notes history the initial algorithm design was by mike connor and seth spitzer.
... the initial implementation was done by seth and dietrich ayala.
Places Expiration
preferences usually there is no need to tweak or set any preference, since adaptive behavior should satisfy each need, though in case of unexpected issues it's possible to act on some hidden preferences: places.history.expiration.interval_seconds: minimum number of seconds between expiration steps.
...this transient version of the preference is just mirroring the current value used by expiration, setting it won't have any effect.
Retrieving part of the bookmarks tree
configure the query to get a hierarchical bookmarks result, pass the folder id to setfolders in your query object: query.setfolders([toolbarfolder], 1); run the query the executequery and executequeries functions will return an nsinavhistoryresult object containing the results of your query: var result = historyservice.executequery(query, options); get the results when you are querying for exactly one folder grouped by folder with no fancy query parameters such as keywords or da...
... .getservice(components.interfaces.nsinavhistoryservice); var options = historyservice.getnewqueryoptions(); var query = historyservice.getnewquery(); var bookmarksservice = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); var toolbarfolder = bookmarksservice.toolbarfolder; query.setfolders([toolbarfolder], 1); var result = historyservice.executequery(query, options); var rootnode = result.root; rootnode.containeropen = true; // iterate over the immediate children of this folder and dump to console for (var i = 0; i < rootnode.childcount; i ++) { var node = rootnode.getchild(i); dump("child: " + node.title + "\n"); } // close a container after using it!
extIExtension
extensions.your_extension_id.install-event-fired) will be set to false after your extension has been installed.
... you may need to reset this preference in about:config during testing.
Creating a Python XPCOM component
this is probably best done by setting a pythonpath variable pointing at the 'bin/python' directory in the application.
... # _reg_clsid_ = "{a new clsid generated for this object}" # _reg_contractid_ = "the.object.name" def get_value( self ): # result: string pass def set_value( self, param0 ): # result: void - none # in: param0: string pass as you can see, the output is valid python code, with basic signatures and useful comments for each of the methods.
XPCOM changes in Gecko 2.0
therefore the following categories have changed: old name new name javascript global constructor javascript-global-constructor javascript global constructor prototype alias javascript-global-constructor-prototype-alias javascript global property javascript-global-property javascript global privileged property javascript-global-privileged-property javascript global static nameset javascript-global-static-nameset javascript global dynamic nameset javascript-global-dynamic-nameset javascript dom class javascript-dom-class javascript dom interface javascript-dom-interface xslt extension functions xslt-extension-functions but why?
...if your add-on depends upon xbl bindings attached to content objects—for example, the ability to call functions or get and set properties created by the xbl binding—you will need to use the xpcnativewrapper property wrappedjsobject to access wrapped objects.
Packaging WebLock
component installation overview xpinstall is a set of javascript apis for creating installation scripts.
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
Preface
details about downloading the sdk, building, and getting programmatic access to gecko components are provided in the appendix to this book, setting up the gecko sdk.
...this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
Components.utils.createObjectIn
this function is made available as a global in sandboxes which have the wantexporthelpers option set in the sandbox() constructor.
... enumerable: true, configurable: true, writable: true, value: value }; } var myobject = components.utils.createobjectin(mywindow); var proplist = { name: genpropdesc("name"), date: genpropdesc("date"), id: genpropdesc("id"), func: genpropdesc(function() { alert("called func!"); }) }; object.defineproperties(myobject, proplist); components.utils.makeobjectpropsnormal(myobject); this sets up the new object in the scope of the object mywindow, then adds properties by calling object.defineproperties(), then normalizes them by calling components.utils.makeobjectpropsnormal().
Components.utils.reportError
to show them, set the preference 'javascript.options.showinconsole' to true, or use nsconsoleservice instead to show a message.
... firefox 4: the preference 'javascript.options.showinconsole' is set to true by default in this version.
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.
... you can get details on what this method does in js_setgczeal.
IAccessibleHyperlink
endindex() [propget] hresult endindex( [out] long index ); parameters index the 0 based character offset at which the textual representation of the hyperlink ends.
...startindex() [propget] hresult startindex( [out] long index ); parameters index the 0 based character offset at which the textual representation of the hyperlink starts.
IAccessibleRelation
other-licenses/ia2/accessiblerelation.idlnot scriptable this interface gives access to an object's set of relations.
...ntargets actual number of targets in the returned array (not more than maxtargets) return value s_false if there is nothing to return, ntargets() is set to 0.
imgIDecoderObserver
however, with decode-on-draw, the set of decode notifications can come completely after the load notifications, and can come multiple times if the image is discardable.
...by the time this callback is been called, the size has been set on the container and status_size_available has been set on the associated imgrequest.
imgIRequest
status_size_available 0x1 we received enough image data from the network or filesystem that we know the width and height of the image, and have thus called setsize() on the container.
...if an html img element has the crossorigin attribute set, the imgirequest will be validated for cross-origin usage with cors, and, if successful, will have its cors mode set to the relevant type.
jsdIStackFrame
last version set on this context.
...setting or getting this attribute on any other context will throw a ns_error_no_interface exception.
mozIStorageAggregateFunction
let stmt = dbconn.createstatement("select stddev(value) from some_table"); try { while (stmt.executestep()) { // handle the results } } finally { stmt.reset(); } c++ // first, create our class that will represent our function.
...t64> data(mnumbers); for (pruint32 i = 0; i < data.length(); i++) { print32 value = data[i] - mean; data[i] = value * value; } total = 0; for (pruint32 i = 0; i < data.length(); i++) total += data[i]; nscomptr<nsiwritablevariant> result = do_createinstance("@mozilla.org/variant;1"); ns_ensure_true(result, ns_error_out_of_memory); rv = result->setasdouble(sqrt(double(total) / double(data.length()))); ns_ensure_success(rv, rv); ns_addref(*_result = result); return ns_ok; } private: nstarray<print32> mnumbers; }; // now, register our function with the database connection.
mozIStorageBindingParamsArray
the mozistoragebindingparamsarray interface is a container for mozistoragebindingparams objects, and is used to store sets of bound parameters that will be used by the mozistoragestatement.executeasync().
... methods addparams() adds the specified set of parameters to the end of the array.
mozIStorageRow
the mozistoragerow interface represents a row in the result set from a storage database query.
...see also storage mozistorageresultset mozistorageconnection mozistoragestatement ...
mozIStorageStatementCallback
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void handlecompletion(in unsigned short areason); void handleerror(in mozistorageerror aerror); void handleresult(in mozistorageresultset aresultset); constants constant value description reason_finished 0 the statement has finished executing normally.
... void handleresult( in mozistorageresultset aresultset ); parameters aresultset an mozistorageresultset object describing the available results from the statement's execution.
mozIStorageValueArray
note: c++ callers should be aware that a string value for a null column has isvoid set to distinguish it from an empty string.
... note: c++ callers should be aware that a string value for a null column has isvoid set to distinguish it from an empty string.
mozIThirdPartyUtil
this is done as follows: if achannel is an nsihttpchannel and has the 'forceallowthirdpartycookie' property set, then: if auri is null, return false.
...then: if the parent is the same as the bottommost window, and the channel has the load_document_uri flag set, return false.
GroupPosition
void groupposition( out long agrouplevel, out long asimilaritemsingroup, out long apositioningroup ); parameters agrouplevel 1-based, similar to aria aria-level property asimilaritemsingroup 1-based, similar to aria aria-setsize property, inclusive of the current item.
... apositioningroup 1-based, similar to aria aria-posinset property.
nsIApplicationCache
each entry in the cache can be marked with a set of types, specified in the constants section.
...addnamespaces() add a set of namespace entries to the application cache.
nsIApplicationCacheChannel
exceptions thrown ns_error_already_opened if set after calling asyncopen() on the channel.
...exceptions thrown ns_error_already_opened if set after calling asyncopen() on the channel.
nsIAuthPromptWrapper
last changed in gecko 1.7 inherits from: nsiauthprompt method overview void setpromptdialogs(in nsiprompt dialogs); methods setpromptdialogs() this method sets a prompt dialog using the given dialog implementation which will be used to display the prompts.
... void setpromptdialogs( in nsiprompt dialogs ); parameters dialogs the dialog implementation which will be used to display the prompts.
nsIBinaryInputStream
32 alength, in jsval aarraybuffer); prbool readboolean(); void readbytearray(in pruint32 alength, [array, size_is(alength), retval] out pruint8 abytes); void readbytes(in pruint32 alength, [size_is(alength), retval] out string astring); acstring readcstring(); double readdouble(); float readfloat(); astring readstring(); void setinputstream(in nsiinputstream ainputstream); methods read8() reads from the stream.
... setinputstream() void setinputstream( in nsiinputstream ainputstream ); parameters ainputstream the stream from which to read.
nsIBoxObject
method overview wstring getlookandfeelmetric(in wstring propertyname); obsolete since gecko 1.9 wstring getproperty(in wstring propertyname); nsisupports getpropertyassupports(in wstring propertyname); void removeproperty(in wstring propertyname); void setproperty(in wstring propertyname, in wstring propertyvalue); void setpropertyassupports(in wstring propertyname, in nsisupports value); attributes attribute type description element nsidomelement read only.
...in wstring propertyname ); parameters propertyname return value getproperty() wstring getproperty( in wstring propertyname ); parameters propertyname return value getpropertyassupports() nsisupports getpropertyassupports( in wstring propertyname ); parameters propertyname return value removeproperty() void removeproperty( in wstring propertyname ); parameters propertyname setproperty() void setproperty( in wstring propertyname, in wstring propertyvalue ); parameters propertyname propertyvalue setpropertyassupports() void setpropertyassupports( in wstring propertyname, in nsisupports value ); parameters propertyname value ...
nsIBrowserSearchService
newindex the engine's new index in the set of visible engines.
...(that is the set of engines returned by getdefaultengines()) void restoredefaultengines(); parameters none.
nsICacheSession
l] in boolean nowait); void evictentries(); prbool isstorageenabled(); nsicacheentrydescriptor opencacheentry(in acstring key, in nscacheaccessmode accessrequested, in boolean blockingmode); void doomentry(in acstring key, in nsicachelistener listener); attributes attribute type description doomentriesifexpired prbool expired entries will be doomed or evicted if this attribute is set to true.
...if blockingmode is set to false, it will return ns_error_cache_wait_for_validation rather than block when another descriptor has been given write access but hasn't validated the entry yet.
nsICategoryManager
areplace); void deletecategory(in string acategory); void deletecategoryentry(in string acategory, in string aentry, in boolean apersist); nsisimpleenumerator enumeratecategories(); nsisimpleenumerator enumeratecategory(in string acategory); string getcategoryentry(in string acategory, in string aentry); methods addcategoryentry() this method sets the value for the given entry on the given category.
...s = ''; var types = []; var pref_disabled_plugin_types = 'plugin.disable_full_page_plugin_for_types'; if (services.prefs.prefhasuservalue(pref_disabled_plugin_types)) { stringtypes = services.prefs.getcharpref(pref_disabled_plugin_types); } if (stringtypes !== '') { types = stringtypes.split(','); } if (types.indexof(content_type) === -1) { types.push(content_type); } services.prefs.setcharpref(pref_disabled_plugin_types, types.join(',')); remarks categories have a variety of uses throughout the mozilla platform.
nsICookieManager
void remove( in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set.
... apath the path for which the cookie was set.
nsICookieManager2
void add( in autf8string ahost, in autf8string apath, in acstring aname, in acstring avalue, in boolean aissecure, in boolean aishttponly, in boolean aissession, in print64 aexpiry ); parameters ahost the host or domain for which the cookie is set.
... findmatchingcookie() obsolete since gecko 1.9 (firefox 3) find whether a matching cookie already exists, and how many cookies a given host has already set.
nsICookiePromptService
hostname the host that wants to set the cookie, not the domain; this is part of the cookie.
...rememberdecision should we set the matching permission for this host?
nsICryptoHash
this call resets the object.
...converter.charset = "utf-8"; // result is an out parameter, // result.value will contain the array length var result = {}; // data is an array of bytes var data = converter.converttobytearray(str, result); var ch = components.classes["@mozilla.org/security/hash;1"] .createinstance(components.interfaces.nsicryptohash); ch.init(ch.sha256); ch.update(data, data.length); var hash = ch.finish(false);...
nsIDOMNSHTMLDocument
designmode domstring set to "on" or "off" to enable or disable editing for the entire document at once.
...void captureevents( in long eventflags ); parameters eventflags clear() used to reset a document to blank, but deprecated since gecko 1.0 and provided for compatibility with netscape 4.x; use open() and close() instead.
nsIDOMParser
when a domparser is instantiated by calling new domparser(), it inherits the calling code's principal (except that for chrome callers the principal is set to the null principal) and the documenturi and baseuri of the window the constructor came from.
...supposedly, if you want to create objects that some particular set of unprivileged code will be able to access (see discussion in bug 565480).
nsIEditorDocShell
editor nsieditor gets or sets the editor for the content document.
... methods makeeditable() make this docshell editable, setting a flag that causes an editor to get created, either immediately, or after a url has been loaded.
nsIFileOutputStream
this means that any errors that might happen when this flag is not set would happen during the first write, and if the file is to be created, it will not appear on the disk until the first write.
...if set to -1 the default permissions (0664) will be used.
nsIFileURL
inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) attributes attribute type description file nsifile get/set nsifile corresponding to this url.
...the setter clones the nsifile object (allowing the caller to safely modify the nsifile object after setting it on this interface).
nsIInstallLocation
you should not use the exact values here, you should offset from these values each time you create a new install location.
... offsetting can be brittle but you should know what install locations are being defined for your own application.
nsILoadGroup
void addrequest(in nsirequest arequest, in nsisupports acontext); void removerequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatus); attributes attribute type description activecount unsigned long returns the count of "active" requests (that is requests without the load_background bit set).
...each time a number of requests are added to a group, the defaultloadrequest may be set to indicate that all of the requests are related to a base request.
nsIMessageBroadcaster
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "broadcasters" don't have a single "other side" that they send messages to, but rather a set of subordinate message managers.
... for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
nsIMicrosummaryObserver
onelementappended() called when an element is appended to a microsummary set.
... void onelementappended( in nsimicrosummary microsummary ); parameters microsummary the microsummary that has just been appended to the set.
nsIMsgDBView
openwithhdrs() opens the view with a set of specified headers.
... void reloadmessage(); reloadmessagewithallparts() reload the currently shown message with fetchcompletemessage set to true.
nsIMsgFilterCustomAction
* @param actionfolder folder in the filter list * @param filtertype filter type (manual, offlinemail, etc.) * * @return errormessage a localized message to display if invalid * set to null if the actionvalue is valid */ autf8string validateactionvalue(in autf8string actionvalue, in nsimsgfolder actionfolder, in nsmsgfiltertypetype filtertype); /* allow duplicate actions in the same filter list?
... */ /** * apply the custom action to an array of messages * * @param msghdrs array of nsimsgdbhdr objects of messages * @param actionvalue user-set value to use in the action * @param copylistener calling method (filtertype manual only) * @param filtertype type of filter being applied * @param msgwindow message window */ void apply(in nsiarray msghdrs /* nsimsgdbhdr array */, in autf8string actionvalue, in nsimsgcopyservicelistener copylistener, in nsmsgfiltertypetype filtertype...
nsINavBookmarkObserver
alastmodified the value to set the items last modified time to, or 0 if the value should remain unchanged.
... "tags" empty string; this property indicates that the set of tags for the item have changed.
nsINavHistoryResultViewer
although this attribute is read-write, you should not alter it directly; instead, use the nsinavhistoryresult.viewer attribute to set the viewer.
...this is called when the annotation is changed, set, or unset.
nsINetworkLinkService
8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/network/network-link-service;1 as a service: var networklinkservice = components.classes["@mozilla.org/network/network-link-service;1"] .getservice(components.interfaces.nsinetworklinkservice); attributes attribute type description islinkup boolean this is set to true when the system is believed to have a usable network connection.
... linkstatusknown boolean this is set to true when we believe that islinkup is accurate.
nsIObserverService
ownsweak if set to false, the nsiobserverservice will hold a strong reference to anobserver.
... if set to true and anobserver supports the nsisupportsweakreference interface, a weak reference will be held.
nsIOutputStream
example writesegments() example // copy data from a string to a stream static ns_method copysegment(nsiinputstream* astream, void* aclosure, char* atosegment, pruint32 afromoffset, pruint32 acount, pruint32* areadcount) { // afromsegment now contains acount bytes of data.
... nsacstring* pbuf = (nsacstring*) aclosure; const char* data; pruint32 len = ns_cstringgetdata(&data); data += afromoffset; len -= afromoffset; if (len > acount) len = acount; memcpy(atosegment, data, len); // indicate that we have copied len bytes to the segment *areadcount = len; return ns_ok; } // write the contents of asource into astream, using writesegments // to avoid intermediate buffer copies.
nsIParserUtils
at present, sanitizing css backgrounds, and so on., is not supported, so setting this together with sanitizerallowstyle doesn't make sense.
... sanitizerdropforms (1 << 4) flag for sanitizer: drops forms and form controls (excluding <fieldset> and <legend>.
nsIProcess
args an array of count arguments, using the native character set, to be passed to the executable on its command line.
... void runasync( [array, size_is(count)] in string args, in unsigned long count, in nsiobserver observer, optional in boolean holdweak optional ); parameters args an array of arguments to pass into the process, using the native character set.
nsIPropertyBag
xpcom/ds/nsipropertybag.idlscriptable this interface is used to store a set of properties.
..." appname:"netscape" appversion:"5.0 (windows)" battery:batterymanager buildid:"20140529161749" cookieenabled:true donottrack:"yes" geolocation:geolocation language:"en-us" mimetypes:mimetypearray mozalarms:null mozapps:xpcwrappednative_nohelper mozcameras:cameramanager mozconnection:mozconnection mozcontacts:contactmanager mozid:null mozkeyboard:xpcwrappednative_nohelper mozpay:null mozpermissionsettings:null mozphonenumberservice:phonenumberservice mozpower:mozpowermanager moztcpsocket:null online:true oscpu:"windows nt 5.1" platform:"win32" plugins:pluginarray product:"gecko" productsub:"20100101" useragent:"mozilla/5.0 (windows nt 5.1; rv:30.0) gecko/20100101 firefox/30.0" vendor:"" vendorsub:"" __proto__:navigatorprototype from here we can easily see the operating system version.
nsISHistory
in a non-embedded situation, the owner of the session history component must create a instance of it and set it in the nsiwebnavigation object.
... maxlength long used to get/set the maximum number of toplevel documents, session history can hold for each instance.
nsISocketTransportService
set to null if no proxy should be used.
...mozilla.org:2000 with tls support and default proxy settings var socket = transportservice.createtransport(["starttls"], 1,"mozilla.org", 2000, null); see also nsisockettransport nsirunnable nsiproxyinfo ...
nsIThreadInternal
last changed in gecko 1.9 (firefox 3) inherits from: nsithread method overview void popeventqueue(); void pusheventqueue(in nsithreadeventfilter filter); attributes attribute type description observer nsithreadobserver get/set the current thread observer; set to null to disable observing.
... this attribute may be read from any thread but must only be set on the thread corresponding to this thread object.
nsITreeSelection
note: setting this attribute to false will fire a select event.
...this parameter is inclusive; to select one item, set endindex == startindex.
nsIURIFixup
the fixup object implementer should honour this flag and only perform any lengthy keyword (or search) operation if it is set.
... fixup_flag_use_utf8 4 use utf-8 to encode the uri instead of the platform character set.
nsIUpdateChecker
force if true, the update checker checks for updates, regardless of the current value of the user's update settings.
...void stopchecking( in unsigned short duration ); parameters duration one of the constants indicating the set of updates to stop.
nsIWebBrowserChromeFocus
inherits from: nsisupports last changed in gecko 1.7 method overview void focusnextelement(); void focusprevelement(); methods focusnextelement() set the focus at the next focusable element in the chrome.
...focusprevelement() set the focus at the previous focusable element in the chrome.
nsIXULAppInfo
can be an empty string, if id is not set.
...can be an empty string if vendor is not set.
nsIZipReader
to create an instance, use: var zipreader = components.classes["@mozilla.org/libjar/zip-reader;1"] .createinstance(components.interfaces.nsizipreader); about character sets and code pages note: nsizipreader has a code page problem; that is, in the zip specification, filenames are supposed to use 7-bit ascii; however, most modern filesystems use 8 bit code pages, such as utf-8.
...set this parameter to null (javascript) or emptycstring() (c++) to get all entries; otherwise, use the following syntax: * matches anything.
nsIZipWriter
y(in autf8string azipentry); boolean hasentry(in autf8string azipentry); void open(in nsifile afile, in print32 aioflags); void processqueue(in nsirequestobserver aobserver, in nsisupports acontext); void removeentry(in autf8string azipentry, in boolean aqueue); attributes attribute type description comment acstring gets or sets the comment associated with the currently open zip file.
... recursively add all contents of a directory to zip file this example below can be copied and pasted into your scratchpad, set the environment to "browser" and can run.
NS_CStringToUTF16
see nscstringencoding for the set of values that can be passed for this parameter.
...the set of possible error codes is currently unspecified.
NS_UTF16ToCString
see nscstringencoding for the set of values that can be passed for this parameter.
...the set of possible error codes is currently unspecified.
nsMsgMessageFlags
priorities 0x0000e000 the set of bits that indicate the priority.
... labels 0x0e000000 the set of bits used to identify labels.
XPCOM reference
if you're working on a module in the mozilla codebase that's compiled with the mozilla_internal_api flag set, some of these apis -- the string functions and classes in particular -- are not the ones you should be using.
...rss feeds are implemented by nslocalmailfolder.ns ensure successmacrons ensure truemacrons_abort_if_falsethis was removed in bug 1127201ns_addrefmacrons_assertionmacrons_ensure_arg_pointermacrons_errorthrows a assertion (ns_assertion) with the text "error: (error text)", so writes this text to console (stderr) and to debug logs (nspr logging).
Performance
the page size can be set using the page_size pragma before any operations have been done on the file.
... you can see an example of setting the maximum cache size to be a percentage of memory in nsnavhistory::initdb in toolkit/components/places/src/nsnavhistory.cpp.
Troubleshooting XPCOM components registration
set nspr_log_modules=nsnativemoduleloader:5 set nspr_log_file=c:\path\to\logfile "c:\program files\mozilla firefox\firefox.exe" examining this log for warning and errors may provide valuable clues why the component failed to load.
...(the -r switch from gnu ldd lists function relocations; adjust as suitable for your version) trace shared library loading by setting the environment variable ld_debug=all while launching firefox (see `man ld.so` for details).
Reference Manual
this implies that the entire application must be compiled with the same setting of nscap_feature_debug_ptr_types, else some parts will be expecting a base class and others will not.
... in both cases you end up with foo, a valid nscomptr whose value was set with the product of getfoo, and rv the status returned by getfoo.
Weak reference
if the referent object is destroyed before the weak reference, the pointer inside the weak reference is set to nsnull.
... in javascript, just make sure that your queryinterface method returns your object for the nsisupportsweakreference interface, and you're set; xpconnect does all the work for you.
XUL Overlays
MozillaTechXULOverlays
attaching a script to an overlay to execute a script when an overlay is applied, use a <script> element: <script src="overlay.js"/> if you need to set the version of javascript, you can set the type attribute: <script type="application/x-javascript;version=1.8" src="overlay.js"/> ui reuse with overlays one of the biggest benefits of using overlays is that it allows you to reuse groups of elements that appear frequently in the ui.
...rather than redefining this set of buttons each time they are necessary in a particular dialog, base xul files can overlay the xul file in which these buttons are defined, dialogoverlay.xul.
Buddy icons in mail
seth spitzer mozilla is now able to show icons in the message header area and the addressbook card pane.
... (see this document for info about that.) for the addressbook card pane, the icon will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for card>.gif if aim.session.screenname is not set, the icon will not appear.
DB Views (message lists)
these are the values filed in nsidbfolderinfo to remember the view settings for the folder.
... properties these nsmsgdbview methods set properties, nsitreeview.getrowproperties (implementation) nsitreeview.getcellpropreties (implementation) theming the theme uses these properties to style the thread pane.
Mail and RDF
here is an example of how this might be set up: in this tree-style representation of an rdf graph, i've made arcs italic and resources bold.
...in the document's onload= handler the datasources are attached to their respective widgets by setting the database property on each rdf template's parent element.
Mail event system
yitemboolpropertychanged onitemboolpropertychanged notifyitemunicharpropertychanged onitemunicharpropertychanged notifyitempropertyflagchanged onitempropertyflagchanged notifyitemevent onitemevent notifyfolderloaded onfolderloaded notifydeleteormovemessages ondeleteormovemessages sample code in this example, a listener will be set up to be notified when the message count changes in a folder: // our variable to know if the listener fired var listenerhasfired = false; var totalmessageslistenerhasfired = false; // the listening function that will react to changes function myonintpropertychanged(item, property, oldvalue, newvalue) { listenerhasfired=true; var propertystring = property.getunicode(); dump("onintproper...
... //now show us visually var folder = item.queryinterface(components.interfaces.nsimsgfolder); dump("the folder " + folder.prettyname + " now has " + newvalue + " messages."); } else if (propertystring == "testproperty") { dump("recieved integer test property fired on folder " + folder.prettyname + " with values " + oldvalue + " and " + newvalue + "\n"); } // set up the folder listener to point to the above function var folderlistener = { onitemadded: function(parent, item, viewstring) {}, onitemremoved: function(parent, item, viewstring) {}, onitempropertychanged: function(parent, item, viewstring) {}, onitemintpropertychanged: myonintpropertychanged, onitemboolpropertychanged: function(item, property, oldvalue, newvalue) {}, onitemunicharpro...
Main Windows
the rest is loaded from overlays: mailwindowoverlay.xul this is the red sections shown in the interface above (where?), including the toolbars, notification bars, and the status bar, but also includes most of the commands, keysets, and context menus of thunderbird, along with a whole lot of javascript.
... mailwindowoverlay.xul this is the red sections shown in the interface above, including the toolbars, notification bars and the status bar.it also includes most of the commands, keysets, and context menus of thunderbird, along with a whole lot of javascript.
Building a Thunderbird extension 1: introduction
the tutorial has the following pages: introduction (this page) the extension filesystem (setting up your local system) install manifest (the install.rdf file that contains meta-information about the extension) chrome manifest (list of packages and overlays) xul (the xml user interface language that is used to modify the thunderbird user interface) adding javascript (explains how to add some simple javascript to your thunderbird extension) installing locally (enabling the extension o...
...these are described on the page "setting up an extension development environment".
Access Window
you can do many things with the window object, such as accessing the height or width of the window/tab or setting its title, registering timer events and much more.
... register a timer window.setinterval( function() { alert('foobar'); }, 60000); //execute the function once very minute if you periodically need to perform a certain action then you can use the setinterval function, it will then call this function every x milliseconds, in this case every 60000ms or one minute.
Using the Mozilla source server
set up symbols follow the instructions for using the mozilla symbol server.
... once the symbol path is set you must now enable source server.
Using Objective-C from js-ctypes
*/ // apple docs :: working with blocks - https://developer.apple.com/library/ios/documentation/cocoa/conceptual/programmingwithobjectivec/workingwithblocks/workingwithblocks.html var _nsconcreteglobalblock = ctypes.open(ctypes.libraryname('objc')).declare('_nsconcreteglobalblock', ctypes.voidptr_t); // //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 /** * the "block descriptor" is a static singleton struct.
...criptor: block_descriptor_1.ptr } ]); var block_const = { block_has_copy_dispose: 1 << 25, block_has_ctor: 1 << 26, block_is_global: 1 << 28, block_has_stret: 1 << 29, block_has_signature: 1 << 30 }; // based on work from here: https://github.com/trueinteractions/tint2/blob/f6ce18b16ada165b98b07869314dad1d7bee0252/modules/bridge/core.js#l370-l394 var bl = block_literal_1(); // set the class of the instance bl.isa = _nsconcreteglobalblock; // global flags bl.flags = block_const.block_has_stret; bl.reserved = 0; bl.invoke = afunctypeptr; // create descriptor var desc = block_descriptor_1(); desc.reserved = 0; desc.size = block_literal_1.size; // set descriptor into block literal bl.descriptor = desc.address(); return bl; } an example of this function in use...
Declaring types
at the core of all this is a set of predefined types provided by js-ctypes.
...in order to accomplish this you can either set the type of next to ctypes.voidptr_t, or to be more accurate, use the define technique: var struct = ctypes.structtype('struct'); struct.define([{ next: struct.ptr }]); arrays to declare a new array type, you use the ctypes.arraytype() method.when declaring a new array type, you provide a ctype indicating the type of each element in the array as well as an optional array length.
Working with data
setting the value of p.x will affect the value of r.topleft.x, as expected.
... var i = ctypes.int32_t(9); // create a c integer whose value is 9 var p = i.address(); // create a pointer to the integer variable i if (p.contents == 9) { // look at the contents of the pointer // the value is 9 } else { // the value isn't 9 } setting data referenced by pointer you can also use the contents property to set the value pointed to by a variable.
ctypes.open
loading the native file if your addon is restartless, you must set it to be unpacked.
... path like this: function startup(adata, areason) { var jarpath_folder = 'jar:' + os.path.tofileuri(adata.installpath.path) + '!/'; // if unpacked is false in install.rdf this will look like: "jar:file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aksozfjt.unnamed%20profile%2010/extensions/asynczip@jetpack!/" var filepath_folder = adata.installpath.path; // if unpacked is set to false in install.rdf this will look like: "c:\users\vayeate\appdata\roaming\mozilla\firefox\profiles\aksozfjt.unnamed profile 10\extensions\asynczip@jetpack" var filepath_mylib = os.path.join(filepath_folder, 'mysubfolder', 'mycfunctionsforunix.so'); var jarpath_mylib = jarpath_folder + 'mysubfolder/mycfunctionsforunix.so'; } this can then be opened and the c functions within can be...
ctypes
cannot be set.
...cannot be set.
Browser Side Plug-in API - Plugins
npn_setvalue sets windowless plug-in as transparent or opaque.
... npn_setvalueforurl allows a plug-in to change the stored information associated with a url, in particular its cookies.
Initialization and Destruction - Plugins
at this point, a plug-in can call the npn_setvalue function to specify whether it is windowed (the default) or windowless.
... the example in this section sets up a buffer and allocates memory for it.
Plug-in Side Plug-in API - Plugins
npp_setvalue sets information about the plug-in.
... npp_setwindow tells the plug-in when a window is created, moved, sized, or destroyed.
Scripting plugins - Plugins
calling npn_getvalue() with either of those new enumerations will return an npobject representing the browser object, and from there, the functions in this api can be used to get and set properties, and to call methods on those browser objects.
...iantvalue npn_getstringidentifier npn_getstringidentifiers npn_getintidentifier npn_identifierisstring npn_utf8fromidentifier npn_intfromidentifier npobject npn_construct (since firefox 3.0b1) npn_createobject npn_retainobject npn_releaseobject npn_invoke npn_invokedefault npn_enumerate (since mozilla 1.9a1) npn_evaluate npn_getproperty npn_setproperty npn_removeproperty npn_hasproperty npn_hasmethod npn_setexception npclass « previousnext » ...
Wait-cursor - XUL
maybe i'm missing something here, but window.setattribute(...) throws an error.
... i'm using window.setcursor('wait') and window.setcursor('auto') for get this effect.
Debugging service workers - Firefox Developer Tools
testing a service worker cache if you are using your service worker to store your site assets in cache storage (using the cache api), which is essential for creating offline apps, it can be annoying to test the cache.
... 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.
DOM Property Viewer - Firefox Developer Tools
enable it in the developer tools settings.
...to enable it, open the developer tool settings and check the "dom" box under "default firefox developer tools".
Examine, modify, and watch variables - Firefox Developer Tools
if you need to use it, you can, for now, switch back to the old debugger by visiting about:config and setting the "devtools.debugger.new-debugger-frontend" preference to false.
... you can filter the variables that are displayed, either by using the "*" modifier in the script filter, or by typing into the filter variables box, if you have enabled this in the debugger settings.
Step through code - Firefox Developer Tools
if you want to turn this feature off, since firefox 71 you can do so by going to about:config in a new tab, setting the devtools.debugger.features.overlay pref to false, and restarting the browser.
...see set a breakpoint > inline variable preview for more information.
Using the Debugger map scopes feature - Firefox Developer Tools
select the "bundle.js" file in the sources panel on the left and then set a breakpoint at line 102 in the increment function.
...notice that your breakpoint is set here in the original code as it was in the corresponding line in the "bundle.js" file.
The Firefox JavaScript Debugger - Firefox Developer Tools
there are multiple ways to tell the debugger how and when to pause: set a breakpoint set a conditional breakpoint set an xhr breakpoint set event listener breakpoints break on exceptions use watchpoints for property reads and writes break on dom mutation disable breakpoints control execution what can you do after execution pauses?
... set a logpoint set watch expressions reference keyboard shortcuts source map errors ...
Eyedropper - Firefox Developer Tools
underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in settings > inspector > default color unit: you can use it in one of two ways: to select a color from the page and copy it to the clipboard to change a color value in the inspector's rules view to a color you've selected from the page copying a color to the clipboard open the eyedropper in one of these two ways: select "eyedropper" under the "web developer" menu open the page inspector tab and click the eyedropper button in its toolbar as you move the mo...
... now, when you click the eyedropper, the color in the rules view is set to the color you selected.
JSON viewer - Firefox Developer Tools
to enable this feature in other release channels, set the devtools.jsonview.enabled preference to true.
...if you open a json file in the browser, or view a remote url with the content-type set to application/json, it is parsed and given syntax highlighting.
Measure a portion of the page - Firefox Developer Tools
to enable its button: go to the devtools settings.
... you will now see the measure a portion of the page button at the top right of the toolbox, in the same place as the settings/options button.
Network request details - Firefox Developer Tools
"value": "private, must-revalidate, max-age=0" }, { "name": "content-disposition", "value": "inline; filename=api-result.js" }, { "name": "content-encoding", "value": "gzip" }, { "name": "content-length", "value": "673" }, { "name": "content-type", "value": "text/javascript; charset=utf-8" }, { "name": "date", "value": "tue, 11 jun 2019 13:01:39 gmt" }, { "name": "mediawiki-login-suppressed", "value": "true" }, { "name": "p3p", "value": "cp=\"this is not a p3p policy!
... request timing the request timing section breaks a network request down into the following subset of the stages defined in the http archive specification: name description blocked time spent in a queue waiting for a network connection.
Edit Shape Paths in CSS - Firefox Developer Tools
inset() if the value of shape-outside is inset() then you are using the inset basic shape, which enables the creation of offset values pulling the content in from the margin box.
... each side of the rectangle can be targeted after clicking on the shapes icon to activate the shape path editor, and dragging each side will update the values for the top, right, bottom, and left offset values.
Animation inspector example: Web Animations API - Firefox Developer Tools
m; box-shadow: 1px 1px 5px #808080; margin: 1.5em; } .channel > * { vertical-align: middle; line-height: normal; } #icon { width: 50px; height: 50px; filter: grayscale(100%); } #note { margin-left: 1em; font: 1.5em "open sans",arial,sans-serif; overflow: hidden; white-space: nowrap; display: inline-block; opacity: 0; width: 0; } javascript content var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)'}, { filter: 'grayscale(100%)', offset: 0.333}, { transform: 'scale(1.5)', offset: 0.666 }, { transform: 'scale(1.5)', filter: 'grayscale(0%)'} ]; var notekeyframeset = [ { opacity: '0', width: '0'}, { opacity: '1', width: '300px'} ]; var iconkeyframeoptions = { duration: 750, fill: 'forwards', easing: 'ease-in', enddela...
...y: 100 } var notekeyframeoptions = { duration: 500, fill: 'forwards', easing: 'ease-out', delay: 150 } var icon = document.getelementbyid("icon"); var note = document.getelementbyid("note"); var iconanimation = icon.animate(iconkeyframeset, iconkeyframeoptions); var noteanimation = note.animate(notekeyframeset, notekeyframeoptions); iconanimation.pause(); noteanimation.pause(); var firsttime = true; function animatechannel(e) { if (e.button != 0) { return; } if (e.target.id != "icon") { return; } if (firsttime) { iconanimation.play(); noteanimation.play(); firsttime = false; } else { iconanimation.reverse(); noteanimation.reverse(); } } document.addeventlistener("click", animatechannel); ...
UI Tour - Firefox Developer Tools
access the settings popup recordings pane the recordings pane lists all the recordings you have loaded, including any you have made in this session and any you have imported.
... the allocations view only appears if you checked "record allocations" in the performance tool settings, before recording a profile: to learn much more about the allocations view, see the separate allocations page.
Rulers - Firefox Developer Tools
to be able to toggle rulers for a page, you first need to enable the button by going to the settings page for the developer tools and checking "toggle rulers for the page" under available toolbox buttons.
... once enabled, the "toggle rulers for the page" button appears at the top right of the toolbox, in the same place as the settings/options button.
Console messages - Firefox Developer Tools
this is not shown by default: you can opt to see timestamps by selecting show timestamps in the console settings menu (gear icon in the console toolbar).
...to override this behavior, enable persist logs in the console settings menu (gear icon).
AesCtrParams - Web APIs
this should be set to aes-ctr.
...for example, if length is set to 64, then the first half of counter is the nonce and the second half is used for the counter.
Animation.finish() - Web APIs
WebAPIAnimationfinish
the finish() method of the web animations api's animation interface sets the current playback time to the end of the animation corresponding to the current playback direction.
... that is, if the animation is playing forward, it sets the playback time to the length of the animation sequence, and if the animation is playing in reverse (having had its reverse() method called), it sets the playback time to 0.
Animation.onfinish - Web APIs
you can force the animation into the "finished" state by setting its starttime to document.timeline.currenttime - (animation.currenttime * animation.playbackrate).
... syntax var finishhandler = animation.onfinish; animation.onfinish = finishhandler; value a function to be called to handle the finish event, or null if no finish event handler is set.
Animation.onremove - Web APIs
syntax var removehandler = animation.onremove; animation.onremove = removehandler; value a function to be called to handle the remove event, or null if no remove event handler is set.
...the event handler sets up an animation that animates the <div> element to the position of the mouse pointer.
Animation.timeline - Web APIs
the animation.timeline property of the animation interface returns or sets the timeline associated with this animation.
... examples here we set the animation's timeline to be the same as the document's timeline (this is the default timeline for all animations, by the way): animation.timeline = document.timeline; specifications specification status comment web animationsthe definition of 'animation.timeline' in that specification.
AudioBuffer - Web APIs
the audiobuffer interface represents a short audio asset residing in memory, created from an audio file using the audiocontext.decodeaudiodata() method, or from raw data using audiocontext.createbuffer().
...// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); specifications specification status comment web audio apithe definition of 'audiobuffer' in that specification.
AudioBufferSourceNode.buffer - Web APIs
if the buffer property is set to the value null, the node generates a single channel containing silence (that is, every sample is 0).
... // this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; specifications specification status comment web audio apithe definition of 'buffer' in that specification.
AudioContext.close() - Web APIs
when the promise resolves, the example is reset to its beginning state.
... stopbtn.onclick = function() { audioctx.close().then(function() { startbtn.removeattribute('disabled'); susresbtn.setattribute('disabled', 'disabled'); stopbtn.setattribute('disabled', 'disabled'); }); } specifications specification status comment web audio apithe definition of 'close()' in that specification.
AudioDestinationNode.maxChannelCount - Web APIs
the audionode.channelcount property can be set between 0 and this value (both included).
... example the following would set up a simple audio graph, featuring an audiodestinationnode with maxchannelcount of 2: var audioctx = new audiocontext(); var source = audioctx.createmediaelementsource(mymediaelement); source.connect(gainnode); audioctx.destination.maxchannelcount = 2; gainnode.connect(audioctx.destination); to see a more complete implementation, check out one of our mdn web audio examples, such as voice-change-o-matic or violent theremin.
AudioNode.channelInterpretation - Web APIs
this can be somewhat controlled by setting the audionode.channelinterpretation property to speakers or discrete: interpretation input channels output channels mixing rules speakers 1 (mono) 2 (stereo) up-mix from mono to stereo.
... output.l = input.l + 0.7071 * input.c output.r = input.r + 0.7071 * input.c output.sl = input.sl output.sr = input.sr other, non-standard layouts non-standard channel layouts are handled as if channelinterpretation is set to discrete.
AudioNode.connect() - Web APIs
WebAPIAudioNodeconnect
var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // create an normal oscillator to make sound var oscillator = audioctx.createoscillator(); // create a second oscillator that will be used as an lfo (low-frequency // oscillator), and will control a parameter var lfo = audioctx.createoscillator(); // set the frequency of the second oscillator to a low number lfo.frequency.value = 2.0; // 2hz: two oscillations par second // create a gain whose gain audioparam will be controlled by the lfo var gain = audioctx.creategain(); // connect the lfo to the gain audioparam.
... therefore, it is possible to choose the range in which an audioparam will change by setting the value of the audioparam to the central frequency, and to use a gainnode between the audio source and the audioparam to adjust the range of the audioparam changes.
AudioParam.exponentialRampToValueAtTime() - Web APIs
this is pretty useful for fade in/fade out effects: // create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var exprampplus = document.queryselector('.exp-ramp-plus'); var exprampminus = document.queryselector('.exp-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmediaelement into...
... it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set its gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick exprampplus.onclick = function() { gainnode.gain.exponentialramptovalueattime(1.0, audioctx.currenttime + 2); } exprampminus.onclick = function() { gainnode.gain.exponentialramptovalueattime(0.01, audioctx.currenttime + 2); } note: a value of 0.01 was used for the value to ramp down to in the last function rather than 0, as an invalid or illegal string error is thrown if 0 is used — t...
AudioParam.linearRampToValueAtTime() - Web APIs
// create audio context var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); // set basic variables for example var myaudio = document.queryselector('audio'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; var linearrampplus = document.queryselector('.linear-ramp-plus'); var linearrampminus = document.queryselector('.linear-ramp-minus'); // create a mediaelementaudiosourcenode // feed the htmlmedia...
...element into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick linearrampplus.onclick = function() { gainnode.gain.linearramptovalueattime(1.0, audioctx.currenttime + 2); } linearrampminus.onclick = function() { gainnode.gain.linearramptovalueattime(0, audioctx.currenttime + 2); } specifications specification status comment web audio apithe definition of 'linearramptovalueattime' in that specification.
AudioProcessingEvent - Web APIs
for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case.
...rce = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessin...
AudioScheduledSourceNode.onended - Web APIs
this is the case, for example, when using an audiobuffersourcenode with its loop property set to true.
... examples in this simple example, an event listener for the ended event is set up to enable a "start" button in the user interface when the node stops playing.
AudioTrack.enabled - Web APIs
if the track is disabled by setting enabled to false, the track is muted and does not produce audio.
...setting enabled to false effectively mutes the audio track, preventing it from contributing to the media's audio performance.
AudioTrackList.getTrackById() - Web APIs
example this example suggests a hypothetical game in which movies are used as cut-scenes or other key set pieces within the game.
...the resulting track's audio is then disabled by setting its enabled flag to false.
AudioTrackList - Web APIs
usage notes in addition to being able to obtain direct access to the audio tracks present on a media element, audiotracklist lets you set event handlers on the addtrack and removetrack events, so that you can detect when tracks are added to or removed from the media element's stream.
...to keep it up to date, handlers for the addtrack and removetrack events are set up.
BaseAudioContext.createBiquadFilter() - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(...
...distortion); distortion.connect(biquadfilter); biquadfilter.connect(convolver); convolver.connect(gainnode); gainnode.connect(audioctx.destination); // manipulate the biquad filter biquadfilter.type = "lowshelf"; biquadfilter.frequency.setvalueattime(1000, audioctx.currenttime); biquadfilter.gain.setvalueattime(25, audioctx.currenttime); specifications specification status comment web audio apithe definition of 'createbiquadfilter()' in that specification.
BaseAudioContext.createBuffer() - Web APIs
the asynchronous method decodeaudiodata() does the same thing — takes compressed audio, say, an mp3 file, and directly gives you back an audiobuffer that you can then set to play via in an audiobuffersourcenode.
...// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); specifications specification status comment web audio apithe definition of 'createbuffer()' in that specification.
BaseAudioContext.createDelay() - Web APIs
var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ...
... var delay1; rangesynth.oninput = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, audioctx.currenttime); } specifications specification status comment web audio apithe definition of 'createdelay()' in that specification.
BaseAudioContext.createDynamicsCompressor() - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function...
...() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); button.innerhtml = 'add compression'; source.disconnect(compressor); compressor.disconnect(audioctx.destination); source.connect(audioctx.destination); } } specifications specification status comment web audio apithe definition of 'createdynamicscompressor()' in that specification.
BaseAudioContext.createScriptProcessor() - Web APIs
for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case.
...rce = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessin...
BasicCardRequest.supportedNetworks - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.billingAddress - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardNumber - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardSecurityCode - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.cardholderName - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.expiryMonth - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BasicCardResponse.expiryYear - Web APIs
no support noedge no support ≤18 — 79firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 57firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
BiquadFilterNode.getFrequencyResponse() - Web APIs
the getfrequencyresponse() method of the biquadfilternode interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies specified in a specified array of frequencies.
... our html to contain our results, and grab a reference to it in our javascript: <p>biquad filter frequency response for: </p> <ul class="freq-response-output"> </ul> var freqresponseoutput = document.queryselector('.freq-response-output'); finally, after creating our biquad filter, we use getfrequencyresponse() to generate the response data and put it in our arrays, then loop through each data set and output them in a human-readable list at the bottom of the page: var biquadfilter = audioctx.createbiquadfilter(); biquadfilter.type = "lowshelf"; biquadfilter.frequency.value = 1000; biquadfilter.gain.value = range.value; ...
Body.arrayBuffer() - Web APIs
WebAPIBodyarrayBuffer
when the fetch is successful, we read an arraybuffer out of the response using arraybuffer(), decode the audio data using audiocontext.decodeaudiodata, set the decoded data as the audio buffer source's buffer (source.buffer), then connect the source up to the audiocontext.destination.
...request('viper.ogg'); fetch(myrequest).then(function(response) { return response.arraybuffer(); }).then(function(buffer) { audioctx.decodeaudiodata(buffer, function(decodeddata) { source.buffer = decodeddata; source.connect(audioctx.destination); }); }); }; // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } reading files the response() constructor accepts files and blobs, so it may be used to read a file into other formats.
CSSRule - Web APIs
WebAPICSSRule
ule.supports_rule 12 csssupportsrule cssrule.document_rule 13 cssdocumentrule cssrule.font_feature_values_rule 14 cssfontfeaturevaluesrule cssrule.viewport_rule 15 cssviewportrule cssrule.region_style_rule 16 cssregionstylerule cssrule.unknown_rule 0 cssunknownrule cssrule.charset_rule 2 csscharsetrule (removed in most browsers.) an up-to-date informal list of constants can be found on the csswg wiki.
... working draft obsoleted values charset_rule and unknown_rule.
CSSStyleDeclaration.cssText - Web APIs
the csstext property of the cssstyledeclaration interface returns or sets the text of the element's inline style declaration only.
... to be able to set a stylesheet rule dynamically, see using dynamic styling information.
CSSStyleDeclaration.length - Web APIs
syntax var num = styles.length; value an integer that provides the number of styles explictly set on the parent of the instance.
... example the following gets the number of explicitly set styles on the following html element: <div id="div1" style="margin: 0 10px; background-color: #ca1; font-family: monospace"></div> javascript code: var mydiv = document.getelementbyid('div1'); var divstyle = mydiv.style; var len = divstyle.length; // 6 specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration.length' in that specification.
CSSStyleDeclaration - Web APIs
setting this attribute changes the style.
... cssstyledeclaration.setproperty() modifies an existing css property or creates a new css property in the declaration block.
CSSStyleValue.parseAll() - Web APIs
the parseall() method of the cssstylevalue interface sets all occurences of a specific css property to the specified value and returns an array of cssstylevalue objects, each containing one of the supplied values.
... syntax cssstylevalue.parseall(property, value) parameters property a css property to set.
CSSStyleValue - Web APIs
cssimagevalue csskeywordvalue cssnumericvalue csspositionvalue csstransformvalue cssunparsedvalue methods cssstylevalue.parse() sets a specific css property to the specified values and returns the first value as a cssstylevalue object.
... cssstylevalue.parseall() sets all occurences of a specific css property to the specified valueand returns an array of cssstylevalue objects, each containing one of the supplied values.
CSS Font Loading API - Web APIs
fontfaceset an interface loading font faces and checking their download statuses.
... fontfacesetloadevent fired whenever a fontfaceset loads.
CSS Object Model (CSSOM) - Web APIs
the css object model is a set of apis allowing the manipulation of css from javascript.
... reference animationevent caretposition css csscharsetrule cssconditionrule csscounterstylerule cssfontfacerule cssfontfeaturevaluesmap cssfontfeaturevaluesrule cssgroupingrule cssimportrule csskeyframerule csskeyframesrule cssmarginrule cssmediarule cssnamespacerule csspagerule cssrule cssrulelist cssstyledeclaration cssstylesheet cssstylerule csssupportsrule cssvariablesmap cssviewportrule elementcssinlinestyle fontface fontfaceset fontfacesetloadevent geometryutils getstyleutils linkstyle medialist mediaquerylist mediaquerylistevent mediaquerylistlistener screen stylesheet stylesheetlist transitionevent several other interfa...
Using the CSS properties and values API - Web APIs
with an unregisterd property, the browser likewise doesn't know what the value may be until it's calculated, and because of that, it can't set up a transition from one value to another.
... when registered, though, you've told the browser what type of value it should expect, and because it knows that, it can then set up the transitions properly.
CanvasGradient.addColorStop() - Web APIs
the canvasgradient.addcolorstop() method adds a new color stop, defined by an offset and a color, to a given canvas gradient.
... syntax void gradient.addcolorstop(offset, color); parameters offset a number between 0 and 1, inclusive, representing the position of the color stop.
CanvasGradient - Web APIs
canvasgradient.addcolorstop() adds a new stop, defined by an offset and a color, to the gradient.
... if the offset is not between 0 and 1, inclusive, an index_size_err is raised; if the color can't be parsed as a css <color>, a syntax_err is raised.
CanvasPattern - Web APIs
canvaspattern.settransform() applies an svgmatrix or dommatrix representing a linear transform to the pattern.
... living standard added settransform() method in v5.
CanvasRenderingContext2D.addHitRegion() - Web APIs
(if you don't see the full smiley, check the browser compatibility table to see if your current browser supports hit regions already; you might need to activate a preference.) playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code" style="height:250px"> ctx.beginpath(); ctx.arc(100, 100, 75, 0, 2 * math.pi, false); ctx.linewidth = 5; ctx.stroke(); // eyes ctx.beginpath(); ctx.arc(70, 80, 10, 0, 2 * math.pi, false); ctx.arc(130, 80, 10, 0, 2 * math.pi, false); ctx.fill(); ctx.addhitregion({id: "eyes"}); // mouth ctx.beginpath(); ctx.arc(100, 1...
...10, 50, 0, math.pi, false); ctx.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("reset"); var edit = document.getelementbyid("edit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = 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 h...
CanvasRenderingContext2D.arcTo() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const p0 = { x: 230, y: 20 } const p1 = { x: 90, y: 130 } const p2 = { x: 20, y: 20 } const labelpoint = function (p) { const offset = 15; ctx.filltext('(' + p.x + ',' + p.y + ')', p.x + offset, p.y + offset); } ctx.beginpath(); ctx.moveto(p0.x, p0.y); ctx.arcto(p1.x, p1.y, p2.x, p2.y, 50); ctx.lineto(p2.x, p2.y); labelpoint(p0); labelpoint(p1); labelpoint(p2); ctx.stroke(); result result of a large radius if you use a relatively large radius, the arc may appear in a place you didn't expect.
...nt.getelementbyid('radius-output'); const control = document.getelementbyid('radius'); control.oninput = () => { controlout.textcontent = r = control.value; }; const mouse = { x: 0, y: 0 }; let r = 100; // radius const p0 = { x: 0, y: 50 }; const p1 = { x: 100, y: 100 }; const p2 = { x: 150, y: 50 }; const p3 = { x: 200, y: 100 }; const labelpoint = function (p, offset, i = 0){ const {x, y} = offset; ctx.beginpath(); ctx.arc(p.x, p.y, 2, 0, math.pi * 2); ctx.fill(); ctx.filltext(`${i}:(${p.x}, ${p.y})`, p.x + x, p.y + y); } const drawpoints = function (points){ for (let i = 0; i < points.length; i++) { var p = points[i]; labelpoint(p, { x: 0, y: -20 } , i) } } // draw arc const drawarc = function ([p0, p1, p2], r) { ctx.begi...
CanvasRenderingContext2D.currentTransform - Web APIs
the canvasrenderingcontext2d.currenttransform property of the canvas 2d api returns or sets a dommatrix (current specification) or svgmatrix (old specification) object for the current transformation matrix.
... examples manually changing the matrix this example uses the currenttransform property to set a transformation matrix.
CanvasRenderingContext2D.fillText() - Web APIs
the text is rendered using the settings specified by font, textalign, textbaseline, and direction.
... with that in hand, we set the font to 50-pixel-tall "serif" (the user's default serif font), then call filltext() to draw the text "hello world," starting at the coordinates (50, 90).
CanvasRenderingContext2D.imageSmoothingEnabled - Web APIs
on getting the imagesmoothingenabled property, the last value it was set to is returned.
...set this property to false to retain the pixels' sharpness.
CanvasRenderingContext2D.imageSmoothingQuality - Web APIs
the imagesmoothingquality property of the canvasrenderingcontext2d interface, part of the canvas api, lets you set the quality of image smoothing.
... example setting image smoothing quality this example uses the imagesmoothingquality property with a scaled image.
CanvasRenderingContext2D.scale() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // scaled rectangle ctx.scale(9, 3); ctx.fillstyle = 'red'; ctx.fillrect(10, 10, 8, 20); // reset current transformation matrix to the identity matrix ctx.settransform(1, 0, 0, 1, 0, 0); // non-scaled rectangle ctx.fillstyle = 'gray'; ctx.fillrect(10, 10, 8, 20); result the scaled rectangle is red, and the non-scaled rectangle is gray.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.scale(-1, 1); ctx.font = '48px serif'; ctx.filltext('hello world!', -280, 90); ctx.settransform(1, 0, 0, 1, 0, 0); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.scale' in that specification.
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
context('2d'); ctx.beginpath(); ctx.fillrect(10, 10, 30, 30); ctx.scrollpathintoview(); edit the code below to see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"> <input id="button" type="range" min="1" max="12"> </canvas> <div class="playable-buttons"> <input id="edit" type="button" value="edit" /> <input id="reset" type="button" value="reset" /> </div> <textarea id="code" class="playable-code"> ctx.beginpath(); ctx.rect(10, 10, 30, 30); ctx.scrollpathintoview();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("reset"); var edit = document.getelementbyid("edit"); var code = tex...
...tarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.scrollpathintoview' in that specification.
CanvasRenderingContext2D.strokeRect() - Web APIs
the canvasrenderingcontext2d.strokerect() method of the canvas 2d api draws a rectangle that is stroked (outlined) according to the current strokestyle and other context settings.
... const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.strokestyle = 'green'; ctx.strokerect(20, 10, 160, 100); result applying various context settings this example draws a rectangle with a drop shadow and thick, beveled outlines.
CanvasRenderingContext2D.strokeText() - Web APIs
the text is rendered using the settings specified by font, textalign, textbaseline, and direction.
... with that in hand, we set the font to 50-pixel-tall "serif" (the user's default serif font), then call stroketext() to draw the text "hello world," starting at the coordinates (50, 90).
Optimizing canvas - Web APIs
var scalex = window.innerwidth / canvas.width; var scaley = window.innerheight / canvas.height; var scaletofit = math.min(scalex, scaley); var scaletocover = math.max(scalex, scaley); stage.style.transformorigin = '0 0'; //scale from top left stage.style.transform = 'scale(' + scaletofit + ')'; turn off transparency if your application uses canvas and doesn’t need a transparent backdrop, set the alpha option to false when creating a drawing context with htmlcanvaselement.getcontext().
... with animations, use window.requestanimationframe() instead of window.setinterval() .
CaretPosition - Web APIs
caretposition.offsetnode read only returns a node containing the found node at the caret's position.
... caretposition.offset read only returns a long representing the character offset in the caret position node.
ChannelSplitterNode - Web APIs
the channelsplitternode interface, often used in conjunction with its opposite, channelmergernode, separates the different channels of an audio source into a set of mono outputs.
... var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac.createbuffersource(); source.buffer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
ChildNode.after() - Web APIs
WebAPIChildNodeafter
the childnode.after() method inserts a set of node or domstring objects in the children list of this childnode's parent, just after this childnode.
...nodes); parameters nodes a set of node or domstring objects to insert.
ChildNode.before() - Web APIs
WebAPIChildNodebefore
the childnode.before() method inserts a set of node or domstring objects in the children list of this childnode's parent, just before this childnode.
...nodes); parameters nodes a set of node or domstring objects to insert.
ChildNode.replaceWith() - Web APIs
the childnode.replacewith() method replaces this childnode in the children list of its parent with a set of node or domstring objects.
...nodes); parameters nodes a set of node or domstring objects to replace.
Clipboard.writeText() - Web APIs
example this example sets the clipboard's contents to the string "<empty clipboard>".
... navigator.clipboard.writetext("<empty clipboard>").then(function() { /* clipboard successfully set */ }, function() { /* clipboard write failed */ }); specifications specification status comment clipboard api and eventsthe definition of 'writetext()' in that specification.
Console API - Web APIs
the console api provides functionality to allow developers to perform debugging tasks, such as logging messages or the values of variables at set points in your code, or timing how long an operation takes to complete.
...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.
ConstrainDOMString - Web APIs
it allows you to specify one or more exact string values from which one must be the parameter's value, or a set of ideal values which should be used if possible.
...if the property can't be set to one of the listed values, matching will fail.
CredentialsContainer - Web APIs
credentialscontainer.preventsilentaccess()secure context sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty promise.
... credentialscontainer.store()secure context stores a set of credentials for a user, inside a provided credential instance and returns that instance in a promise.
CustomElementRegistry.define() - Web APIs
// create a class for the element class popupinfo extends htmlelement { constructor() { // always call super first in constructor super(); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create spans var wrapper = document.createelement('span'); wrapper.setattribute('class','wrapper'); var icon = document.createelement('span'); icon.setattribute('class','icon'); icon.setattribute('tabindex', 0); var info = document.createelement('span'); info.setattribute('class','info'); // take attribute content and put it inside the info span var text = this.getattribute('text'); info.textcontent = text; // insert icon va...
...+/g).length; } var count = 'words: ' + countwords(wcparent); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); <p is="word-count"></p> specifications specification status comment html living standardthe definition of 'customelements.define()' in that specification.
DOMLocator - Web APIs
domlocator.byteoffset read only returns a positive integer or -1.
... domlocator.utf16offset read only returns a positive integer or -1.
DOMQuad - Web APIs
WebAPIDOMQuad
methods domquad.fromrect() returns a new domquad object based on the passed set of coordinates.
... domquad.fromquad() returns a new domquad object based on the passed set of coordinates.
DOMTokenList.value - Web APIs
the value property of the domtokenlist interface is a stringifier that returns the value of the list as a domstring, or clears and sets the list to the given value.
... syntax tokenlist.value; value a domstring examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist, then write the value of the list to the <span>'s node.textcontent.
DOMUserData - Web APIs
it is returned or used as an argument by node.setuserdata(), node.getuserdata(), used as the third argument to handle() on userdatahandler, and is used or returned by various domconfiguration methods.
... 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.addElement() - Web APIs
the datatransfer.addelement() method sets the drag source to the given element.
... syntax void datatransfer.addelement(el); arguments el the element to set as the drag source.
DataTransfer.clearData() - Web APIs
example this example shows the use of the datatransfer object's getdata(), setdata() and cleardata() methods.
... event.datatransfer.cleardata(); // set the drag's format and data (use event target's id for data) event.datatransfer.setdata('text/plain', event.target.id); data.innerhtml = event.datatransfer.getdata('text/plain'); } function dragendhandler (event) { if (!dropped) { status.innerhtml = 'drag canceled'; } data.innerhtml = event.datatransfer.getdata('text/plain') || 'empty'; // change border to sig...
DataTransfer.getData() - Web APIs
example this example shows the use of the datatransfer object's getdata() and setdata() methods.
...pan> </div> <div id="div2" ondrop="drop(event)" ondragover="allowdrop(event)"></div> css content #div1, #div2 { width:100px; height:50px; padding:10px; border:1px solid #aaaaaa; } javascript content function allowdrop(allowdropevent) { allowdropevent.target.style.color = 'blue'; allowdropevent.preventdefault(); } function drag(dragevent) { dragevent.datatransfer.setdata("text", dragevent.target.id); dragevent.target.style.color = 'green'; } function drop(dropevent) { dropevent.preventdefault(); var data = dropevent.datatransfer.getdata("text"); dropevent.target.appendchild(document.getelementbyid(data)); document.getelementbyid("drag").style.color = 'black'; } result specifications specification status comment ...
DataTransfer.items - Web APIs
,items} properties</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of the target and add the moved element to the target's dom var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // print each format type if (ev.datatransfe...
...items[" + i + "].kind = " + ev.datatransfer.items[i].kind + " ; type = " + ev.datatransfer.items[i].type); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </script> <body> <h1>examples of <code>datatransfer</code>.{<code>types</code>, <code>items</code>} properties</h1> <ul> <li id="i1" ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the drop zone</li> </...
DelayNode.delayTime - Web APIs
var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ...
... var delay1; rangesynth.oninput = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, audioctx.currenttime); } specifications specification status comment web audio apithe definition of 'delaytime' in that specification.
DelayNode - Web APIs
WebAPIDelayNode
var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ...
... var delay1; rangesynth.oninput = function() { delay1 = rangesynth.value; synthdelay.delaytime.setvalueattime(delay1, audioctx.currenttime); } specifications specification status comment web audio apithe definition of 'delaynode' in that specification.
DisplayMediaStreamConstraints.video - Web APIs
if a mediatrackconstraints object is given instead, the video track will be processed to match the settings given in the constraints object.
... logicalsurface a constrainboolean value which may contain a single boolean value or a set of them, indicating whether or not to allow the user to choose source surfaces which do not directly correspond to display areas.
Document.anchors - Web APIs
WebAPIDocumentanchors
example if (document.anchors.length >= 5) { dump("found too many anchors"); } the following is an example that auto populates a table of contents with every anchor on the page: <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>test</title> <script> function init() { var toc = document.getelementbyid("toc"); var i, li, newanchor; for (i = 0; i < document.anchors.length; i++) { li = document.createelement("li"); newanchor = document.createelement('a'); newanchor.href = "#" + document.anchors[i].name; newanchor.innerhtml = document.anchors[i].text; li.appendchild(newanchor); ...
...y onload="init()"> <h1>title</h1> <h2><a name="contents">contents</a></h2> <ul id="toc"></ul> <h2><a name="plants">plants</a></h2> <ol> <li>apples</li> <li>oranges</li> <li>pears</li> </ol> <h2><a name="veggies">veggies</a></h2> <ol> <li>carrots</li> <li>celery</li> <li>beats</li> </ol> </body> </html> view on jsfiddle notes for reasons of backwards compatibility, the returned set of anchors only contains those anchors created with the name attribute, not those created with the id attribute.
Document.caretRangeFromPoint() - Web APIs
example basic demo: when clicking in a paragraph insert a line break at the caret position: html <p>lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
...stet clita kasd gubergren, no sea takimata sanctus est lorem ipsum dolor sit amet.</p> javascript function insertbreakatpoint(e) { let range; let textnode; let offset; if (document.caretpositionfrompoint) { range = document.caretpositionfrompoint(e.clientx, e.clienty); textnode = range.offsetnode; offset = range.offset; } else if (document.caretrangefrompoint) { range = document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; offset = range.startoffset; } // only split text_nodes if (textnode && textnode.nodetype == 3) { let replacement = textnode.splittext(offset); let br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement);...
Document.fullscreenEnabled - Web APIs
full-screen mode is available only for a page that has no windowed plug-ins in any of its documents, and if all <iframe> elements which contain the document have their allowfullscreen attribute set.
... 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.importNode() - Web APIs
if deep is set to true, then externalnode and all of its descendants are copied.
... if deep is set to false, then only externalnode is imported — the new node has no children.
Document.linkColor - Web APIs
the document.linkcolor property gets/sets the color of links within the document.
...as an alternative, you can set the css color property on either html anchor links (<a>) or on :link pseudo-classes.
Document.open() - Web APIs
WebAPIDocumentopen
this call, for example opens github.com in a new window, with its opener set to null: document.open('https://www.github.com','', 'noopener=true') two-argument document.open() browsers used to support a two-argument document.open(), with the following signature: document.open(type, replace) where type specified the mime type of the data you are writing (e.g.
... text/html) and replace if set (i.e.
Document.releaseCapture() - Web APIs
enabling mouse capture on an element is done by calling element.setcapture().
... example see the example for element.setcapture().
Document.vlinkColor - Web APIs
the document.vlinkcolor property gets/sets the color of links that the user has visited in the document.
... 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;}).
DocumentOrShadowRoot - Web APIs
documentorshadowroot.pointerlockelement read only returns the element set as the target for mouse events while the pointer is locked.
... methods documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node.
DynamicsCompressorNode - Web APIs
// create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function...
...() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); button.innerhtml = 'add compression'; source.disconnect(compressor); compressor.disconnect(audioctx.destination); source.connect(audioctx.destination); } } specifications specification status comment web audio apithe definition of 'dynamicscompressornode' in that specification.
EXT_frag_depth - Web APIs
the ext_frag_depth extension is part of the webgl api and enables to set a depth value of a fragment from within the fragment shader.
... examples enable the extension: gl.getextension('ext_frag_depth'); now the output variable gl_fragdepthext is available to set a depth value of a fragment from within the fragment shader: <script type="x-shader/x-fragment"> void main() { gl_fragcolor = vec4(1.0, 0.0, 1.0, 1.0); gl_fragdepthext = 0.5; } </script> specifications specification status comment ext_frag_depththe definition of 'ext_frag_depth' in that specification.
EffectTiming.iterationStart - Web APIs
syntax var timingproperties = { iterationstart = iterationnumber }; timingproperties.iterationstart = iterationnumber; value a floating-point value whose value is at least 0 and is not +infinity, indicating the offset into the number of iterations the animation sequence is to run at which to start animating.
... usually you'll use a value between 0.0 and 1.0 to indicate an offset into the first run of the animation at which to begin the animation performance, but any positive, non-infinite value is allowed.
EffectTiming.iterations - Web APIs
the default value is 1, indicating that it should only play once, but you can set it to any floating-point value (including positive infinity defaults to 1, and can also take a value of infinity to make it loop infinitely.
... exceptions typeerror an attempt was made to set the value of this property to a negative number or nan.
EffectTiming - Web APIs
these properties are all optional, although without setting a duration the animation will not play.
...0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
Element.attachShadow() - Web APIs
this can be one of: open: elements of the shadow root are accessible from javascript outside the root, for example using element.shadowroot: element.shadowroot; // returns a shadowroot obj closed: denies access to the node(s) of a closed shadow root from javascript outside it: element.shadowroot; // returns null delegatesfocus a boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability.
...s+/g).length; } var count = 'words: ' + countwords(wcparent); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); specifications specification status comment domthe definition of 'attachshadow()' in that specification.
Element.clientTop - Web APIs
WebAPIElementclientTop
as it happens, all that lies between the two locations (offsettop and client area top) is the element's border.
... this is because the offsettop indicates the location of the top of the border (not the margin) while the client area starts immediately below the border, (client area includes padding.) therefore, the clienttop value will always equal the integer portion of the .getcomputedstyle() value for "border-top-width".
Element: copy event - Web APIs
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault().
...ss="target" contenteditable="true">...and pasting it into this one</div> css div.source, div.target { border: 1px solid gray; margin: .5rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const source = document.queryselector('div.source'); source.addeventlistener('copy', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.tostring().touppercase()); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element: cut event - Web APIs
WebAPIElementcut event
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault().
...ass="target" contenteditable="true">...and pasting it into this one</div> css div.source, div.target { border: 1px solid gray; margin: .5rem; padding: .5rem; height: 1rem; background-color: #e9eef1; } js const source = document.queryselector('div.source'); source.addeventlistener('cut', (event) => { const selection = document.getselection(); event.clipboarddata.setdata('text/plain', selection.tostring().touppercase()); selection.deletefromdocument(); event.preventdefault(); }); result specifications specification status clipboard api and events working draft ...
Element.getAttributeNodeNS() - Web APIs
the corresponding setter method is setattributenodens.
... dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'getattributenodens()' in that specification.
Element.getBoundingClientRect() - Web APIs
the element's size is equal to its width/height + padding + border-width in the case that the standard box model is being used, or width/height only if box-sizing: border-box has been set on it.
... cross-browser fallback scripts requiring high cross-browser compatibility can use window.pagexoffset and window.pageyoffset instead of window.scrollx and window.scrolly.
Element.getClientRects() - Web APIs
fractional pixel offsets are possible.
... <h3>a paragraph with a span inside</h3> <p>both the span and the paragraph have a border set.
Element.getElementsByClassName() - Web APIs
similarly, if an existing element that doesn't match names has its set of classes adjusted so that it matches, it immediately appears in the collection.
... the opposite is also true; as elements no longer match the set of names, they are immediately removed from the collection.
Element.hasAttributeNS() - Web APIs
example // check that the attribute exists before you set a value var d = document.getelementbyid("div1"); if (d.hasattributens( "http://www.mozilla.org/ns/specialspace/", "special-align")) { d.setattribute("align", "center"); } notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 na...
...mespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'document.hasattributens' in that specification.
Element.hasPointerCapture() - Web APIs
the haspointercapture() method of the element interface sets whether the element on which it is invoked has pointer capture for the pointer identified by the given pointer id.
... examples <html> <script> function downhandler(ev) { const el = document.getelementbyid("target"); // element 'target' will receive/capture further events el.setpointercapture(ev.pointerid); /* ...
Element: mouseenter event - Web APIs
html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the div to make it more visible.
... #mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetarget'); const unorderedlist = document.getelementbyid('unorderedlist'); mousetarget.addeventlistener('mouseenter', e => { mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave', e => { mousetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create ...
Element: mouseleave event - Web APIs
html <div id='mousetarget'> <ul id="unorderedlist"> <li>no events yet!</li> </ul> </div> css styling the <div> to make it more visible.
... #mousetarget { box-sizing: border-box; width:15rem; border:1px solid #333; } javascript var entereventcount = 0; var leaveeventcount = 0; const mousetarget = document.getelementbyid('mousetarget'); const unorderedlist = document.getelementbyid('unorderedlist'); mousetarget.addeventlistener('mouseenter', e => { mousetarget.style.border = '5px dotted orange'; entereventcount++; addlistitem('this is mouseenter event ' + entereventcount + '.'); }); mousetarget.addeventlistener('mouseleave', e => { mousetarget.style.border = '1px solid #333'; leaveeventcount++; addlistitem('this is mouseleave event ' + leaveeventcount + '.'); }); function addlistitem(text) { // create a new text node using the supplied text var newtextnode = document.createtextnode(text); // create ...
Element.msZoomTo() - Web APIs
WebAPIElementmsZoomTo
the zoom level can be reset with mszoomto.
... example /* zooming in on an element while still keeping it centered in the viewport */ var args = { contentx: target.offsetleft + target.offsetwidth/2; contenty: target.offsettop + target.offsetheight/2; scalefactor: 2.0; } zoomer.mszoomto(args); see also microsoft api extensions ...
Element.name - Web APIs
WebAPIElementname
name gets or sets the name property of an element in the dom.
...text/javascript"> // get a reference to the first element in the form let formelement = document.forms['forma'].elements[0] // give it a name formelement.name = 'inputa' // show the value of the input alert(document.forms['forma'].elements['inputa'].value) </script> notes in internet explorer (ie), the name property of dom objects created using document.createelement() can't be set or modified.
Element.toggleAttribute() - Web APIs
; button.addeventlistener("click", function(){ input.toggleattribute("readonly"); }); result dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - polyfill if (!element.prototype.toggleattribute) { element.prototype.toggleattribute = function(name, force) { if(force !== void 0) force ...
...= !!force if (this.hasattribute(name)) { if (force) return true; this.removeattribute(name); return false; } if (force === false) return false; this.setattribute(name, ""); return true; }; } specification specification status comment domthe definition of 'element.toggleattribute' in that specification.
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.
... examples <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>comparison of event targets</title> <style> table { border-collapse: collapse; height: 150px; width: 100%; } td { border: 1px solid #ccc; font-weight: bold; padding: 5px; min-height: 30px; } .s...
Event.cancelBubble - Web APIs
setting its value to true before returning from an event handler prevents propagation of the event.
... in later implementations, setting this to false does nothing.
Event.composed - Web APIs
WebAPIEventcomposed
for example, this includes synthetic events that are created without their composed option wil set to true.
...the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively.
Event.returnValue - Web APIs
WebAPIEventreturnValue
it is set to true by default, allowing the default action to occur.
... setting this property to false prevents the default action.
EventSource.withCredentials - Web APIs
the withcredentials read-only property of the eventsource interface returns a boolean indicating whether the eventsource object was instantiated with cors credentials set.
... syntax var mywithcredentials = eventsource.withcredentials; value a boolean indicating whether the eventsource object was instantiated with cors credentials set (true), or not (false, the default).
EventTarget.removeEventListener() - Web APIs
now consider this: element.addeventlistener("mousedown", handlemousedown, { passive: true }); here, we specify an options object in which passive is set to true, while the other options are left to the default value of false.
... only the capture setting matters to removeeventlistener().
EventTarget - Web APIs
many event targets (including elements, documents, and windows) also support setting event handlers via onevent properties and attributes.
... void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example simple implementation of eventtarget var eventtarget = function() { this.listeners = {}; }; eventtarget.prototype.listeners = null; eventtarget.prototype.addeventlistener = function(type, callback) { if (!(type in this.listeners)) { this.listeners[type] = []; } this.listene...
FileList - Web APIs
WebAPIFileList
<!doctype html> <html> <head> </head> <body> <!--multiple is set to allow multiple files to be selected--> <input id="myfiles" multiple type="file"> </body> <script> var pullfiles=function(){ // love the query selector var fileinput = document.queryselector("#myfiles"); var files = fileinput.files; // cache files.length var fl = files.length; var i = 0; while ( i < fl) { // localize file var in the loop var file...
... = files[i]; alert(file.name); i++; } } // set the input element onchange to call pullfiles document.queryselector("#myfiles").onchange=pullfiles; //a.t </script> </html> specifications specification status comment file apithe definition of 'filelist' in that specification.
FontFace.FontFace() - Web APIs
WebAPIFontFaceFontFace
this can be either: a url binary font data descriptors optional a set of optional descriptors passed as an object.
... it can have the following keys: family: family style: style weight: weight stretch: stretch unicoderange: unicode range variant: variant featuresettings: feature settings example async function loadfonts() { const font = new fontface('myfont', 'url(myfont.woff)'); // wait for font to be loaded await font.load(); // add font to document document.fonts.add(font); // enable font with css class document.body.classlist.add('fonts-loaded'); } specifications specification status comment css font loading module level 3the definition of 'fontface constructor' in that specification.
Using FormData Objects - Web APIs
the formdata object lets you compile a set of key/value pairs to send using xmlhttprequest.
...the transmitted data is in the same format that the form's submit() method would use to send the data if the form's encoding type were set to multipart/form-data.
FormDataEntryValue - Web APIs
a string or file that represents a single value from a set of formdata key-value pairs.
... note that the formdata.append() and formdata.set() methods allow passing a blob value, which is converted to a file in the process.
GainNode - Web APIs
WebAPIGainNode
you have to set audioparam.value or use the methods of audioparam to change the effect of gain.
... gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gain.setvalueattime(1, audioctx.currenttime); mute.id = ""; mute.innerhtml = "mute"; } } specifications specification status comment web audio apithe definition of 'gainnode' in that specification.
Using the Geolocation API - Web APIs
a third, optional, parameter is an options object where you can set the maximum age of the position returned, the time to wait for a request, and if you want high accuracy for the position.
... watching the current position if the position data changes (either by device movement or if more accurate geo information arrives), you can set up a callback function that is called with that updated position information.
GlobalEventHandlers.ondrag - Web APIs
example this example includes the use of the ondrag attribute handler to set an element's drag event handler.
...ing the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code...
GlobalEventHandlers.ondragover - Web APIs
example this example demonstrates using the ondragover attribute handler to set an element's dragover event handler.
...ing the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code...
GlobalEventHandlers.ondragstart - Web APIs
example this example demonstrates using the ondragstart attribute handler to set an element's dragstart event handler.
...ing the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code...
GlobalEventHandlers.ontransitioncancel - Web APIs
the transition is cancelled when: the value of the transition-property property that applies to the target is changed the display property is set to "none".
... let box = document.queryselector(".box"); box.ontransitionrun = function(event) { box.innerhtml = "zooming..."; } box.ontransitionend = function(event) { box.innerhtml = "done!"; } box.onclick = function() { box.style.display = 'none'; timeout = window.settimeout(appear, 2000); function appear() { box.style.display = 'block'; } } box.ontransitioncancel = function(event) { console.log('transitioncancel fired after ' + event.elapsedtime + ' seconds.'); } result the resulting content looks like this: notice what happens when you hover your mouse cursor over the box, then move it away.
HTMLAnchorElement - Web APIs
obsolete properties htmlanchorelement.charset is a domstring representing the character encoding of the linked resource.
... the following properties are now obsolete: charset, coords, name, rev, and shape.
HTMLCanvasElement.getContext() - Web APIs
if set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images.
...this option is only available, if the flag gfx.canvas.willreadfrequently.enable is set to true (which, by default, is only the case for b2g/firefox os).
HTMLCanvasElement.toDataURL() - Web APIs
examples given this <canvas> element: <canvas id="canvas" width="5" height="5"></canvas> you can get a data-url of the canvas with the following lines: var canvas = document.getelementbyid('canvas'); var dataurl = canvas.todataurl(); console.log(dataurl); // "data:image/png;base64,ivborw0kggoaaaansuheugaaaauaaaafcayaaacnby // blaaaadeleqvqimwngobmaaabpaafei8araaaaaelftksuqmcc" setting image quality with jpegs var fullquality = canvas.todataurl('image/jpeg', 1.0); // data:image/jpeg;base64,/9j/4aaqskzjrgabaq...9oadambaairaxeapwd/ad/6ap/z" var mediumquality = canvas.todataurl('image/jpeg', 0.5); var lowquality = canvas.todataurl('image/jpeg', 0.1); example: dynamically change images you can use this technique in coordination with mouse events in order to dynamically chan...
...lay = 'none'; } function removecolors() { var aimages = document.getelementsbyclassname('grayscale'), nimgslen = aimages.length, ocanvas = document.createelement('canvas'), octx = ocanvas.getcontext('2d'); for (var nwidth, nheight, oimgdata, ograyimg, npixel, apix, npixlen, nimgid = 0; nimgid < nimgslen; nimgid++) { ocolorimg = aimages[nimgid]; nwidth = ocolorimg.offsetwidth; nheight = ocolorimg.offsetheight; ocanvas.width = nwidth; ocanvas.height = nheight; octx.drawimage(ocolorimg, 0, 0); oimgdata = octx.getimagedata(0, 0, nwidth, nheight); apix = oimgdata.data; npixlen = apix.length; for (npixel = 0; npixel < npixlen; npixel += 4) { apix[npixel + 2] = apix[npixel + 1] = apix[npixel] = (apix[npixel] + apix[npixel + 1] + ap...
HTMLDialogElement.showModal() - Web APIs
if the open attribute is already set on the <dialog> element), an invalidstateerror is thrown.
...d="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); di...
HTMLDialogElement - Web APIs
htmldialogelement.returnvalue a domstring that sets or returns the return value for the dialog.
...d="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); di...
HTMLElement: animationcancel event - Web APIs
an event handler for this event can be added by setting the onanimationcancel property, or using addeventlistener().
...it then sets the element's display property to none, which will trigger the animationcancel event.
HTMLFormElement.elements - Web APIs
the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
...r the form controls for (i = 0; i < inputs.length; i++) { if (inputs[i].nodename === "input" && inputs[i].type === "text") { // update text input inputs[i].value.tolocaleuppercase(); } } disabling form controls var inputs = document.getelementbyid("my-form").elements; // iterate over the form controls for (i = 0; i < inputs.length; i++) { // disable all form controls inputs[i].setattribute("disabled", ""); } specifications specification status comment html living standardthe definition of 'htmlformelement.elements' in that specification.
HTMLIFrameElement.allowPaymentRequest - Web APIs
refoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetallowpaymentrequest experimentalchrome full support 60disabled full support 60disabled disabled from version 60: this feature is behind the #web-payments preference (needs to be set to enabled).
... webview android no support nochrome android full support 61disabled full support 61disabled disabled from version 61: this feature is behind the #web-payments preference (needs to be set to enabled).
HTMLImageElement.complete - Web APIs
the image is considered completely loaded if any of the following are true: neither the src nor the srcset attribute is specified.
... the srcset attribute is absent and the src attribute, while specified, is the empty string ("").
HTMLImageElement.height - Web APIs
example in this example, two different sizes are provided for an image of a clock using the srcset attribute.
... <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.loading - Web APIs
images whose loading attribute is set to lazy but are located within the visual viewport immediately upon initial page load are loaded as soon as the layout is known, but their loads do not delay the firing of the load event.
... preventing element shift during image lazy loads when an image whose loading has been delayed by the loading attribute being set to lazy is finally loaded, the browser will determine the final size of the <img> element based on the style and intrinsic size of the image, then reflow the document as needed to update the positions of elements based on any size change made to the element to fit the image.
HTMLImageElement.width - Web APIs
example in this example, two different sizes are provided for an image of a clock using the srcset attribute.
... <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.webkitdirectory - Web APIs
when a directory is selected, the directory and its entire hierarchy of contents are included in the set of selected items.
... understanding the results after the user makes a selection, each file object in files has its file.webkitrelativepath property set to the relative path within the selected directory at which the file is located.
HTMLLegendElement - Web APIs
if the legend has a fieldset element as its parent, then this attribute returns the same value as the form attribute on the parent fieldset element.
... htmllegendelement.align is a domstring representing the alignment relative to the form set methods no specific method; inherits methods from its parent, htmlelement.
HTMLMediaElement.crossOrigin - Web APIs
the htmlmediaelement.crossorigin property is the cors setting for this image element.
... see cors settings attributes for details.
HTMLMediaElement.play() - Web APIs
it tries to play the video, and if successful sets the class name of the playbutton element to "playing".
...it then sets up an event handler for the click event on the play toggle button and attempts to automatically begin playback by calling playvideo().
HTMLObjectElement - Web APIs
htmlobjectelement.setcustomvalidity() sets a custom validity message for the element.
... the following methods have been added: checkvalidity() and setcustomvalidity().
HTMLElement.focus() - Web APIs
the htmlelement.focus() method sets focus on the specified element, if it can be focused.
...if preventscroll is set to true, no scrolling will occur.
HTMLOrForeignElement - Web APIs
propertiesdataset read only the dataset read-only property of the htmlorforeignelement interface provides read/write access to all the custom data attributes (data-*) set on the element.nonce the nonce property of the htmlorforeignelement interface returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed.tabindexthe tabindex property of the htmlorforeignel...
...ement interface represents the tab order of the current element.methodsblur()the htmlelement.blur() method removes keyboard focus from the current element.focus()the htmlelement.focus() method sets focus on the specified element, if it can be focused.
HTMLScriptElement.referrerPolicy - Web APIs
carefully consider the impact of this setting.
...one set on the whole document or domain.
HTMLSelectElement.selectedOptions - Web APIs
eat?</label><br> <select id="foods" name="foods" size="7" multiple> <option value="1">burrito</option> <option value="2">cheeseburger</option> <option value="3">double bacon burger supreme</option> <option value="4">pepperoni pizza</option> <option value="5">taco</option> </select> <br> <button name="order" id="order"> order now </button> <p id="output"> </p> the <select> element is set to allow multiple items to be selected, and it is 7 rows tall.
... += collection[i].label; if (i === (collection.length - 2) && (collection.length < 3)) { output += " and "; } else if (i < (collection.length - 2)) { output += ", "; } else if (i === (collection.length - 2)) { output += ", and "; } } if (output === "") { output = "you didn't order anything!"; } outputbox.innerhtml = output; }, false); this script sets up a click event listener on the "order now" button.
HTMLSlotElement.assignedElements() - Web APIs
if the flatten option is set to true, it also returns the assigned elements of any other slots that are descendants of this slot.
... syntax var assignedelements = htmlslotelement.assignedelements(options) parameters options optional an object that sets options for the nodes to be returned.
HTMLSlotElement.assignedNodes() - Web APIs
the assignednodes() property of the htmlslotelement interface returns a sequence of the nodes assigned to this slot, and if the flatten option is set to true, the assigned nodes of any other slots that are descendants of this slot.
... syntax var assignednodes = htmlslotelement.assignednodes(options) parameters options optional an object that sets options for the nodes to be returned.
HTMLSlotElement: slotchange event - Web APIs
bubbles yes cancelable no interface event event handler property none in order to trigger a slotchange event, one has to set or remove the slot attribute.
... examples element.setattribute('slot', slotname); // element.assignedslot = $slot element.removeattribute('slot'); // element.assignedslot = null the following snippet is taken from our slotchange example (see it live also).
HTMLTableCellElement - Web APIs
htmltablecellelement.headers read only is a domsettabletokenlist describing a list of id of <th> elements that represents headers associated with the cell.
... the headers property is now read-only and contains a domsettabletokenlist rather than a mere domstring.
HTMLVideoElement.msHorizontalMirror - Web APIs
mshorizontalmirror is a read/write property which gets or sets whether a video element is flipped horizontally in the display.
... syntax htmlvideoelement.mshorizontalmirror: boolean; value boolean value set to true flips the video playback horizontally.
HTMLVideoElement.msIsLayoutOptimalForPlayback - Web APIs
syntax htmlvideoelement.msislayoutoptimalforplayback: domstring; value boolean value set to true indicates that video is being rendered optimally (better performance and using less battery power).
... for msislayoutoptimalforplayback to be true, avoid the following: video elements with cascading style sheets (css) outlines set.
HTMLVideoElement.msIsStereo3D - Web APIs
syntax htmlvideoelement.msisstereo3d: boolean; value boolean value set to true indicates that the video source is stereo 3d.
... this uses metadata set in mp4 or mpeg-2 file containers and h.264 supplemental enhancement information (sei) messages to determine the stereo capability of the source.
msStereo3DPackingMode - Web APIs
msstereo3dpackingmode is a read/write property which gets or sets the frame-packing mode for stereo 3-d video content.
... syntax htmlvideoelement.msstereo3dpackingmode(topbottom, sidebyside, none); value the following values return, or set, the stereo 3-d content packing as "topbottom", "sidebyside", or "none" for regular 2-d video.
msStereo3DRenderMode - Web APIs
msstereo3drendermode is a read/write property which gets or sets whether the system display is set to stereo display (if stereo-capable).
... syntax htmlvideoelement.msstereo3drendermode(mono, stereo); value the following values set the stereo display to mono or stereo.
HTMLVideoElement - Web APIs
htmlvideoelement.mshorizontalmirror gets or sets whether a video element is flipped horizontally in the display.
...value set to true indicates source is stereo 3d.
Headers.append() - Web APIs
WebAPIHeadersappend
the difference between set() and append() is that if the specified header already exists and accepts multiple values, set() will overwrite the existing value with the new one, whereas append() will append the new value onto the end of the set of values.
...if the specified header already exists and accepts multiple values, append() will append the new value to the end of the value set: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns 'deflate, gzip' to overwrite the old value with a new one, use headers.set.
Headers.get() - Web APIs
WebAPIHeadersget
returns a bytestring sequence representing the values of the retrieved header or null if this header is not set.
... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty myheaders.get('not-set'); // returns null you could add a header to this using headers.append, then retrieve it using get(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns "image/jpeg" if the header has multiple values associated with it, the byte string will contain all the values, in the order they were added to the headers object: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns "deflate,gzip" note: headers.getall used to have this functionality, with headers.get returning only the first value added to the headers object.
IDBCursor.continuePrimaryKey() - Web APIs
calling this method more than once before new cursor data has been loaded - for example, calling continueprimarykey() twice from the same onsuccess handler - results in an invalidstateerror being thrown on the second call because the cursor’s got value flag has been unset.
...= articlestore.index("tag").opencursor(); let count = 0; let unreadlist = []; request.onsuccess = (event) => { let cursor = event.target.result; if (!cursor) { return; } let lastprimarykey = getlastiteratedarticleid(); if (lastprimarykey > cursor.primarykey) { cursor.continueprimarykey("javascript", lastprimarykey); return; } // update lastiteratedarticleid setlastiteratedarticleid(cursor.primarykey); // preload 5 articles into the unread list; unreadlist.push(cursor.value); if (++count < 5) { cursor.continue(); } }; specifications specification status comment indexed database api draftthe definition of 'continueprimarykey()' in that specification.
IDBCursor.delete() - Web APIs
WebAPIIDBCursordelete
once the record is deleted, the cursor's value is set to null.
...the result attribute is set to undefined.
IDBDatabase.transaction() - Web APIs
you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config.
... details optional dictionary of other settings, supported only by chrome: return value an idbtransaction object.
IDBIndex.get() - Web APIs
WebAPIIDBIndexget
the get() method of the idbindex interface returns an idbrequest object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to an idbkeyrange.
... if a value is found, then a structured clone of it is created and set as the result of the request object: this returns the record the key is associated with.
IDBIndex.getKey() - Web APIs
WebAPIIDBIndexgetKey
the getkey() method of the idbindex interface returns an idbrequest object, and, in a separate thread, finds either the primary key that corresponds to the given key in this index or the first corresponding primary key, if key is set to an idbkeyrange.
... if a primary key is found, it is set as the result of the request object.
IDBObjectStore.createIndex() - Web APIs
auto: the platform default locale will be used (may be changed by user agent settings.) null or undefined: if no locale is specified, normal javascript sorting will be used — not locale-aware.
... invalidaccesserror occurs if the provided key path is a sequence, and multientry is set to true in the objectparameters object.
IDBObjectStore.getKey() - Web APIs
if a key is successfully found, then a structured clone of it is created and set as the result of the request object.
... example let openrequest = indexeddb.open("telemetry"); openrequest.onsuccess = (event) => { let db = event.target.result; let store = db.transaction("netlogs").objectstore("netlogs"); let today = new date(); let yesterday = new date(today); yesterday.setdate(today.getdate() - 1); let request = store.getkey(idbkeyrange(yesterday, today)); request.onsuccess = (event) => { let when = event.target.result; alert("the 1st activity in last 24 hours was occurred at " + when); }; }; specifications specification status comment indexed database api draftthe definition of 'getkey()' in that specification.
IDBRequest - Web APIs
each request has a readystate that is set to the 'pending' state; this changes to 'done' when the request is completed or fails.
... when the state is set to done, every request returns a result and an error, and an event is fired on the request.
IDBTransaction - Web APIs
you use idbdatabase to start transactions, idbtransaction to set the mode of the transaction (e.g.
...this mode is for updating the version number of transactions that were started using the setversion() method of idbdatabase objects.
IIRFilterNode.getFrequencyResponse() - Web APIs
the getfrequencyresponse() method of the iirfilternode interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies specified in a specified array of frequencies.
...element in our html to contain our results, and grab a reference to it in our javascript: <p>iir filter frequency response for: </p> <ul class="freq-response-output"> </ul> var freqresponseoutput = document.queryselector('.freq-response-output'); finally, after creating our filter, we use getfrequencyresponse() to generate the response data and put it in our arrays, then loop through each data set and output them in a human-readable list at the bottom of the page: var feedforwardcoefficients = [0.1, 0.2, 0.3, 0.4, 0.5]; var feedbackcoefficients = [0.5, 0.4, 0.3, 0.2, 0.1]; var iirfilter = audioctx.createiirfilter(feedforwardcoefficients, feedbackcoefficients); ...
IntersectionObserver.IntersectionObserver() - Web APIs
if the threshold list is empty, it's set to the array [0.0].
... rootmargin a string which specifies a set of offsets to add to the root's bounding_box when calculating intersections, effectively shrinking or growing the root for calculation purposes.
IntersectionObserver.observe() - Web APIs
the intersectionobserver method observe() adds an element to the set of target elements being watched by the intersectionobserver.
... one observer has one set of thresholds and one root, but can watch multiple target elements for visibility changes in keeping with those.
IntersectionObserver.root - Web APIs
the intersection of this bounding rectangle, offset by any margins specified in the options passed to the intersectionobserver() constructor, the target element's bounds, minus the bounds of every element or other object which overlaps the target element, is considered to be the visible area of the target element.
... example this example sets the border of the intersection observer's root element to be a 2-pixel medium green line.
IntersectionObserver.rootMargin - Web APIs
syntax var marginstring = intersectionobserver.rootmargin; value a string, formatted similarly to the css margin property's value, which contains offsets for one or more sides of the root's bounding box.
... these offsets are added to the corresponding values in the root's bounding box before the intersection between the resulting rectangle and the target element's bounds.
IntersectionObserver - Web APIs
intersectionobserver.rootmargin read only an offset rectangle applied to the root's bounding box when calculating intersections, effectively shrinking or growing the root for calculation purposes.
...each offset can be expressed in pixels (px) or as a percentage (%).
IntersectionObserverEntry.rootBounds - Web APIs
the intersectionobserverentry interface's read-only rootbounds property is a domrectreadonly corresponding to the target's root intersection rectangle, offset by the intersectionobserver.rootmargin if one is specified.
... this rectangle is offset by the values in intersectionobserver.rootmargin.
KeyboardEvent.keyCode - Web APIs
example window.addeventlistener("keydown", function (event) { if (event.defaultprevented) { return; // should do nothing if the default action has been cancelled } var handled = false; if (event.key !== undefined) { // handle the event with keyboardevent.key and set handled true.
... } else if (event.keycode !== undefined) { // handle the event with keyboardevent.keycode and set handled true.
KeyframeEffect.target - Web APIs
it performs as both a getter and a setter, except with animations and transitions generated by css.
... examples in the follow the white rabbit example, whiterabbit sets the target element to be animated: var whiterabbit = document.getelementbyid("rabbit"); var rabbitdownkeyframes = new keyframeeffect( whiterabbit, [ { transform: 'translatey(0%)' }, { transform: 'translatey(100%)' } ], { duration: 3000, fill: 'forwards' } ); // returns <div id=​"rabbit">​click the rabbit's ears!​</div>​ rabbitdownkeyframes.target; specifications spe...
LocalFileSystem - Web APIs
for example, if you were to create a mail app, you might create a temporary storage for caching assets (like images and attachments) to speed up performance, while creating persistent storage for unique data—such as drafts of emails that were composed while offline—that should not be lost before they are backed up into the cloud.
... //taking care of the browser-specific prefix window.requestfilesystem = window.requestfilesystem || window.webkitrequestfilesystem; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors.
Location - Web APIs
WebAPILocation
it can be set from a different origin than the associated document.
...the difference from the assign() method and setting the href property is that after using replace() the current page will not be saved in session history, meaning the user won't be able to use the back button to navigate to it.
MSManipulationEvent - Web APIs
inertiadestinationxread only represents the predicted horizontal scroll offset after the inertia phase completes.
... inertiadestinationyread only represents the predicted vertical scroll offset after the inertia phase completes.
MediaDeviceInfo - Web APIs
it is reset when the user clears cookies (for private browsing, a different identifier is used that is not persisted across sessions).
...the set of device labels could otherwise be used as part of a fingerprinting mechanism to identify a user.
MediaDevices.ondevicechange - Web APIs
this happens whenever the set of media devices available to the user agent and, by extension, to the web site or app has changed.
...ntlistener("click", function() { navigator.mediadevices.getusermedia({ video: { width: 160, height: 120, framerate: 30 }, audio: { samplerate: 44100, samplesize: 16, volume: 0.25 } }).then(stream => { videoelement.srcobject = stream; updatedevicelist(); }) .catch(err => log(err.name + ": " + err.message)); }, false); we set up global variables that contain references to the <ul> elements that are used to list the audio and video devices: let audiolist = document.getelementbyid("audiolist"); let videolist = document.getelementbyid("videolist"); getting and drawing the device list now let's take a look at updatedevicelist() itself.
MediaKeySession - Web APIs
event handlers mediakeysession.onkeystatuseschange sets the eventhandler called when there has been a change in the keys in a session or their statuses.
... mediakeysession.onmessage sets the eventhandler called when the content decryption module has generated a message for the session.
MediaKeys - Web APIs
WebAPIMediaKeys
the mediakeys interface of encryptedmediaextensions api represents a set of keys that an associated htmlmediaelement can use for decryption of media data during playback.
... mediakeys.setservercertificate() returns a promise to a server certificate to be used to encrypt messages to the license server.
MediaList - Web APIs
WebAPIMediaList
those set using a <link> element's media attribute.
... properties medialist.mediatext a stringifier that returns a domstring representing the medialist as text, and also allows you to set a new medialist.
MediaRecorder.start() - Web APIs
then, each time that amount of media has been recorded, an event will be delivered to let you act upon the recorded media, while a new blob is created to record the next slice of the media assuming the mediarecorder's state is inactive, start() sets the state to recording, then begins capturing media from the input stream.
... when the source stream ends, state is set to inactive and data gathering stops.
MediaRecorder - Web APIs
options are available to do things like set the container's mime type (such as "video/webm" or "video/mp4") and the bit rates of the audio and video tracks or a single overall bit rate.
...("data available after mediarecorder.stop() called."); var clipname = prompt('enter a name for your sound clip'); var clipcontainer = document.createelement('article'); var cliplabel = document.createelement('p'); var audio = document.createelement('audio'); var deletebutton = document.createelement('button'); clipcontainer.classlist.add('clip'); audio.setattribute('controls', ''); deletebutton.innerhtml = "delete"; cliplabel.innerhtml = clipname; clipcontainer.appendchild(audio); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks ...
MediaSession.metadata - Web APIs
the metadata property of the mediasession interface contains a mediametadata object providing descriptive information about the currently playing media, or null if the metadata has not been set.
... example the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } ...
MediaSessionActionDetails.seekTime - Web APIs
to change the time by an offset rather than moving to an absolute time, the seekforward or seekbackward actions should be used instead.
... usage notes to perform a "fast" seek (such as when issuing multiple seekto actions in sequence while handling a scrubbing operation, the details object's fastseek property's value is set to true, indicating that you should minimize or eliminate anything you do while handling the action that is only necessary at the final step.
MediaSource.activeSourceBuffers - Web APIs
the activesourcebuffers read-only property of the mediasource interface returns a sourcebufferlist object containing a subset of the sourcebuffer objects contained within sourcebuffers — the list of objects providing the selected video track, enabled audio tracks, and shown/hidden text tracks.
... example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.activesourcebuffers); // will contain the source buffer that was added above, // as it is selected for playing in the video player video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffe...
MediaSource.addSourceBuffer() - Web APIs
example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource...
....addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'addsourcebuffer()' in that specification.
MediaSource.endOfStream() - Web APIs
their sourcebuffer.updating property is true.) example the following snippet is from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource...
....addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'endofstream()' in that specification.
MediaSource.isTypeSupported() - Web APIs
example the following snippet is from an example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource...
....addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'istypesupported()' in that specification.
MediaStream.getTracks() - Web APIs
the gettracks() method of the mediastream interface returns a sequence that represents all the mediastreamtrack objects in this stream's track set, regardless of mediastreamtrack.kind.
... example navigator.mediadevices.getusermedia({audio: false, video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; // stop the stream after 5 seconds settimeout(() => { const tracks = mediastream.gettracks() tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'gettracks()' in that specification.
MediaStream.onaddtrack - Web APIs
this event is fired when the browser adds a track to the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source.
... syntax mediastream.onaddtrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the addtrack event which has occurred.
MediaStream.onremovetrack - Web APIs
this event is fired when the browser removes a track from the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of tracks because the media element being captured loaded a new source.
... syntax mediastream.onremovetrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the removetrack event which has occurred.
MediaStreamTrack: ended event - Web APIs
examples this example sets up an event handler for the ended event, which changes an on-screen icon to indicate that the track is no longer active.
... track.addeventlistener('ended', () => { let statuselem = document.getelementbyid("status-icon"); statuselem.src = "/images/stopped-icon.png"; }) you can also set up the event handler using the mediastreamtrack.onended property: track.onended = function() { let statuselem = document.getelementbyid("status-icon"); statuselem.src = "/images/stopped-icon.png"; } specifications specification status comment media capture and streamsthe definition of 'ended' in that specification.
MediaStreamTrack.getCapabilities() - Web APIs
once you know what the browser's capabilities are, your script can use applyconstraints() to ask for the track to be configured to match ideal or acceptable settings.
... see capabilities, constraints, and settings for details on how to work with constrainable properties.
MediaStreamTrack.stop() - Web APIs
immediately after calling stop(), the readystate property is set to ended.
... finally, srcobject is set to null to sever the link to the mediastream object so it can be released.
MediaTrackConstraints.autoGainControl - Web APIs
if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the automatic gain control feature; if it can't be met, then the request will result in an error.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.echoCancellation - Web APIs
if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the echo cancellation feature; if it can't be met, then the request will result in an error.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.noiseSuppression - Web APIs
if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the noise suppression feature; if it can't be met, then the request will result in an error.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackControls.volume - Web APIs
any constraint set which only permits values outside the range 0.0 to 1.0 cannot be satisfied and will result in failure.
... example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSupportedConstraints - Web APIs
an actual constraint set is described using an object based on the mediatrackconstraints dictionary.
... to learn more about how constraints work, see capabilities, constraints, and settings.
Using the Media Capabilities API - Web APIs
these features include: the ability to query the browser to determine its ability to encode or decode media given a specified set of encoding parameters.
... support for getting real-time feedback about the playback of media, so your code can make informed decisions about adapting the stream's quality or other settings to manage the user's perceived media performance and quality.
Media Source API - Web APIs
creating assets that work with mse in modern browsers is a laborious process, taking significant time, computing power, and energy.
... the two most common use cases for dash involve watching content “on demand” or “live.” on demand allows a developer to take their time transcoding the assets into multiple resolutions of various quality.
MessageEvent - Web APIs
the action triggered by this event is defined in a function set as the event handler for the relevant message event (e.g.
...otherwise called implicitly by onmessage setter.
msPlayToDisabled - Web APIs
msplaytodisabled is a read/write property which gets and sets if the playto device is enabled or disabled.
... syntax ptr = object.msplaytodisabled; value boolean value set to true indicates that the playto device is disabled.
msPlayToPreferredSourceUri - Web APIs
msplaytopreferredsourceuri is a read/write property which gets or sets the path to the preferred media source.
...com/videos/video.mp4" msplaytopreferredsourceuri="http://www.contoso.com/catalogid=1234" /> var video = document.createelement('video'); document.body.appendchild(video); video.src = "http://www.contoso.com/videos/video.mp4"; video.msplaytopreferredsourceuri = "http://www.contoso.com/catalogid=1234"; see also microsoft playready content access and protection technology is a set of technologies that can be used to distribute audio/video content more securely over a network, and help prevent the unauthorized use of this content.
msPlayToPrimary - Web APIs
msplaytoprimary is a read/write property which gets or sets the primary dlna playto device.
... syntax ptr = object.msplaytoprimary; value boolean value set to true indicates that the device is the primary dlna playto device, otherwise false.
msPlayToSource - Web APIs
msplaytosource is used in the sourcerequested handler -- get the playtosource object from an audio, video, or img element using the msplaytosource property and pass it to e.setsource, then set the playtosource.next property to the msplaytosource of another element for continual playing.
... e.sourcerequest.setsource(document.getelementbyid("videoplayer").msplaytosource); // the media will then be streamed to the device chosen by the user in the ui.
msRealTime - Web APIs
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.
MutationObserver.observe() - Web APIs
observation follows nodes when disconnected mutation observers are intended to let you be able to watch the desired set of nodes over time, even if the direct connections between those nodes are severed.
... example in this example, we demonstrate how to call the method observe() on an instance of mutationobserver, once it has been set up, passing it a target element and a mutationobserverinit options object.
MutationObserverInit.attributes - Web APIs
if you set either attributefilter or attributeoldvalue to true, attributes is automatically assumed to be true, even if you don't expressly set it as such.
... example in this example, a mutation observer is set up to watch for changes to the status and username attributes in any elements contained within a subtree that displays the names of users in a chat room.
MutationObserverInit.characterData - Web APIs
so either pass directly a text node to the observe() method or you need to also set subtree: true.
... if you set characterdataoldvalue to true, characterdata is automatically assumed to be true, even if you don't expressly set it as such.
MutationObserverInit.childList - Web APIs
by setting childlist to true, your callback will be invoked any time nodes are added to or removed from the dom node or nodes being watched.
...setting subtree to true causes addition or removal of nodes anywhere within the subtree rooted at target to be reported.
MutationObserverInit.subtree - Web APIs
the mutationobserverinit dictionary's optional subtree property can be set to true to monitor the targeted node and all of its descendants.
... to monitor the entire subtree for attribute changes, simply set subtree to true: var options = { attributes: true, subtree: true }; example specifications specification status comment domthe definition of 'mutationobserverinit.subtree' in that specification.
NavigationPreloadManager - Web APIs
navigationpreloadmanager.setheadervalue() sets the value of the service-worker-navigation-preload header and returns an empty promise.
... samsung internet android full support 8.0setheadervalue experimentalchrome full support 62edge full support 18firefox no support nonotes no support nonotes notes implementation tracked in bug 1290958ie ?
Navigator.cookieEnabled - Web APIs
note: when the browser is configured to block third-party cookies, and navigator.cookieenabled is invoked inside a third-party iframe, it returns true in safari, edge spartan and ie (while trying to set a cookie in such scenario would fail).
... example if (!navigator.cookieenabled) { // the browser does not support or is blocking cookies from being set.
Navigator.mediaSession - Web APIs
in addition, the mediasession interface provides the setactionhandler() method, which lets you receive events when the user engages device controls such as either onscreen or physical play, pause, seek, and other similar controls.
... an internet radio app, for example, can use setactionhandler() to let fhe media controls on a keyboard or elsehwere on the user's device be used to control the app's media playback.
Web-based protocol handlers - Web APIs
registering setting up a web application as a protocol handler is not a difficult process.
... example <?php $value = ""; if ( isset ( $_get["value"] ) ) { $value = $_get["value"]; } ?> <!doctype html public "-//w3c//dtd html 4.01//en"> <html lang="en"> <head> <title>web protocol handler sample</title> </head> <body> <h1>web protocol handler sample - handler</h1> <p>this web page is called when handling a <code>web+burger:</code> protocol action.
Navigator.registerProtocolHandler() - Web APIs
this will be displayed to the user, such as prompting “allow this site to handle [scheme] links?” or listing registered handlers in the browser’s settings.
...it is recommended to always set the title, since browsers that support the updated spec most likely will be backwards-compatible and still accept the title (but not use it).
NavigatorID.userAgent - Web APIs
opera 6+ allows users to set the browser identification string via a menu.
...each of these pieces of info comes from other navigator properties which are also settable by the user.
Node.compareDocumentPosition() - Web APIs
more than one bit is set if multiple scenarios apply.
... for example, if othernode is located earlier in the document and contains the node on which comparedocumentposition() was called, then both the document_position_contains and document_position_preceding bits would be set, producing a value of 10 (0x0a).
Node.namespaceURI - Web APIs
WebAPINodenamespaceURI
you can create an element with the specified namespaceuri using the dom level 2 method document.createelementns and attributes with the method element.setattributens.
... obsolete specifies the behavior when it's set to null.
Node.nodeValue - Web APIs
WebAPINodenodeValue
the nodevalue property of the node interface returns or sets the value of the current node.
... comment content of the comment document null documentfragment null documenttype null element null namednodemap null entityreference null notation null processinginstruction entire content excluding the target text content of the text node when nodevalue is defined to be null, setting it has no effect.
Node.textContent - Web APIs
WebAPINodetextContent
(this is an empty string if the node has no children.) setting textcontent on a node removes all of the node's children and replaces them with a single text node with the given string value.
...or set the element's text content: document.getelementbyid('diva').textcontent = 'this text is different!'; // the html for diva is now: // <div id="diva">this text is different!</div> specifications specification status comment domthe definition of 'node.textcontent' in that specification.
NodeIterator.previousNode() - Web APIs
the nodeiterator.previousnode() method returns the previous node in the set represented by the nodeiterator and moves the position of the iterator backwards within the set.
... this method returns null when the current node is the first node in the set.
Notification.dir - Web APIs
WebAPINotificationdir
possible values are: auto: adopts the browser's language setting behaviour (the default.) ltr: left to right.
... note: most browsers seem to ignore explicit ltr and rtl settings, and just go with the browser-wide setting.
Notification - Web APIs
notification.silent read only specifies whether the notification should be silent — i.e., no sounds or vibrations should be issued, regardless of the device settings.
... examples assume this basic html: <button onclick="notifyme()">notify me!</button> it's possible to send a notification as follows — here we present a fairly verbose and complete set of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification.
OffscreenCanvas.getContext() - Web APIs
if set to false, the browser now knows that the backdrop is always opaque, which can speed up drawing of transparent content and images then.
...this option is only available, if the flag gfx.canvas.willreadfrequently.enable is set to true (which, by default, is only the case for b2g/firefox os).
OffscreenCanvas.height - Web APIs
the height property returns and sets the height of an offscreencanvas object.
... syntax var pxl = offscreen.height; offscreen.height = pxl; examples creating a new offscreen canvas and returning or setting the height of the offscreen canvas: var offscreen = new offscreencanvas(256, 256); offscreen.height; // 256 offscreen.height = 512; specifications specification status comment html living standardthe definition of 'offscreencanvas.height' in that specification.
OffscreenCanvas.width - Web APIs
the width property returns and sets the width of an offscreencanvas object.
... syntax var pxl = offscreen.width; offscreen.width = pxl; examples creating a new offscreen canvas and returning or setting the width of the offscreen canvas: var offscreen = new offscreencanvas(256, 256); offscreen.width; // 256 offscreen.width = 512; specifications specification status comment html living standardthe definition of 'offscreencanvas.width' in that specification.
OscillatorNode.OscillatorNode() - Web APIs
the oscillatornode() constructor of the web audio api creates a new oscillatornode object which is an audionode that represents a periodic waveform, like a sine wave, optionally setting the node's properties' values to match values in a specified object.
... detune a detuning value (in cents) which will offset the frequency by the given amount.
OscillatorNode.detune - Web APIs
syntax var oscillator = audioctx.createoscillator(); oscillator.detune.setvalueattime(100, audioctx.currenttime); // value in cents note: though the audioparam returned is read-only, the value it represents is not.
... // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.detune.setvalueattime(100, audioctx.currenttime); // value in cents oscillator.start(); specifications specification status comment web audio apithe definition of 'detune' in that specification.
OscillatorNode.frequency - Web APIs
syntax var oscillator = audioctx.createoscillator(); oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz note: though the audioparam returned is read-only, the value it represents is not.
... // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status comment web audio apithe definition of 'frequency' in that specification.
PannerNode.refDistance - Web APIs
if the value is set to less than 0, a rangeerror is thrown.
...nction creates a graph for the test tone with a given refdistance // and schedules it to move away from the listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (refdistance, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.refdistance = refdistance; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay immediately and fairly quickly scheduletesttone(1, context.currenttime)...
ParentNode.append() - Web APIs
WebAPIParentNodeappend
the parentnode.append() method inserts a set of node objects or domstring objects after the last child of the parentnode.
... syntax // [throws, unscopable] parentnode.append(...nodesordomstrings) // returns undefined parameters nodes a set of node or domstring objects to insert.
ParentNode.replaceChildren() - Web APIs
the parentnode.replacechildren() method replaces the existing children of a node with a specified new set of children.
... syntax // [throws, unscopable] parentnode.replacechildren(...nodesordomstrings) // returns undefined parameters nodesordomstrings a set of node or domstring objects to replace the parentnode's existing children with.
PaymentRequest.PaymentRequest() - Web APIs
options optional lets you set options that control the behavior of the user agent.
...if you set this type to true, you should select an appropriate shippingtype.
PaymentRequest.canMakePayment() - Web APIs
61edge full support 16firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.onshippingaddresschange - Web APIs
61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.onshippingoptionchange - Web APIs
61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 53firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentRequest.shippingAddress - Web APIs
you can trigger this by setting paymentoptions.requestshipping to true when calling the paymentrequest constructor.
...when the paymentrequest.onshippingaddresschange is called, updatedetails() is called to update the details of the paymentrequest, using shippingaddress to set the correct shipping cost.
PaymentRequest.shippingType - Web APIs
61edge full support 15firefox full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 55firefox android full support 55notes disabled full support 55notes disabled notes available only in nightly builds.disabled from version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
PaymentResponse.onpayerdetailchange - Web APIs
examples in the example below, onpayerdetailchange is used to set up a listener for the payerdetailchange event in order to validate the information entered by the user, requesting that any mistakes be corrected // options for paymentrequest(), indicating that shipping address, // payer email address, name, and phone number all be collected.
... const options = { requestshipping: true, requestpayeremail: true, requestpayername: true, requestpayerphone: true, }; const request = new paymentrequest(methods, details, options); const response = request.show(); // get the data from the response let { payername: oldpayername, payeremail: oldpayeremail, payerphone: oldpayerphone, } = response; // set up a handler for payerdetailchange events, to // request corrections as needed.
PaymentResponse.requestId - Web APIs
61edge full support 16firefox full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
... nochrome android full support 60firefox android full support 56notes disabled full support 56notes disabled notes available only in nightly builds.disabled from version 56: this feature is behind the dom.payments.request.enabled preference (needs to be set to true).
performance.clearResourceTimings() - Web APIs
the clearresourcetimings() method removes all performance entries with an entrytype of "resource" from the browser's performance data buffer and sets the size of the performance data buffer to zero.
... to set the size of the browser's performance data buffer, use the performance.setresourcetimingbuffersize() method.
performance.now() - Web APIs
WebAPIPerformancenow
reduced time precision to offer protection against timing attacks and fingerprinting, the precision of performance.now() might get rounded depending on browser settings.
...coop process-isolates your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks.
Performance.onresourcetimingbufferfull - Web APIs
examples the following example sets a callback function on the onresourcetimingbufferfull property.
... function buffer_full(event) { console.log("warning: resource timing buffer is full!"); performance.setresourcetimingbuffersize(200); } function init() { // set a callback if the resource buffer becomes filled performance.onresourcetimingbufferfull = buffer_full; } <body onload="init()"> specifications specification status comment resource timing level 1the definition of 'onresourcetimingbufferfull' in that specification.
Performance: resourcetimingbufferfull event - Web APIs
bubbles yes cancelable yes interface event event handler property onresourcetimingbufferfull examples the following example sets a callback function on the onresourcetimingbufferfull property.
... function buffer_full(event) { console.log("warning: resource timing buffer is full!"); performance.setresourcetimingbuffersize(200); } function init() { // set a callback if the resource buffer becomes filled performance.onresourcetimingbufferfull = buffer_full; } <body onload="init()"> note that you could also set up the handler using the addeventlistener() function: performance.addeventlistener('resourcetimingbufferfull', buffer_full); specifications specification status comment resource timing level 1the definition of 'onresourcetimingbufferfull' in that specification.
Performance - Web APIs
performance.setresourcetimingbuffersize() sets the browser's resource timing buffer size to the specified number of "resource" type performance entry objects.
... candidate recommendation defines clearresourcetimings() and setresourcetimingbuffersize() methods and the onresourcetimingbufferfull property.
PerformanceNavigationTiming.domComplete - Web APIs
the domcomplete read-only property returns a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to complete.
... syntax perfentry.domcomplete; return value a timestamp representing a time value equal to the time immediately before the user agent sets the current document readiness of the current document to complete.
PerformanceNavigationTiming.domInteractive - Web APIs
the dominteractive read-only property returns a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive.
... syntax perfentry.dominteractive; return value a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive.
PerformanceNavigationTiming - Web APIs
the interface also supports the following properties: performancenavigationtiming.domcomplete read only a domhighrestimestamp representing a time value equal to the time immediately before the browser sets the current document readiness of the current document to complete.
... performancenavigationtiming.dominteractive read only a domhighrestimestamp representing a timestamp representing the time value equal to the time immediately before the user agent sets the current document readiness of the current document to interactive.
PerformanceObserver.observe() - Web APIs
the observe() method of the performanceobserver interface is used to specify the set of performance entry types to observe.
... when a matching performance entry is recorded, the performance observer's callback function—set when creating the performanceobserver—is invoked.
Performance Timeline - Web APIs
performance extensions the performance timeline api extends the performance interface with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria.
...(some performance entry types have no concept of duration and this value is set to '0' for such types.) this interface includes a tojson() method that returns the serialization of the performanceentry object.
Permissions.revoke() - Web APIs
the permissions.revoke() method of the permissions interface reverts a currently set permission back to its default state, which is usually prompt.
... var revokepromise = navigator.permissions.revoke(descriptor); parameters descriptor an object based on the permissiondescriptor dictionary that sets options for the operation consisting of a comma-separated list of name-value pairs.
PhotoCapabilities.imageHeight - Web APIs
the imageheight read-only property of the photocapabilities interface returns a mediasettingsrange object indicating the image height range supported by the user agent.
... syntax var mediasettingsrange = photocapabilities.imageheight value a mediasettingsrange object.
imageWidth - Web APIs
the imagewidth read-only property of the photocapabilities interface returns a mediasettingsrange object indicating the image width range supported by the user agent.
... syntax var mediasettingsrange = photocapabilities.imagewidth value a mediasettingsrange is an object.
PositionOptions.maximumAge - Web APIs
if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position.
... if set to infinity the device must return a cached position regardless of its age.
PositionOptions - Web APIs
if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position.
... if set to infinity the device must return a cached position regardless of its age.
Push API - Web APIs
WebAPIPush API
note: chrome versions earlier than 52 require you to set up a project on google cloud messaging to send push messages, and use the associated project number and api key when sending push notifications.
...when a push service sets an expiration time.) examples mozilla's serviceworker cookbook contains many useful push examples.
RTCConfiguration.certificates - Web APIs
description if this property isn't included in the configuration, a set of certificates is automatically generated for each instance of rtcpeerconnection.
...if it's included in the configuration passed into a call to a connection's setconfiguration(), it is ignored.
RTCDTMFSender - Web APIs
methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts sending the specified tones.
...you can abort sending queued tones by specifying an empty string ("") as the set of tones to play.
RTCDataChannel: bufferedamountlow event - Web APIs
bubbles no cancelable no interface event event handler property onbufferedamountlow examples this example sets up a handler for bufferedamountlow to request more data any time the data channel's buffer falls below the number of bytes specified by bufferedamountlowthreshold, which we have set to 65536.
... you can also set up a listener for bufferedamountlow using its event handler property, onbufferedamountlow: pc.onbufferedamountlow = ev => { if (source.position <= source.length) { dc.send(source.readfile(65536)); } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'bufferedamountlow' in that specification.
RTCDataChannel.close() - Web APIs
the sequence of events which occurs in response to this method being called: rtcdatachannel.readystate is set to "closing".
... the rtcdatachannel.readystate property is set to "closed".
RTCDataChannel: close event - Web APIs
bubbles no cancelable no interface event event handler property rtcdatachannel.onclose examples this example sets up a handler for the close event for the rtcdatachannel named dc; its responsibility in this example is to update user interface elements to reflect that there is no longer an ongoing call, and to allow a new call to be started.
... you can also use the onclose event handler property to set a handler for close events: dc.onclose = ev => { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'close' in that specification.
RTCDataChannel: error event - Web APIs
each error type has a different set of information output.
... you can also set up an event handler for error events using the rtcdatachannel interface's onerror event handler property: dc.onerror = ev => { const err = ev.error; /* ...
RTCDataChannel.label - Web APIs
a data channel's label is set when the channel is created by calling rtcpeerconnection.createdatachannel().
... example this sample creates a data channel on an rtcpeerconnection, then, some time later, sets the content of a ui element to display the channel's name.
RTCDataChannel.maxPacketLifeTime - Web APIs
the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.
...if not set when rtcpeerconnection.createdatachannel() was called to create the data channel, this value is null.
RTCDataChannel: message event - Web APIs
examples for a given rtcdatachannel, dc, created for a peer connection using its createdatachannel() method, this code sets up a handler for incoming messages and acts on them by adding the data contained within the message to the current document as a new <p> (paragraph) element.
... you can also use an rtcdatachannel object's onmessage event handler property to set the event handler: dc.onmessage = ev => { let newparagraph = document.createelement("p"); let textnode = document.createtextnode(event.data); newparagraph.appendchild(textnode); document.body.appendchild(newparagraph); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'the <code>message</code> e...
RTCIceCandidate.address - Web APIs
the address field's value is set when the rtcicecandidate() constructor is used.
...to do this, configure the ice agent's ice transport policy using rtcconfiguration, like this: var rtcconfig = { iceservers: [ { urls: "turn:myturn.server.ip", username: "username", credential: "password" } ], icetransportpolicy: "relay" } by setting rtcconfiguration.icetransportpolicy to "relay", any host candidates (candidates where the ip address is the peer's own ip address) are left out of the pool of candidates, as are any other candidates which aren't relay candidates.
RTCIceCandidate.relatedAddress - Web APIs
the relatedaddress field's value is set when the rtcicecandidate() constructor is used.
...for relay candidates, the related address and port are set to the mapped address selected by the turn server.
RTCIceCandidate.sdpMLineIndex - Web APIs
this value is specified when creating the rtcicecandidate by setting the corresponding sdpmlineindex value in the rtcicecandidateinit object when creating a new candidate with new rtcicecandidate().
... syntax var sdpmlineindex = rtcicecandidate.sdpmlineindex; value a number containing a 0-based index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available.
RTCIceCandidate.tcpType - Web APIs
the tcptype field's value is set when the rtcicecandidate() constructor is used.
... you can't directly set its value; instead, its value is automatically extracted from the candidate a-line, if it's formatted properly.
RTCIceCandidate.usernameFragment - Web APIs
this value is specified when creating the rtcicecandidate by setting the corresponding usernamefragment value in the rtcicecandidateinit object when creating a new candidate with new rtcicecandidate().
... to do so, you can compare the value of usernamefragment to the current usernamefragment being used for the connection after receiving the candidate from the signaling server and before caling addicecandidate() to add it to the set of possible candidates.
RTCIceCandidatePairStats - Web APIs
circuitbreakertriggercount optional an integer value indicating the number of times the circuit-breaker has been triggered for this particular 5-tuple (the set of five values comprising a tcp connection: source ip address, source port number, destination ip address, destination port number, and protocol).
... lastresponsetimestamp optional a domhighrestimestamp value that specifies the time at which the last (most recent) stun response was received by the local candidate from the remote candidate in this pair.
RTCIceCandidateStats.deleted - Web APIs
example in this example, setinterval() is used to set up a function that runs periodically to display the latest statistics for candidates.
... window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let statsoutput = ""; stats.foreach(report => { if ((stats.type === "local-candidate" || stats.type === "remote.candidate") && !stats.deleted) { statsoutput += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(report).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { statsoutput += `<strong>${statname}:</stron...
RTCIceCandidateStats.networkType - Web APIs
example this example sets up a periodic function using setinterval() that outputs statistics reports for candidates that use or would use a cellular data network to a log view.
... window.setinterval(function() { mypeerconnection.getstats(null).then(stats => { let statsoutput = ""; stats.foreach(report => { if ((stats.type === "local-candidate" || stats.type === "remote.candidate") && stats.networktype === "cellular") { statsoutput += `<h2>report: ${report.type}</h3>\n<strong>id:</strong> ${report.id}<br>\n` + `<strong>timestamp:</strong> ${report.timestamp}<br>\n`; // now the statistics for this report; we intentially drop the ones we // sorted to the top above object.keys(report).foreach(statname => { if (statname !== "id" && statname !== "timestamp" && statname !== "type") { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; } });...
RTCIceTransport.onselectedcandidatepairchange - Web APIs
syntax rtcicetransport.onselectedcandidatepairchange = candidatepairhandler; value this propoerty should be set to reference an event handler function to be called by the ice agent when it discovers a new candidate pair that the rtcicetransport will be using for communication with the remote peer.
... example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair.
RTCIdentityAssertion - Web APIs
if no peer has yet been set and verified this interface returns null.
... once set it can't be changed.
RTCOfferOptions - Web APIs
the rtcofferoptions dictionary is used to provide optional settings when creating an rtcpeerconnection offer with the createoffer() method.
... icerestart optional a boolean which, when set to true, tells createoffer() to generate and use new values for the identifying properties of the sdp it creates, resulting in a request that triggers renegotiation of the ice connection.
RTCPeerConnection: addstream event - Web APIs
if it does, a track event listener is set up; otherwise, an addstream event listener is set up.
... you can also use the addeventlistener() method to set an event listener: pc.addeventlistener("addstream", ev => doaddstream(ev.stream), false); ...
RTCPeerConnection.createAnswer() - Web APIs
the contents of the object being passed to the sendtoserver() function, along with everything else in the promise fulfillment handler, depend entirely on your design pc.createanswer().then(function(answer) { return pc.setlocaldescription(answer); }) .then(function() { // send the answer to the remote peer through the signaling server.
...in our promise handler, the returned answer is set as the description of the local end of the connection by calling setlocaldescription().
RTCPeerConnection.createDataChannel() - Web APIs
the options which can be configured using the rtcdatachannelinit dictionary represent the script-settable subset of the properties on the rtcdatachannel interface.
... examples this example shows how to create a data channel and set up handlers for the open and message events to send and receive messages on it (for brievity, the example assumes onnegotiationneeded is set up).
RTCPeerConnection: datachannel event - Web APIs
bubbles no cancelable no interface rtcdatachannelevent event handler property ondatachannel examples this example sets up a function that handles datachannel events by gathering the information needed to communicate with the newly added rtcdatachannel and by adding event handlers for the events that occur on that channel.
... pc.addeventlistener("datachannel", ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the remote peer to the local one.
RTCPeerConnection: iceconnectionstatechange event - Web APIs
the ice layer makes this determination upon receiving the end-of-candidates signal, which is provided by caling addicecandidate() with a candidate whose candidate property is an empty string (""), or by setting the rtcpeerconnection property cantrickleicecandidates to false.
... in this example, a handler for iceconnectionstatechange is set up to update a call state indicator by using the value of iceconnectionstate to create a string which corresponds to the name of a css class that we can assign to the status indicator to cause it to reflect the current state of the connection.
RTCPeerConnection.onicecandidate - Web APIs
syntax rtcpeerconnection.onicecandidate = eventhandler; value this should be set to a function which you provide that accepts as input an rtcpeerconnectioniceevent object representing the icecandidate event.
... example the example below, which is based on the code from the article signaling and video calling, sets up a handler for icecandidate events to send the candidates to the remote peer.
RTCPeerConnection.remoteDescription - Web APIs
if this hasn't been set yet, this is null.
... the returned value typically reflects a remote description which has been received over the signaling server (as either an offer or an answer) and then put into effect by your code calling rtcpeerconnection.setremotedescription() in response.
RTCPeerConnection.removeStream() - Web APIs
if the signalingstate is set to "closed", an invalidstateerror is raised.
... if the signalingstate is set to "stable", the event negotiationneeded is sent on the rtcpeerconnection.
RTCPeerConnection.removeTrack() - Web APIs
if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs.
... example this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button.
RTCPeerConnection.restartIce() - Web APIs
after restartice() returns, the offer returned by the next call to createoffer() is automatically configured to trigger ice restart on both the local peer (once the local peer has been set) and on the remote peer, once the offer is sent across your signaling mechanism and the remote peer has set its description as well.
...restarting ice essentially resets ice so that it creates all new candidates using new credentials.
RTCRtpContributingSource.source - Web APIs
hrome full support 59edge full support ≤79firefox full support 59disabled full support 59disabled disabled from version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true).
... full support 59chrome android full support 59firefox android full support 59disabled full support 59disabled disabled from version 59: this feature is behind the media.peerconnection.rtpsourcesapi.enable preference (needs to be set to true).
RTCRtpReceiver.getCapabilities() static function - Web APIs
description as a static function, this is always called using the form: capabilities = rtcrtpreceiver.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list.
... because the set of capabilities available tend to be stable for a length of time (people don't install and uninstall codecs and the like very often), the media capabilities can in whole or in part provide a cross-origin method for identifying a user.
RTCRtpSendParameters - Web APIs
the webrtc api's rtcrtpsendparameters dictionary is used to specify the parameters for an rtcrtpsender when calling its setparameters() method.
... 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().
RTCRtpSender.getCapabilities() static function - Web APIs
description as a static function, this is always called using the form: capabilities = rtcrtpsender.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list.
... because the set of capabilities available tend to be stable for a length of time (people don't install and uninstall codecs and the like very often), the media capabilities can in whole or in part provide a cross-origin method for identifying a user.
RTCRtpSender - Web APIs
rtcrtpsender.setparameters() applies changes to parameters which configure how the track is encoded and transmitted to the remote peer.
... rtcrtpsender.setstreams() sets the mediastream(s) associated with the track being transmitted by this sender.
RTCRtpTransceiver.currentDirection - Web APIs
you can examine and set the transceiver's preferred directionality using direction property.
... [1] to determine if a sender has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding.
RTCRtpTransceiver - Web APIs
direction a string from the enum rtcrtptransceiverdirection which is used to set the transceiver's desired direction.
... methods setcodecpreferences() a list of rtcrtpcodecparameters objects which override the default preferences used by the user agent for the transceiver's codecs.
RTCRtpTransceiverDirection - Web APIs
the rtcrtptransceiverdirection type is an enumerated set of strings which are used to describe the directionality of a rtcrtptransceiver instance.
... [1] to determine if a sender has at least one active encoding, the user agent gets its parameters using rtcrtpsender.getparameters(), then looks at the parameters' encodings property; if any of the listed encodings has its active property set to true, the sender has an active encoding.
RadioNodeList - Web APIs
the radionodelist interface represents a collection of radio elements in a <form> or a <fieldset> element.
...on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked.
Range() - Web APIs
WebAPIRangeRange
syntax range = new range() example in this example we create a new range with the range() constructor, and set its beginning and end positions using the range.setstartbefore() and range.setendafter() methods.
... html <p>first paragraph.</p> <p>second paragraph.</p> <p>third paragraph.</p> <p>fourth paragraph.</p> javascript const paragraphs = document.queryselectorall('p'); // create new range const range = new range(); // start range at second paragraph range.setstartbefore(paragraphs[1]); // end range at third paragraph range.setendafter(paragraphs[2]); // get window selection const selection = window.getselection(); // add range to window selection selection.addrange(range); result specification specification status comment domthe definition of 'range.range()' in that specification.
Range.endContainer - Web APIs
to change the end position of a node, use the range.setend() method or a similar one.
... syntax endrangenode = range.endcontainer; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangenode = range.endcontainer; specifications specification status comment domthe definition of 'range.endcontainer' in that specification.
Range.selectNodeContents() - Web APIs
the range.selectnodecontents() method sets the range to contain the contents of a node.
...the startoffset is 0, and the endoffset is the number of child nodes or number of characters contained in the reference node.
Range.startContainer - Web APIs
to change the start position of a node, use one of the range.setstart() methods.
... syntax startrangenode = range.startcontainer; example range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); startrangenode = range.startcontainer; specifications specification status comment domthe definition of 'range.endcontainer' in that specification.
ResizeObserver.observe() - Web APIs
options optional an options object allowing you to set options for the observation.
... currently this only has one possible option that can be set: box sets which box model the observer will observe changes to.
Response.type - Web APIs
WebAPIResponsetype
it can be one of the following: basic: normal, same origin response, with all headers exposed except “set-cookie” and “set-cookie2″.
... syntax var mytype = response.type; value a responsetype string indicating the type of the response.
SVGAnimatedPathData - Web APIs
name type description animatednormalizedpathseglist svgpathseglist provides access to the current animated contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z).
... normalizedpathseglist svgpathseglist provides access to the base (i.e., static) contents of the 'd' attribute in a form where all path data commands are expressed in terms of the following subset of svgpathseg types: svg_pathseg_moveto_abs (m), svg_pathseg_lineto_abs (l), svg_pathseg_curveto_cubic_abs (c) and svg_pathseg_closepath (z).
SVGAnimatedString.baseVal - Web APIs
baseval gets or sets the base value of the given attribute before any animations are applied.the base value of the given attribute before applying any animations.
... setter throws domexception.
SVGFilterElement - Web APIs
methods svgfilterelement.setfilterres() sets the values of the filterres attribute.
... working draft removed the inheritance from svglangspace, svgexternalresourcesrequired, svgstylable, and svgunittypes and removed the setfilterres() function scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgfilterelement' in that specification.
SVGGraphicsElement: copy event - Web APIs
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault().
.../text> <foreignobject x="5" y="20" width="90" height="20"> <input xmlns="http://www.w3.org/1999/xhtml" placeholder="paste it here"/> </foreignobject> </svg> css input { font-size: 10px; width: 100%; height: 90%; box-sizing: border-box; border: 1px solid black; } javascript document.getelementsbytagname("text")[0].addeventlistener("copy", evt => { evt.clipboarddata.setdata('text/plain', document.getselection().tostring().touppercase()); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation definition that the clipboard events apply to svg elements.
getBBox() - Web APIs
ke-width="3" fill="none"> </rect> <!-- shows boundingclientrect in red --> <rect id="rect_2" stroke="#ff0000" stroke-width="3" fill="none"></rect> </svg> javascript var rectbbox = document.queryselector('#rect_1'); var rectboundingclientrect = document.queryselector('#rect_2'); var groupelement = document.queryselector('#group_text_1'); var bboxgroup = groupelement.getbbox(); rectbbox.setattribute('x', bboxgroup.x); rectbbox.setattribute('y', bboxgroup.y); rectbbox.setattribute('width', bboxgroup.width); rectbbox.setattribute('height', bboxgroup.height); var boundingclientrectgroup = groupelement.getboundingclientrect(); rectboundingclientrect.setattribute('x', boundingclientrectgroup.x); rectboundingclientrect.setattribute('y', boundingclientrectgroup.y); rectboundingclientrect.
...setattribute('width', boundingclientrectgroup.width); rectboundingclientrect.setattribute('height', boundingclientrectgroup.height); specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'getbbox' in that specification.
Screen.availLeft - Web APIs
WebAPIScreenavailLeft
syntax let availleft = window.screen.availleft; example let setx = window.screen.width - window.screen.availleft; let sety = window.screen.height - window.screen.availtop; window.moveto(setx, sety); notes in most cases, this property returns 0.
... on windows, this property depends on which screen is set as your primary, returning the x coordinate of the leftmost available pixel relative to the primary screen.
Screen.height - Web APIs
WebAPIScreenheight
internet explorer will take into account the zoom setting when reporting the screen height.
... it will only return the real height of the screen if the zoom is set to 100%.
Screen.lockOrientation() - Web APIs
note: it's possible to set several locks at the same time.
... so, if the lock is set for only one orientation, the screen orientation will never change until the screen orientation is unlocked.
Screen.width - Web APIs
WebAPIScreenwidth
internet explorer will take into account the zoom setting when reporting the screen width.
... it will only return the real width of the screen if the zoom is set to 100%.
Screen - Web APIs
WebAPIScreen
setting to false will turn off the device's screen.
... void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specification specification status comment css object model (cssom) view modulethe definition of 'screen' in that specification.
ScriptProcessorNode.bufferSize - Web APIs
for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case.
...rce = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingev...
ScriptProcessorNode.onaudioprocess - Web APIs
for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case.
...rce = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessin...
ScriptProcessorNode - Web APIs
for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case.
...rce = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // give the node a function to process audio events scriptnode.onaudioprocess = function(audioprocessingev...
Sensor APIs - Web APIs
the sensor apis are a set of interfaces built to a common design that expose device sensors in a consistent way to the web platform.
... if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
ServiceWorkerContainer.register() - Web APIs
by default, the scope value for a service worker registration is set to the directory where the service worker script is located.
...scope manually navigator.serviceworker.register('/sw.js', {scope: '/product/'}).then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } however, servers can remove this restriction by setting a service-worker-allowed header on the service worker script, and then you can specify a max scope for that service worker above the service worker's location.
ServiceWorkerGlobalScope: install event - Web APIs
bubbles no cancelable no interface extendableevent event handler property serviceworkerglobalscope.oninstall examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the service worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunt...
...ers.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ); }) ); }); you can also set up the event handler using the serviceworkerglobalscope.oninstall property: globalscope.oninstall = function(event) { ...
ServiceWorkerGlobalScope - Web APIs
when a push service sets an expiration time).
...it will return a normal response object that has the appropriate error code set.
ServiceWorkerMessageEvent.data - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
... // set up a message channel to communicate with the sw var channel = new messagechannel(); channel.port1.onmessage = function(e) { console.log(e); handlechannelmessage(e.data); } mysw = reg.active; mysw.postmessage('hello', [channel.port2]); }); ...
ServiceWorkerMessageEvent.lastEventId - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
... // set up a message channel to communicate with the sw var channel = new messagechannel(); channel.port1.onmessage = function(e) { console.log(e.lasteventid); handlechannelmessage(e.data); } mysw = reg.active; mysw.postmessage('hello', [channel.port2]); }); ...
ServiceWorkerMessageEvent.ports - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
... // set up a message channel to communicate with the sw var channel = new messagechannel(); channel.port1.onmessage = function(e) { console.log(e.ports); handlechannelmessage(e.data); } mysw = reg.active; mysw.postmessage('hello', [channel.port2]); }); ...
ServiceWorkerMessageEvent.source - Web APIs
examples when the following code is used inside the main thread to set up a message channel between it and a service worker for sending messages between the two, the event object of onmessage will be a serviceworkermessageevent.
... // set up a message channel to communicate with the sw var channel = new messagechannel(); channel.port1.onmessage = function(e) { console.log(e.source); handlechannelmessage(e.data); } mysw = reg.active; mysw.postmessage('hello', [channel.port2]); }); ...
ServiceWorkerRegistration.active - Web APIs
this property is initially set to null.
... an active worker controls a serviceworkerclient if the client's url falls within the scope of the registration (the scope option set when serviceworkercontainer.register is first called.) note: this feature is available in web workers.
SourceBuffer.appendWindowEnd - Web APIs
exceptions the following exceptions may be thrown when setting a new value for this property.
... exception explanation invalidaccesserror an attempt was made to set the value to less than or equal to sourcebuffer.appendwindowstart, or nan.
SourceBuffer.appendWindowStart - Web APIs
exceptions the following exceptions may be thrown when setting a new value for this property.
... exception explanation invalidaccesserror an attempt was made to set the value to less than 0, or a value greater than or equal to sourcebuffer.appendwindowend.
SpeechGrammar.src - Web APIs
WebAPISpeechGrammarsrc
the src property of the speechgrammar interface sets and returns a string containing the grammar from within in the speechgrammar object.
...llow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
SpeechGrammar.weight - Web APIs
the optional weight property of the speechgrammar interface sets and returns the weight of the speechgrammar object.
...llow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; console.log(speechrecognitionlist[0].src); // should return the same as the contents of the grammar variable console.log(speechrecognitionlist[0].weight); // should return 1 - the same as the weight set in line 4.
SpeechRecognition.lang - Web APIs
the lang property of the speechrecognition interface returns and sets the language of the current speechrecognition.
... if not specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either.
SpeechSynthesis: voiceschanged event - Web APIs
you can use the voiceschanged event in an addeventlistener method: var synth = window.speechsynthesis; synth.addeventlistener('voiceschanged', function() { var voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } }); or use the onvoiceschanged event handler property: synth.onvoiceschanged = function() { var voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' ('...
... + voices[i].lang + ')'; option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } specifications specification status comment web speech apithe definition of 'speech synthesis events' in that specification.
SpeechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
...r('#rate'); var ratevalue = document.queryselector('.rate-value'); var voices = []; function populatevoicelist() { voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); ...
SpeechSynthesisUtterance.pitch - Web APIs
the pitch property of the speechsynthesisutterance interface gets and sets the pitch at which the utterance will be spoken at.
... if unset, a default value of 1 will be used.
SpeechSynthesisUtterance.rate - Web APIs
the rate property of the speechsynthesisutterance interface gets and sets the speed at which the utterance will be spoken at.
... if unset, a default value of 1 will be used.
SpeechSynthesisUtterance.volume - Web APIs
the volume property of the speechsynthesisutterance interface gets and sets the volume that the utterance will be spoken at.
... if not set, the default value 1 will be used.
StaticRange.StaticRange() - Web APIs
startoffset the offset into the starting node at which the first character of the range is found.
... endoffset the offset into the node indicated by endoffset at which the last character in the range is located.
Storage.getItem() - Web APIs
WebAPIStoragegetItem
example the following function retrieves three data items from local storage, then uses them to set custom styles on a page.
... function setstyles() { var currentcolor = localstorage.getitem('bgcolor'); var currentfont = localstorage.getitem('font'); var currentimage = localstorage.getitem('image'); document.getelementbyid('bgcolor').value = currentcolor; document.getelementbyid('font').value = currentfont; document.getelementbyid('image').value = currentimage; htmlelem.style.backgroundcolor = '#' + currentcolor; pelem.style.fontfamily = currentfont; imgelem.setattribute('src', currentimage); } note: to see this used within a real world example, see our web storage demo.
Storage.removeItem() - Web APIs
function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'mycat.png'); localstorage.removeitem('image'); } we can do the same for the session storage.
... function populatestorage() { sessionstorage.setitem('bgcolor', 'red'); sessionstorage.setitem('font', 'helvetica'); sessionstorage.setitem('image', 'mycat.png'); sessionstorage.removeitem('image'); } note: to see this used within a real world example, see our web storage demo.
Using the Storage Access API - Web APIs
usage notes the storage access api is designed to allow embedded content to request access to storage that would otherwise be blocked when a user’s browser is set to block all third-party cookies.
... // let's access some items from the first-party cookie jar document.cookie = "foo=bar"; // set a cookie localstorage.setitem("username", "john"); // access a localstorage entry }).catch(_ => { // error obtaining storage access.
Storage Access API - Web APIs
scripts, images, stylesheets, etc.) will load with access to their first-party storage, which means they may send cookie headers and honor incoming set-cookie headers.
... in safari, successful use of the storage access api resets this counter.
TextTrackList - Web APIs
usage notes in addition to being able to obtain direct access to the text tracks present on a media element, texttracklist lets you set event handlers on the addtrack and removetrack events, so that you can detect when tracks are added to or removed from the media element's stream.
...to keep it up to date, handlers for the addtrack and removetrack events are set up.
TimeRanges - Web APIs
the timeranges interface is used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <audio> and <video> elements.
... a timeranges object includes one or more ranges of time, each specified by a starting and ending time offset.
Touch.screenX - Web APIs
WebAPITouchscreenX
summary returns the x coordinate of the touch point relative to the screen, not including any scroll offset.
... syntax var x = touchitem.screenx; return value x the x coordinate of the touch point relative to the screen, not including any scroll offset.
Touch.screenY - Web APIs
WebAPITouchscreenY
summary returns the y coordinate of the touch point relative to the screen, not including any scroll offset.
... syntax var y = touchitem.screeny; return value y the y coordinate of the touch point relative to the screen, not including any scroll offset.
TrackEvent - Web APIs
the trackevent interface, which is part of the html dom specification, is used for events which represent changes to a set of available tracks on an html media element; these events are addtrack and removetrack.
... example this example sets up a function, handletrackevent(), which is callled for any addtrack or removetrack event on the first <video> element found in the document.
UIEvent.cancelBubble - Web APIs
it is set to false by default, allowing the event to bubble up the dom, if it is a bubbleable event.
... setting this property to true stops the event from bubbling up the dom.
UIEvent.pageX - Web APIs
WebAPIUIEventpageX
this property was never part of any standard, and was only implemented across a subset of browsers, and only for a limited number of versions.
...this value is relative to the left edge of the entire document, regardless of the current horizontal scrolling offset of the document.
URLSearchParams - Web APIs
urlsearchparams.set() sets the value associated with a given search parameter to the given value.
...for (let p of searchparams) { console.log(p); } searchparams.has("topic") === true; // true searchparams.get("topic") === "api"; // true searchparams.getall("topic"); // ["api"] searchparams.get("foo") === null; // true searchparams.append("topic", "webdev"); searchparams.tostring(); // "q=urlutils.searchparams&topic=api&topic=webdev" searchparams.set("topic", "more webdev"); searchparams.tostring(); // "q=urlutils.searchparams&topic=more+webdev" searchparams.delete("topic"); searchparams.tostring(); // "q=urlutils.searchparams" gotchas the urlsearchparams constructor does not parse full urls.
USBDevice.opened - Web APIs
WebAPIUSBDeviceopened
it shows how to test that a device is open before calling usbdevice.controltransferout to set a specified led color.
... async setdevicecolor(usbdevice, r, g, b) { if (device.opened) { // this hypothetical usb device requires that the data passed to // it be in a uint8array.
USBDevice.selectAlternateInterface() - Web APIs
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.
ValidityState.rangeOverflow - Web APIs
the read-only rangeoverflow property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's max attribute.
... if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and a max value is set, if the value don't doesn't conform to the constraints set by the max value, the rangeoverflow property will be true.
ValidityState.rangeUnderflow - Web APIs
the read-only rangeunderflow property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's min attribute.
... if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and a min value is set, if the value don't doesn't conform to the constraints set by the min value, the rangeunderflow property will be true.
ValidityState.stepMismatch - Web APIs
the read-only stepmismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's step attribute.
... if the field is numeric in nature, including the date, month, week, time, datetime-local, number and range types and the step value is not any, if the value don't doesn't conform to the constraints set by the step and min values, then stepmismatch will be true.
ValidityState.typeMismatch - Web APIs
the read-only typemismatch property of a validitystate object indicates if the value of an <input>, after having been edited by the user, does not conform to the constraints set by the element's type attribute.
... if the type attribute expects specific strings, such as the email and url types and the value don't doesn't conform to the constraints set by the type, the typemismatch property will be true.
Vibration API - Web APIs
continued vibrations some basic setinterval and clearinterval action will allow you to create persistent vibration: var vibrateinterval; // starts vibration at passed in level function startvibrate(duration) { navigator.vibrate(duration); } // stops vibration function stopvibrate() { // clear interval and stop persistent vibrating if(vibrateinterval) clearinterval(vibrateinterval); navigator.vibrate(0); } // sta...
...rt persistent vibration at given duration and interval // assumes a number value is given function startpersistentvibrate(duration, interval) { vibrateinterval = setinterval(function() { startvibrate(duration); }, interval); } of course, the snippet above doesn't take into account the array method of vibration; persistent array-based vibration will require calculating the sum of the array items and creating an interval based on that number (with an additional delay, probably).
VideoTrackList - Web APIs
usage notes in addition to being able to obtain direct access to the video tracks present on a media element, videotracklist lets you set event handlers on the addtrack and removetrack events, so that you can detect when tracks are added to or removed from the media element's stream.
...to keep it up to date, handlers for the addtrack and removetrack events are set up.
WEBGL_compressed_texture_pvrtc - Web APIs
availability: pvrtc is typically only available on mobile devices with powervr chipsets.
... constants the compressed texture formats are exposed by four constants and can be used in two functions: compressedteximage2d() (where the height and width parameters must be powers of 2) and compressedtexsubimage2d() (where the the height and width parameters must equal the current values of the existing texture and the xoffset and yoffset parameters must be 0).
WebGL2RenderingContext.bindBufferRange() - Web APIs
syntax void gl.bindbufferrange(target, index, buffer, offset, size); parameters target a glenum specifying the target for the bind operation.
... offset a glintptr specifying the starting offset.
WebGL2RenderingContext.copyBufferSubData() - Web APIs
syntax void gl.copybuffersubdata(readtarget, writetarget, readoffset, writeoffset, size); parameters readtarget writetarget a glenum specifying the binding point (target) from whose data store should be read or written.
... readoffset writeoffset a glintptr specifying the byte offset from which to start reading from or writing to the buffer.
WebGL2RenderingContext.getActiveUniforms() - Web APIs
gl.uniform_offset: returns an array of glint indicating the uniform buffer offsets.
... examples var uniformindices = gl.getuniformindices(program, ['ubored', 'ubogreen', 'uboblue']); var uniformoffsets = gl.getactiveuniforms(program, uniformindices, gl.uniform_offset); specifications specification status comment webgl 2.0the definition of 'getactiveuniforms' in that specification.
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
the webgl2renderingcontext.samplerparameter[if]() methods of the webgl 2 api set webglsampler parameters.
... pname a glenum specifying which parameter to set.
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
syntax void gl.uniform1ui(location, v0); void gl.uniform2ui(location, v0, v1); void gl.uniform3ui(location, v0, v1, v2); void gl.uniform4ui(location, v0, v1, v2, v3); void gl.uniform1fv(location, data, optional srcoffset, optional srclength); void gl.uniform2fv(location, data, optional srcoffset, optional srclength); void gl.uniform3fv(location, data, optional srcoffset, optional srclength); void gl.uniform4fv(location, data, optional srcoffset, optional srclength); void gl.uniform1iv(location, data, optional srcoffset, optional srclength); void gl.uniform2iv(location, data, optional srcoffset, optional srclength...
...); void gl.uniform3iv(location, data, optional srcoffset, optional srclength); void gl.uniform4iv(location, data, optional srcoffset, optional srclength); void gl.uniform1uiv(location, data, optional srcoffset, optional srclength); void gl.uniform2uiv(location, data, optional srcoffset, optional srclength); void gl.uniform3uiv(location, data, optional srcoffset, optional srclength); void gl.uniform4uiv(location, data, optional srcoffset, optional srclength); parameters location a webgluniformlocation object containing the location of the uniform attribute to modify.
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
syntax void gl.uniformmatrix2fv(location, transpose, data, optional srcoffset, optional srclength); void gl.uniformmatrix3x2fv(location, transpose, data, optional srcoffset, optional srclength); void gl.uniformmatrix4x2fv(location, transpose, data, optional srcoffset, optional srclength); void gl.uniformmatrix2x3fv(location, transpose, data, optional srcoffset, optional srclength); void gl.uniformmatrix3fv(location, transpose, data, optional srcoffset, optional srclength); void gl.uniformmatrix4x3fv(location, transpose, data...
..., optional srcoffset, optional srclength); void gl.uniformmatrix2x4fv(location, transpose, data, optional srcoffset, optional srclength); void gl.uniformmatrix3x4fv(location, transpose, data, optional srcoffset, optional srclength); void gl.uniformmatrix4fv(location, transpose, data, optional srcoffset, optional srclength); parameters location a webgluniformlocation object containing the location of the uniform attribute to modify.
WebGLRenderingContext.blendColor() - Web APIs
the webglrenderingcontext.blendcolor() method of the webgl api is used to set the source and destination blending factors.
... examples to set the blend color, use: gl.blendcolor(0, 0.5, 1, 1); to get the blend color, query the blend_color constant which returns a float32array.
WebGLRenderingContext.blendEquation() - Web APIs
the webglrenderingcontext.blendequation() method of the webgl api is used to set both the rgb blend equation and alpha blend equation to a single equation.
... examples to set the blend equation, use: gl.blendequation(gl.func_add); gl.blendequation(gl.func_subtract); gl.blendequation(gl.func_reverse_subtract); to get the blend equations, query the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext.
WebGLRenderingContext.blendEquationSeparate() - Web APIs
the webglrenderingcontext.blendequationseparate() method of the webgl api is used to set the rgb blend equation and alpha blend equation separately.
... examples to set the blend equations, use: gl.blendequationseparate(gl.func_add, gl.func_subtract); to get the current blend equations, query the blend_equation, blend_equation_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext.
WebGLRenderingContext.clear() - Web APIs
the webglrenderingcontext.clear() method of the webgl api clears buffers to preset values.
... the preset values can be set by clearcolor(), cleardepth() or clearstencil().
WebGLRenderingContext.disable() - Web APIs
gl.polygon_offset_fill deactivates adding an offset to depth values of polygon's fragments.
... see webglrenderingcontext.polygonoffset().
WebGLRenderingContext.enable() - Web APIs
gl.polygon_offset_fill activates adding an offset to depth values of polygon's fragments.
... see webglrenderingcontext.polygonoffset().
WebGLRenderingContext.hint() - Web APIs
syntax void gl.hint(target, mode); parameters target sets which behavior to be controlled.
... when using a webgl 2 context, the following values are available additionally: gl.fragment_shader_derivative_hint: same as ext.fragment_shader_derivative_hint_oes mode sets the behavior.
WebGLRenderingContext.isEnabled() - Web APIs
gl.polygon_offset_fill adding an offset to depth values of polygon's fragments.
... see webglrenderingcontext.polygonoffset().
WebGLRenderingContext.lineWidth() - Web APIs
the webglrenderingcontext.linewidth() method of the webgl api sets the line width of rasterized lines.
... examples setting the line width: gl.linewidth(5); getting the line width: gl.getparameter(gl.line_width); getting the range of available widths.
WebGLRenderingContext.readPixels() - Web APIs
syntax // webgl1: void gl.readpixels(x, y, width, height, format, type, pixels); // webgl2: void gl.readpixels(x, y, width, height, format, type, glintptr offset); void gl.readpixels(x, y, width, height, format, type, arraybufferview pixels, gluint dstoffset); parameters x a glint specifying the first horizontal pixel that is read from the lower left corner of a rectangular block of pixels.
... dstoffset optional offset.
WebGLRenderingContext.sampleCoverage() - Web APIs
syntax void gl.samplecoverage(value, invert); parameters value a glclampf which sets a single floating-point coverage value clamped to the range [0,1].
... invert a glboolean which sets whether or not the coverage masks should be inverted.
WebGLRenderingContext.scissor() - Web APIs
the webglrenderingcontext.scissor() method of the webgl api sets a scissor box, which limits the drawing to a specified rectangle.
... // turn on scissor test gl.enable(gl.scissor_test); // set the scissor rectangle gl.scissor(x, y, width, height); // execute drawing commands in the scissor box (e.g.
WebGLRenderingContext.texParameter[fi]() - Web APIs
the webglrenderingcontext.texparameter[fi]() methods of the webgl api set texture parameters.
... the pname parameter is a glenum specifying the texture parameter to set.
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
the values set with vertexattribpointer are context-global, i.e.
... examples const a_foobar = gl.getattriblocation(shaderprogram, 'foobar'); //either set each component individually: gl.vertexattrib3f(a_foobar, 10.0, 5.0, 2.0); //or provide a float32array: const floatarray = new float32array([10.0, 5.0, 2.0]); gl.vertexattrib3fv(a_foobar, floatarray); // we want to load the following 3x3 matrix into attribute named "matrix3x3" // 0 1 2 // 3 4 5 // 6 7 8 const matrix3x3location = gl.getattriblocation(shaderprogram, 'matrix3x3'); gl.vertexattrib3f(matrix3x3location, 0, 3, 6); gl.vertexattrib3f...
WebGLRenderingContext.viewport() - Web APIs
the webglrenderingcontext.viewport() method of the webgl api sets the viewport, which specifies the affine transformation of x and y from normalized device coordinates to window coordinates.
...however, if you resize the canvas, you will need to tell the webgl context a new viewport setting.
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.
... <p>result of of scissoring.</p> <canvas>your browser does not seem to support html5 canvas.</canvas> body { text-align : center; } canvas { display : block; width : 280px; height : 210px; margin : auto; padding : 0; border : none; background-color : black; } window.addeventlistener("load", function setupwebgl (evt) { "use strict" window.removeeventlistener(evt.type, setupwebgl, false); var paragraph = document.queryselector("p"); var canvas = document.queryselector("canvas"); // the following two lines set the size (in css pixels) of // the drawing buffer to be identical to the size of the // canvas html element, as determined by css.
Canvas size and WebGL - Web APIs
« previousnext » this webgl example explores the effect of setting (or not setting) the canvas size to its element size in css pixels, as it appears in the browser window.
... the size of the first canvas is set to the styled element size, determined by css.
Hello vertex attributes - Web APIs
der"> #version 100 precision highp float; attribute float position; void main() { gl_position = vec4(position, 0.0, 0.0, 1.0); gl_pointsize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 precision mediump float; void main() { gl_fragcolor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use strict" window.addeventlistener("load", setupwebgl, false); var gl, program; function setupwebgl (evt) { window.removeeventlistener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = document.queryselec...
..." + "error log: " + linkerrlog; return; } initializeattributes(); gl.useprogram(program); gl.drawarrays(gl.points, 0, 1); document.queryselector("canvas").addeventlistener("click", function (evt) { var clickxrelativtocanvas = evt.pagex - evt.target.offsetleft; var clickxinwebglcoords = 2.0 * (clickxrelativtocanvas- gl.drawingbufferwidth/2) / gl.drawingbufferwidth; gl.bufferdata(gl.array_buffer, new float32array([clickxinwebglcoords]), gl.static_draw); gl.drawarrays(gl.points, 0, 1); }, false); } var buffer; function initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuff...
Lighting in WebGL - Web APIs
{ const numcomponents = 3; const type = gl.float; const normalize = false; const stride = 0; const offset = 0; gl.bindbuffer(gl.array_buffer, buffers.normal); gl.vertexattribpointer( programinfo.attriblocations.vertexnormal, numcomponents, type, normalize, stride, offset); gl.enablevertexattribarray( programinfo.attriblocations.vertexnormal); } finally, we need to update the code that builds the uniform matrices to generate and d...
...x shader: const fssource = ` varying highp vec2 vtexturecoord; varying highp vec3 vlighting; uniform sampler2d usampler; void main(void) { highp vec4 texelcolor = texture2d(usampler, vtexturecoord); gl_fragcolor = vec4(texelcolor.rgb * vlighting, texelcolor.a); } `; here we fetch the color of the texel, just like we did in the previous example, but before setting the color of the fragment, we multiply the texel's color by the lighting value to adjust the texel's color to take into account the effect of our light sources.
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
the webgl 2 api introduces support for much of the opengl es 3.0 feature set; it's provided through the webgl2renderingcontext interface.
...topics examined are adapting to aspect ratio differences, a function to build shader programs from sets of multiple shaders, and the basics of drawing in webgl.
WebRTC Statistics API - Web APIs
in this example, a new rtcpeerconnection is created, and then setinterval() is used to set the function getconnectionstats() to be called every second.
... try { mypeerconnection = new rtcpeerconnection(pcoptions); statsinterval = window.setinterval(getconnectionstats, 1000); /* add event handlers, etc */ } catch(err) { console.error("error creating rtcpeerconnection: " + err); } function getconnectionstats() { mypeerconnection.getstats(null).then(stats => { var statsoutput = ""; stats.foreach(report => { if (report.type === "inbound-rtp" && report.kind === "video") { object.keys(report).foreach(statname => { statsoutput += `<strong>${statname}:</strong> ${report[statname]}<br>\n`; }); } }); document.queryselector(".stats-box").innerhtml = statsoutput; }); } when t...
WebSocket.bufferedAmount - Web APIs
this value resets to zero once all queued data has been sent.
... this value does not reset to zero when the connection is closed; if you keep calling send(), this will continue to climb.
WebXR permissions and security - Web APIs
these mostly revolve around the fully-immersive immersive-vr session mode, but there are things to be aware of when setting up an ar session, as well.
... inline presentation when you request an xrsession with the mode set to inline, and any features are required or requested, the browser will only allow the session to be created if the call to requestsession() was made by code which is executing expressly due to user intent.
Web Animations API Concepts - Web APIs
the timing model keeps track of how far along a set timeline we've come.
...keyframe effects are a bundle of information including at the bare minimum a set of keys and the duration they need to be animated over.
Attestation and Assertion - Web APIs
tpm - the trusted platform module (tpm) is a set of specifications from the trusted platform group (tpg).
...n for android devices was to create android safetynet attestations fido u2f - security keys that implement the fido u2f standard use this format none - browsers may prompt users whether they want a site to be allowed to see their attestation data and/or may remove attestation data from the authenticator's response if the `attestation` parameter in `navigator.credentials.create()` is set to `none` the purpose of attestation is to cryptographically prove that a newly generated key pair came from a specific device.
Web Storage API - Web APIs
these mechanisms are available via the window.sessionstorage and window.localstorage properties (to be more precise, in supporting browsers the window object implements the windowlocalstorage and windowsessionstorage objects, which the localstorage and sessionstorage properties hang off) — invoking one of these will create an instance of the storage object, through which data items can be set, retrieved and removed.
... web storage interfaces storage allows you to set, retrieve and remove data for a specific domain and storage type (session or local.) window the web storage api extends the window object with two new properties — window.sessionstorage and window.localstorage — which provide access to the current domain's session and local storage objects respectively, and a window.onstorage event handler that fires when a storage area changes (e.g.
The structured clone algorithm - Web APIs
property descriptors, setters, getters, and similar metadata-like features are not duplicated.
...from object literals) map set ...
window.cancelIdleCallback() - Web APIs
47edge full support 79firefox full support 55 full support 55 full support 53disabled disabled from version 53: this feature is behind the dom.requestidlecallback.enabled preference (needs to be set to true).
... 47chrome android full support 47firefox android full support 55 full support 55 full support 53disabled disabled from version 53: this feature is behind the dom.requestidlecallback.enabled preference (needs to be set to true).
Window.defaultStatus - Web APIs
summary gets/sets the status bar text for the given window.
... example <html> <body onload="window.defaultstatus='hello!';"/> <button onclick="window.confirm('are you sure you want to quit?');">confirm</button> </body> </html> notes to set the status once the window has been opened, use window.status.
window.dump() - Web APIs
WebAPIWindowdump
to see the dump output you have to enable it by setting the preference browser.dom.window.dump.enabled to true.
... you can set the preference in about:config or in a user.js file.
Window.event - Web APIs
WebAPIWindowevent
12firefox full support 63notes disabled full support 63notes disabled notes this was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756).disabled from version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true).
...ox android full support 63notes disabled full support 63notes disabled notes this was briefly enabled by default in 65, then removed again while related compatibility issues are sorted out (see bug 1520756).disabled from version 63: this feature is behind the dom.window.event.enabled preference (needs to be set to true).
Window.fullScreen - Web APIs
WebAPIWindowfullScreen
bear in mind that if you try to set this property without chrome privileges, it will not throw an exception and instead just silently fail.
... this is to prevent scripts designed to set this property in internet explorer from breaking.
Window.getComputedStyle() - Web APIs
however, the two objects have different purposes: the object from getcomputedstyle is read-only, and should be used to inspect the element's style — including those set by a <style> element or an external stylesheet.
... the element.style object should be used to set styles on that element, or inspect styles directly added to it from javascript manipulation or the global style attribute.
Window.getSelection() - Web APIs
where display: none is set) firefox will return null, whereas other browsers will return a selection object with selection.type set to none.
...htmlinputelement.setselectionrange() or the selectionstart and selectionend properties could be used to work around this.
Window.localStorage - Web APIs
example the following snippet accesses the current domain's local storage object and adds a data item to it using storage.setitem().
... localstorage.setitem('mycat', 'tom'); the syntax for reading the localstorage item is as follows: const cat = localstorage.getitem('mycat'); the syntax for removing the localstorage item is as follows: localstorage.removeitem('mycat'); the syntax for removing all the localstorage items is as follows: localstorage.clear(); note: please refer to the using the web storage api article for a full example.
Window.name - Web APIs
WebAPIWindowname
gets/sets the name of the window's browsing context.
... syntax string = window.name; window.name = string; example <script> // open a tab with a specific browsing context name const othertab = window.open("url1", "_blank"); if (othertab) othertab.name = "other-tab"; </script> <a href="url2" target="other-tab">this link will be opened in the other tab.</a> notes the name of the window is used primarily for setting targets for hyperlinks and forms.
Obsolete features - Web APIs
fullscreen always upsets users with large monitor screen or with dual monitor screen.
... mozilla and firefox users can force new windows to always render the personal toolbar/bookmarks toolbar by setting dom.disable_window_open_feature.personalbar to true in about:config or in their user.js file.
Window.opener - Web APIs
WebAPIWindowopener
syntax const openerwindow = window.opener value a window referring to the window that opened the current window (using window.open(), or by a link with target attribute set).
... in modern browsers, a rel="noopener noreferrer" attribute on the originating <a> element will prevent the window.opener reference from being set, in which case this property will return null.
Window: resize event - Web APIs
it is still possible to set onresize attributes or use addeventlistener() to set a handler on any element.
...ght: <span id="height"></span></p> <p>window width: <span id="width"></span></p> const heightoutput = document.queryselector('#height'); const widthoutput = document.queryselector('#width'); function reportwindowsize() { heightoutput.textcontent = window.innerheight; widthoutput.textcontent = window.innerwidth; } window.onresize = reportwindowsize; addeventlistener equivalent you could set up the event handler using the addeventlistener() method: window.addeventlistener('resize', reportwindowsize); specifications specification status document object model (dom) level 3 events specificationthe definition of 'resize' in that specification.
Window.speechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
...ocument.queryselector('input'); var voiceselect = document.queryselector('select'); function populatevoicelist() { voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); ...
Window.status - Web APIs
WebAPIWindowstatus
the status property of the window interface was originally intended to set the text in the status bar at the bottom of the browser window.
... however, the html standard now requires setting window.status to have no effect on the text displayed in the status bar.
Window.window - Web APIs
WebAPIWindowwindow
prefix: settimeout("alert('hi!')", 50); // equivalent to using window.settimeout.
...the default in the class could still be set as the current window object.
WindowOrWorkerGlobalScope.caches - Web APIs
this object enables functionality such as storing assets for offline use, and generating custom responses to requests.
... example the following example shows how you'd use a cache in a service worker context to store assets offline.
WindowOrWorkerGlobalScope.fetch() - Web APIs
init optional an object containing any custom settings that you want to apply to the request.
...note that the origin header is not set on fetch requests with a method of head or get.
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
examples self.queuemicrotask(() => { // function contents here }) taken from the queuemicrotask spec: myelement.prototype.loaddata = function (url) { if (this._cache[url]) { queuemicrotask(() => { this._setdata(this._cache[url]); this.dispatchevent(new event("load")); }); } else { fetch(url).then(res => res.arraybuffer()).then(data => { this._cache[url] = data; this._setdata(data); this.dispatchevent(new event("load")); }); } }; when queuemicrotask() isn't available the code below is basically a monkey-patch for queuemicrotask() for modern engines.
... if (typeof window.queuemicrotask !== "function") { window.queuemicrotask = function (callback) { promise.resolve() .then(callback) .catch(e => settimeout(() => { throw e; })); // report exceptions }; } specifications specification status comment html living standardthe definition of 'self.queuemicrotask()' in that specification.
WritableStream.WritableStream() - Web APIs
this can be used by the developer to control the stream during set up.
... the highwatermark property, which is set when creating the counting strategy (line 35), sets the maximum amount of data that the writablestream instance will handle in a single write() operation.
XDomainRequest.onload - Web APIs
you can find the entire server response in the xdomainrequest.responsetext property.
... syntax xdr.onload = funcref; example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.onprogress - Web APIs
note: while handling this event, you can look at xdomainrequest.responsetext to get the response so far.
... example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onprogress = function(){ //handle partial response with xdr.responsetext } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
by setting the mozbackgroundrequest property of the request object and modifying the example appropriately, you can create your own alert dialog to handle ssl exceptions in your firefox extension or xulrunner application.
...l.queryinterface(ci.nsirequest).status; let errtype; if ((status & 0xff0000) === 0x5a0000) { // security module const nsinsserrorsservice = ci.nsinsserrorsservice; let nsserrorsservice = cc['@mozilla.org/nss_errors_service;1'].getservice(nsinsserrorsservice); let errorclass; // geterrorclass will throw a generic ns_error_failure if the error code is // somehow not in the set of covered errors.
XMLHttpRequest.getAllResponseHeaders() - Web APIs
return value a bytestring representing all of the response's headers (except those whose field name is set-cookie or set-cookie2) separated by crlf, or null if no response has been received.
... an example of what a raw header string looks like: date: fri, 08 dec 2017 21:04:30 gmt\r\n content-encoding: gzip\r\n x-content-type-options: nosniff\r\n server: meinheld/0.6.1\r\n x-frame-options: deny\r\n content-type: text/html; charset=utf-8\r\n connection: keep-alive\r\n strict-transport-security: max-age=63072000\r\n vary: cookie, accept-encoding\r\n content-length: 6502\r\n x-xss-protection: 1; mode=block\r\n each line is terminated by both carriage return and line feed characters (\r\n).
XMLHttpRequest: timeout event - Web APIs
the timeout event is fired when progression is terminated due to preset time expiring.
... bubbles no cancelable no interface progressevent event handler property ontimeout examples const client = new xmlhttprequest(); client.open('get', 'http://www.example.org/example.txt'); client.ontimeout = () => { console.error('timeout!!') }; client.send(); you could also set up the event handler using the addeventlistener() method: client.addeventlistener('timeout', () => { console.error("timeout!!"); }); specifications specification status comment xmlhttprequestthe definition of 'timeout event' in that specification.
XPathResult.iterateNext() - Web APIs
the iteratenext() method of the xpathresult interface iterates over a node set result and returns the next node from it or null if there are no more nodes.
... syntax var node = result.iteratenext(); return value the next node within the node set of the xpathresult.
XRReferenceSpaceEvent() - Web APIs
currently, only the reset event is defined using this type.
...currently, this is always reset.
XRReferenceSpaceEvent - Web APIs
currently, the only event that uses this type is the reset event.
... event types reset the reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibration, or device reset.
XRReferenceSpaceEventInit.referenceSpace - Web APIs
examples this simple snippet calls the constructor to create a new reference space event of type reset.
... let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr device apithe definition of 'xrreferencespaceeventinit.referencespace' in that specification.
XRReferenceSpaceEventInit.transform - Web APIs
examples this simple snippet calls the constructor to create a new reference space event of type reset.
... let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr device apithe definition of 'xrreferencespaceeventinit.transform' in that specification.
XRRenderState.baseLayer - Web APIs
see the examples below to see how to use updaterenderstate() to set the current xrwebgllayer used for rendering the scene.
... examples you can set the xrwebgllayer used for rendering by calling updaterenderstate(), like this: let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); setnewwebgllayer(); function setnewwebgllayer(gl) { if (!gl) { /* webgl not available */ return; } xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl); }); }; here, the canvas obtained in the first line is the canvas into which webgl is going to draw.
XRRigidTransform() - Web APIs
let animationframerequestid = 0; xrsession.requestreferencespace("local-floor") .then((refspace) => { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform(viewerposition, viewerorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); }); after requesting a reference space of type local-floor, the returned promise is eventually resolved, at which time we receive a new reference space object, refspace.
... after creating an xrrigidtransform from the viewer's initial position and orientation, we pass the new transform into getoffsetreferencespace() to create another reference space, now offset so that its origin is located at the same place in space as the coordinates given by viewerposition, with the orientation also revised in the same fashion.
XRRigidTransform.position - Web APIs
nded-floor").then((refspace) => { refspacecreated(refspace); }).catch(() => { session.requestreferencespace("local-floor").then(refspacecreated); }); } else { session.requestreferencespace("viewer").then(refspacecreated); } } function refspacecreated(refspace) { if (immersivesession) { xrreferencespace = refspace; } else { xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform({y: -1.5}); ); } xrsession.requestanimationframe(onframe); } after setting up the graphics context for webxr use, this begins by looking to see if a variable immersivesession is true; if so, we first request a bounded-floor reference space.
...however, for inline sesions, we know we're in a space not automatically adjusted for floor level, so we request an offset reference space to shift the viewer's height to 1.5 meters above the presumed floor level of 0 meters.
XRSession.onsqueeze - Web APIs
the xrsession interface's onsqueeze event handler property can be set to a function which is then invoked to handle the squeeze event that's sent when the user successfully completes a primary squeeze action on a webxr input device.
... xrsession.onsqueeze = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (user.heldobject && targetraypose) { dropobjectusingray(user.heldobject, targetraypose.transform.matrix): } } }; see the examples in the onsqueezestart and onsqueezeend event handlers for the reset of the event handling related to this approach.
XRSession: select event - Web APIs
examples the following example uses addeventlistener() to set up a handler for the select event.
... xrsession.addeventlistener("select", event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose.transform); } } }); you can of course also set up a handler for select events by setting the xrsession object's onselect event handler property to a function that handles the event: xrsession.onselect = event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwit...
XRSession: squeeze event - Web APIs
examples the following example uses addeventlistener() to set up a handler for the squeeze event.
... xrsession.addeventlistener("squeeze", event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandlesqueezewithray(targetraypose.transform); } } }); you can of course also set up a handler for squeeze events by setting the xrsession object's onsqueeze event handler property to a function that handles the event: xrsession.onsqueeze = event => { if (event.inputsource.targetraymode == "tracked-pointer") { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { myhandlesqueez...
XRSession.visibilityState - Web APIs
usage notes it's important to keep in mind that because an immersive webxr session is potentially being shown using a different display than the html document in which it's running (such as when being shown on a headset), the value of a session's visibilitystate may not necessarily be the same as the owning document's visibilitystate.
... for instance, if the viewer is using a headset tethered to a computer and the immersive scene is obscured by a configuration ui, the user could peek out from behind the headset and still be able to see the document itself on their computer's monitor.
XRSession - Web APIs
WebAPIXRSession
cancelanimationframe() removes a callback from the animation frame painting callback from xrsession's set of animation frame rendering callbacks, given the identifying handle returned by a previous call to requestanimationframe().
... example this example establishes a new xrsession in inline mode so that it can be displayed within an html element, avoiding the need for a dedicated ar or vr viewing device such as a headset.
XRSystem: isSessionSupported() - Web APIs
if it is, we set up a button to read "enter xr", to call a method onbuttonclicked(), and enable the button.
... if no session is already underway, we request the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown.
XRViewerPose - Web APIs
this view can represent anything from the point-of-view of a user's xr headset to the viewpoint represented by a player's movement of an avatar using mouse and keyboard, presented on the screen, to a virtual camera capturing the scene for a spectator.
...a typical headset provides a viewer pose with two views whose eye property is either left or right, indicating which eye that view represents.
XRViewport.x - Web APIs
WebAPIXRViewportx
the read-only xrviewport interface's x property indicates the offset from the left edge of the destination surface (typically a xrwebgllayer to the left edge of the viewport within the surface into which webxr content is to be rendered.
... syntax x = xrviewport.x; value the offset from the left edge of the rendering surface to the left edge of the viewport, in pixels.
XRViewport.y - Web APIs
WebAPIXRViewporty
the read-only xrviewport interface's y property indicates the offset from the bottom edge of the destination surface (typically a xrwebgllayer to the bottom edge of the viewport within the surface into which webxr content is to be rendered.
... syntax y = xrviewport.y; value the offset from the bottom edge of the rendering surface to the bottom edge of the viewport, in pixels.
XRWebGLLayerInit.alpha - Web APIs
the alpha property is a boolean value which, if present and set to true in the xrwebgllayerinit dictionary passed into the xrwebgllayer() constructor, specifies that the new layer's color buffer is to include an alpha channel.
... syntax let layerinit = { alpha: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { alpha: boolvalue }); value a boolean which can be set to true to request that the new webgl layer for rendering the webxr scene is to have an alpha channel.
XRWebGLLayerInit.antialias - Web APIs
the boolean antialias property, if present and set to true in the xrwebgllayerinit object provided as the xrwebgllayer() constructor's layerinit parameter, requests that the new webgl rendering layer support anti-aliasing.
... syntax let layerinit = { antialias: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { antialias: boolvalue }); value a boolean value which can be set to true to request anti-aliasing support in the new webgl rendering layer.
XRWebGLLayerInit.depth - Web APIs
syntax let layerinit = { depth: false }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { depth: false }); value a boolean which can be set to false to specify that the new webgl layer should not have a depth buffer.
... usage notes this property differs from ignoredepthvalues in that a layer created with ignoredepthvalues set to true may still have a depth buffer, but will not make use of it.
Generating HTML - Web APIs
the output of the xsl stylesheet is set to html by using the xsl:output element.
... by setting the output to be html and not having a namespace on the resulting elements (colored in blue), those elements will be treated as html elements.
Using the alert role - Accessibility
let myalert = document.createelement("p"); myalert.setattribute("role", "alert"); let myalerttext = document.createtextnode("you must agree with our terms of service to create an account."); myalert.appendchild(myalerttext); document.body.appendchild(myalert); note: the same result can be achieved with less code when using a script library like jquery: $("<p role='alert'>you must agree with our terms of service to create an account.</p>").appendto...
...the pseudo code snippet below illustrates this approach: <p id="forminstruction">you must select at least 3 options</p> // when the user tries to submit the form with less than 3 checkboxes selected: document.getelementbyid("forminstruction").setattribute("role", "alert"); example 4: making an element with an alert role visible if an element already has role="alert" and is initially hidden using css, making it visible will cause the alert to fire as if it was just added to the page.
Using the aria-valuenow attribute - Accessibility
if the current value is not known, the author should not set the aria-valuenow attribute.
... if the aria-valuenow has a known minimum and maximum value, authors should set the aria-valuemin and aria-valuemax attributes.
Using the group role - Accessibility
the group role is used to identify a set of user interface objects which, in contrast with a region, are not intended to be included in a table of contents or a page summary (such as the structures that are dynamically created by a script or assistive technologies); a group should not be considered a major perceivable section on a page.
... assistive technology products should listen for such an event and notify the user accordingly: screen readers should announce the group when focus first lands on a control inside it, and if aria-describedby has been set, the description may be spoken.
Using the progressbar role - Accessibility
if the progressbar is describing the loading progress of a particular region of a page, the author should use aria-describedby to point to the status, and set the aria-busy attribute to true on the region until it is finished loading.
...it is best to set the values for aria-valuemin, aria-valuemax, and aria-valuenow in a manner that is appropriate for this calculation.
Using the slider role - Accessibility
arrow keys should operate as follows (localization for right-to-left languages should reverse the direction of the arrows): key(s) action right and up arrows increase the selected value left and down arrows decrease the selected value page up and page down optionally increase and decrease the value by a set amount (e.g.
... aria-valuenow="2" aria-valuetext="monday"> </div> </div> the code snippet below shows a function that responds to user input and updates the aria-valuenow and aria-valuetext attributes: var daynames = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; var updateslider = function (newvalue) { var handle = document.getelementbyid("day-handle"); handle.setattribute("aria-valuenow", newvalue.tostring()); handle.setattribute("aria-valuetext", daynames[newvalue]); }; working examples: slider example notes aria attributes used aria-valuemin aria-valuemax aria-valuenow aria-valuetext aria-orientation related aria techniques compatibility tbd: add support information for common ua and at product combinations additional res...
ARIA: timer role - Accessibility
set in response to keyboard or other application events that change focus or point of interaction.
... role="timer" aria-live="off">20</div> <button onclick="starttimer('clock')">start</button> /* basic javascript to update a timer */ function starttimer(timername) { // get the number of seconds let timer = document.getelementbyid(timername), seconds = parseint(timer.innertext); // remove a second // updated the content of timer timer.innertext = --seconds // if timer != 0, settimeout if (seconds) { settimeout( function() { starttimer(timername); }, 1000); } } the first time the function executes, the entirety of the string that is added will be announced.
ARIA: checkbox role - Accessibility
instead use the native html checkbox of <input type="checkbox">, which natively provides all the functionality required: <input type="checkbox" id="chk1-label"> <label for="chk1-label">remember my preferences</label> description the native html checkbox form control can only have two checked states ("checked" or "not checked"), with an indeterminate state settable via javascript.
...nkeypress="changecheckbox()">remember my preferences</label> css [role="checkbox"] { padding:5px; } [aria-checked="true"]::before { content: "[x]"; } [aria-checked="false"]::before { content: "[ ]"; } javascript function changecheckbox(event) { let item = document.getelementbyid('chkpref'); switch(item.getattribute('aria-checked')) { case "true": item.setattribute('aria-checked', "false"); break; case "false": item.setattribute('aria-checked', "true"); break; } } accessibility concerns when the checkbox role is added to an element, the user agent should do the following: expose the element as having a checkbox role in the operating system's accessibility api.
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
a classic example we all know from our browser settings is the setting “delete history after x days”.
... if you’re using a screen reader, have you noticed that, when you go to this setting in firefox, it tells you “delete history after 21 days”?, followed by the announcement that you’re in a textbox, and that it contains the number 21.
HTML To MSAA - Accessibility
valid n/a br role_system_ whitespace '\n' (new line char) state_system_ readonly n/a n/a n/a button role_system_ pushbutton from child nodes n/a state_system_ focusable state_system_ default if @type attribute has value "submit" 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, @data attribute n/a state_system_ default if @type attribute has value "submit" n/a "press" n/a input @type=text, textarea role_system_ text n/a value property of input dom element state_system_ readonly if @readonly attribute is used n/a "activate" n/a input @type=password role_system_ text n/a n/a state_system_ readonly if @readonly attribute is used state_system_ protected n/a "activate" n/a input type="checkbox" role_system_ checkbutton n/a n/a state_system_ marqueed used as state checkable state_system_ mixed for html 5 if intermediate p...
Understanding the Web Content Accessibility Guidelines - Accessibility
this set of articles provides quick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility guidelines 2.0 or 2.1 (or just wcag, for the purposes of this writing).
... the wcag 2.0 and 2.1 provide a detailed set of guidelines for making web content more accessible to people with a wide variety of disabilities.
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
note: even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon.
...screte formal syntax <integer> examples html <img src='/broken/image/link.png' alt='broken image link'> css img { -moz-force-broken-image-icon: 1; height: 100px; width: 100px; } result screenshotlive sample note: unless the image has a specified height and width the broken image icon will not be displayed but the alt attribute will also be hidden if -moz-force-broken-image-icon is set to 1.
-moz-image-region - CSS: Cascading Style Sheets
/* keyword value */ -moz-image-region: auto; /* <shape> value */ -moz-image-region: rect(0, 8px, 4px, 4px); /* global values */ -moz-image-region: inherit; -moz-image-region: initial; -moz-image-region: unset; the syntax is similar to the clip property.
...its parameters define the top, right, bottom, and left offsets of the edges of the image, in this order.
-moz-user-focus - CSS: Cascading Style Sheets
/* keyword values */ -moz-user-focus: normal; -moz-user-focus: ignore; /* global values */ -moz-user-focus: inherit; -moz-user-focus: initial; -moz-user-focus: unset; by setting its value to ignore, you can disable focusing the element, which means that the user will not be able to activate the element.
...you can stop the textbox from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of mousedown events.
-moz-user-input - CSS: Cascading Style Sheets
/* keyword values */ -moz-user-input: none; -moz-user-input: enabled; -moz-user-input: disabled; /* global values */ -moz-user-input: inherit; -moz-user-input: initial; -moz-user-input: unset; for elements that normally take user input, such as a <textarea>, the initial value of -moz-user-input is enabled.
...however, this is not the same as setting disabled to true, in that the element is drawn normally.
-webkit-border-before - CSS: Cascading Style Sheets
the -webkit-border-before css property is a shorthand property for setting the individual logical block start border property values in a single place in the style sheet.
... /* border values */ -webkit-border-before: 1px; -webkit-border-before: 2px dotted; -webkit-border-before: medium dashed blue; /* global values */ -webkit-border-before: inherit; -webkit-border-before: initial; -webkit-border-before: unset; -webkit-border-before can be used to set the values for one or more of: -webkit-border-before-width, -webkit-border-before-style, and -webkit-border-before-color.
-webkit-mask-position-x - CSS: Cascading Style Sheets
the -webkit-mask-position-x css property sets the initial horizontal position of a mask image.
...nter; -webkit-mask-position-x: right; /* <percentage> values */ -webkit-mask-position-x: 100%; -webkit-mask-position-x: -50%; /* <length> values */ -webkit-mask-position-x: 50px; -webkit-mask-position-x: -1cm; /* multiple values values */ -webkit-mask-position-x: 50px, 25%, -3em; /* global values */ -webkit-mask-position-x: inherit; -webkit-mask-position-x: initial; -webkit-mask-position-x: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the left edge of the image relative to the box's left padding edge.
-webkit-mask-position-y - CSS: Cascading Style Sheets
the -webkit-mask-position-y css property sets the initial vertical position of a mask image.
...ter; -webkit-mask-position-y: bottom; /* <percentage> values */ -webkit-mask-position-y: 100%; -webkit-mask-position-y: -50%; /* <length> values */ -webkit-mask-position-y: 50px; -webkit-mask-position-y: -1cm; /* multiple values values */ -webkit-mask-position-y: 50px, 25%, -3em; /* global values */ -webkit-mask-position-y: inherit; -webkit-mask-position-y: initial; -webkit-mask-position-y: unset; initial value0%applies toall elementsinheritednopercentagesrefer to the size of the box itselfcomputed valuefor <length> the absolute value, otherwise a percentageanimation typediscrete syntax values <length-percentage> a length indicating the position of the top side of the image relative to the box's top padding edge.
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
the -webkit-mask-repeat-y property sets whether and how a mask image is repeated (tiled) vertically.
... /* keyword values */ -webkit-mask-repeat-y: repeat; -webkit-mask-repeat-y: no-repeat; -webkit-mask-repeat-y: space; -webkit-mask-repeat-y: round; /* multiple values */ -webkit-mask-repeat-y: repeat, no-repeat, space; /* global values */ -webkit-mask-repeat-y: inherit; -webkit-mask-repeat-y: initial; -webkit-mask-repeat-y: unset; syntax values repeat the mask image is repeated vertically.
-webkit-text-fill-color - CSS: Cascading Style Sheets
if this property is not set, the value of the color property is used.
... /* <color> values */ -webkit-text-fill-color: red; -webkit-text-fill-color: #000000; -webkit-text-fill-color: rgb(100, 200, 0); /* global values */ -webkit-text-fill-color: inherit; -webkit-text-fill-color: initial; -webkit-text-fill-color: unset; syntax values <color> the foreground fill color of the element's text content.
-webkit-text-stroke-color - CSS: Cascading Style Sheets
if this property is not set, the value of the color property is used.
... /* <color> values */ -webkit-text-stroke-color: red; -webkit-text-stroke-color: #e08ab4; -webkit-text-stroke-color: rgb(200, 100, 0); /* global values */ -webkit-text-stroke-color: inherit; -webkit-text-stroke-color: initial; -webkit-text-stroke-color: unset; syntax values <color> the color of the stroke.
::-moz-focus-inner - CSS: Cascading Style Sheets
the ::-moz-focus-inner css pseudo-element is a mozilla extension that represents an inner focus ring of the <button> element as well as the button, submit, reset, and color types of the <input> element.
... examples html <input type="submit" value="input"/> <button type="submit">button</button> css button::-moz-focus-inner, input[type="color"]::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner { padding-block-start: 0px; padding-inline-end: 2px; padding-block-end: 0px; padding-inline-start: 2px; border: 1px dotted red; } result specifications not part of any standard.
::cue - CSS: Cascading Style Sheets
WebCSS::cue
::cue { color: yellow; font-weight: bold; } the properties are applied to the entire set of cues as if they were a single unit.
...ly font-size font-stretch font-style font-variant font-weight line-height opacity outline outline-color outline-style outline-width ruby-position text-combine-upright text-decoration text-decoration-color text-decoration-line text-decoration-style text-decoration-thickness text-shadow visibility white-space examples styling webvtt cues as white-on-black the following css sets the cue style so that the text is white and the background is a translucent black box.
::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-stret...
... generalizes allowed properties to typesetting, text decoration, and inline layout properties and opacity.
::slotted() - CSS: Cascading Style Sheets
WebCSS::slotted
50edge full support 79firefox full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...roid full support 50firefox android full support 63 full support 63 no support 59 — 63disabled disabled from version 59 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
:disabled - CSS: Cascading Style Sheets
WebCSS:disabled
html <form action="#"> <fieldset id="shipping"> <legend>shipping address</legend> <input type="text" placeholder="name"> <input type="text" placeholder="address"> <input type="text" placeholder="zip code"> </fieldset> <br> <fieldset id="billing"> <legend>billing address</legend> <label for="billing-checkbox">same as shipping address:</label> <input type="checkbox" id="billing-checkbox" checked> ...
... <br> <input type="text" placeholder="name" disabled> <input type="text" placeholder="address" disabled> <input type="text" placeholder="zip code" disabled> </fieldset> </form> css input[type="text"]:disabled { background: #ccc; } javascript // wait for the page to finish loading document.addeventlistener('domcontentloaded', function () { // attach `change` event listener to checkbox document.getelementbyid('billing-checkbox').onchange = togglebilling; }, false); function togglebilling() { // select the billing text fields var billingitems = document.queryselectorall('#billing input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result ...
:host - CSS: Cascading Style Sheets
WebCSS:host
54edge full support 79firefox full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
...roid full support 54firefox android full support 63 full support 63 no support 61 — 63disabled disabled from version 61 until version 63 (exclusive): this feature is behind the dom.webcomponents.shadowdom.enabled preference (needs to be set to true).
:indeterminate - CSS: Cascading Style Sheets
the :indeterminate css pseudo-class represents any form element whose state is indeterminate, such as checkboxes which have their html indeterminate attribute set to true, radio buttons which are members of a group in which all radio buttons are unchecked, and indeterminate <progress> elements.
... /* selects any <input> whose state is indeterminate */ input:indeterminate { background: lime; } elements targeted by this selector are: <input type="checkbox"> elements whose indeterminate property is set to true by javascript <input type="radio"> elements, when all radio buttons with the same name value in the form are unchecked <progress> elements in an indeterminate state syntax :indeterminate examples checkbox & radio button this example applies special styles to the labels associated with indeterminate form fields.
:visited - CSS: Cascading Style Sheets
WebCSS:visited
the alpha component of the element's non-:visited state will be used instead, except when that component is 0, in which case the style set in :visited will be ignored entirely.
...of the properties that can be set with this pseudo-class, your browser probably has a default value for color and column-rule-color only.
unicode-range - CSS: Cascading Style Sheets
the unicode-range css descriptor sets the specific range of characters to be used from a font defined by @font-face and made available for use on the current page.
...we could also have done this by wrapping the ampersand in a <span> and applying a different font just to that, but that is an extra element and rule set.
max-height - CSS: Cascading Style Sheets
the height will initially be set as close as possible to the initial viewport height considering the maximum height constraint.
...al definition related at-rule@viewportinitial valueautopercentagesrefer to the height of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport max height in pixels @viewport { max-height: 600px; } specifications specification status comment css device adaptationthe definition of '"max-height" descriptor' in that specification.
max-width - CSS: Cascading Style Sheets
by default, the width is set as close as possible to the initial viewport considering the maximum width constraint.
...al definition related at-rule@viewportinitial valueautopercentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport max width in pixels @viewport { max-width: 600px; } specifications specification status comment css device adaptationthe definition of '"max-width" descriptor' in that specification.
min-height - CSS: Cascading Style Sheets
the height will initially be set as close as possible to the initial viewport height considering the minimum height constraint.
...al definition related at-rule@viewportinitial valueautopercentagesrefer to the height of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport min height in pixels @viewport { min-height: 200px; } specifications specification status comment css device adaptationthe definition of '"min-height" descriptor' in that specification.
min-width - CSS: Cascading Style Sheets
by default, min-width is set as close as possible to the initial viewport considering the minimum width constraint.
...mal definition related at-rule@viewportinitial valueautopercentagesrefer to the width of the initial viewportcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, auto formal syntax <viewport-length>where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting viewport min width in pixels @viewport { min-width: 200px; } specifications specification status comment css device adaptationthe definition of '"min-width" descriptor' in that specification.
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.
... formal definition related at-rule@viewportinitial valueautopercentagesrefer to the size of bounding boxcomputed valueas specified formal syntax auto | portrait | landscape examples setting viewport orientation @viewport { orientation: landscape; } specifications specification status comment css device adaptationthe definition of '"orientation" descriptor' in that specification.
viewport-fit - CSS: Cascading Style Sheets
it is highly recommended to make use of the safe area inset variables to ensure that important content doesn't end up outside the display.
... accessibility concerns when using the viewport-fit descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
there's no magic resetanimation() method on elements, and you can't even just set the element's animation-play-state to "running" again.
... here's what happens when the play() function gets called: the box's list of css classes is reset to simply "box".
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
background-attachment background-clip background-color background-image background-origin background-position background-position-x background-position-y background-repeat background-size border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width box-shadow ...
...tools using multiple backgrounds explains how to set one or more backgrounds on an element.
Handling Overflow in Multicol - CSS: Cascading Style Sheets
if you want an image to size down to fit the column box, the standard responsive images solution of setting max-width: 100% will achieve that for you.
... in a future version of the specification it would be useful to be able to have overflow columns in continuous media display in the block direction, therefore allowing the reader to scroll down to view the next set of columns.
Styling Columns - CSS: Cascading Style Sheets
if you use the keyword value “normal” the gap will be set to 1em.
...in the example below, the column-gap is set to 40px.
CSS Flexible Box Layout - CSS: Cascading Style Sheets
basic example in the following example a container has been set to display: flex, which means that the three child items become flex items.
... the value of justify-content has been set to space-between in order to space the items out evenly on the main axis.
Block and inline layout in normal flow - CSS: Cascading Style Sheets
if we set margins on the paragraph element to 0 then the borders will touch.
...if you did want all <strong> elements to display as block elements, you could do so by setting display: block on <strong>.
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
if you want to change your page, or part of your page, to vertical-lr then you can set writing-mode: vertical-lr on the element and this will change the direction of the blocks and therefore the inline direction as well.
...this can be used to properly typeset vertical languages or for creative reasons.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
in this example i have used grid to lay out a set of boxes that contain links.
...an example would be where some content was semantically marked up as a list but you decide to use a set of <div> elements instead as then you can have the element to be a direct child of a container set to display: grid.
CSS Logical Properties and Values - CSS: Cascading Style Sheets
keyword) margin-block margin-block-end margin-block-start margin-inline margin-inline-end margin-inline-start padding (logical keyword) padding-block padding-block-end padding-block-start padding-inline padding-inline-end padding-inline-start properties for floating and positioning clear (inline-end and inline-start keywords) float (inline-end and inline-start keywords) inset inset-block inset-block-end inset-block-start inset-inline inset-inline-end inset-inline-start other properties caption-side (inline-end and inline-start keywords) overflow-block overflow-inline overscroll-behavior-block overscroll-behavior-inline resize (block and inline keywords) text-align (end and start keywords) deprecated properties offset-block-end (now inset-...
...block-end ) offset-block-start (now inset-block-start ) offset-inline-end (now inset-inline-end ) offset-inline-start (now inset-inline-start ) guides basic concepts of logical properties and values logical properties for sizing logical properties for margins, borders and padding logical properties for floating and positioning specifications specification status comment css logical properties and values level 1 editor's draft initial definition.
Stacking context example 3 - CSS: Cascading Style Sheets
example source code <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html> <head><style type="text/css"> div { font: 12px arial; } span.bold { font-weight: bold; } div.lev1 { width: 250px; height: 70px; position: relative; border: 2px outset #669966; background-color: #ccffcc; padding-left: 5px; } #container1 { z-index: 1; position: absolute; top: 30px; left: 75px; } div.lev2 { opacity: 0.9; width: 200px; height: 60px; position: relative; border: 2px outset #990000; background-color: #ffdddd; padding-left: 5px; } #container2 { z-index: 1; position: absolute; top: 20px; left: 110px...
...; } div.lev3 { z-index: 10; width: 100px; position: relative; border: 2px outset #000099; background-color: #ddddff; padding-left: 5px; } </style></head> <body> <br /> <div class="lev1"> <span class="bold">level #1</span> <div id="container1"> <div class="lev2"> <br /><span class="bold">level #2</span> <br />z-index: 1; <div id="container2"> <div class="lev3"><span class="bold">level #3</span></div> <div class="lev3"><span class="bold">level #3</span></div> <div class="lev3"><span class="bold">level #3</span></div> <div class="lev3"><span class="bold">level #3</span></div> <div class="lev3"><span class="bold">level #3</span></div> <div class="lev3"><span class="bold...
CSS selectors - CSS: Cascading Style Sheets
css selectors define the elements to which a set of css rules apply.
... syntax: [attr] [attr=value] [attr~=value] [attr|=value] [attr^=value] [attr$=value] [attr*=value] example: [autoplay] will match all elements that have the autoplay attribute set (to any value).
Layout and the containing block - CSS: Cascading Style Sheets
percentage values that are applied to the width, height, padding, margin, and offset properties of an absolutely positioned element (i.e., which has its position set to absolute or fixed) are computed from the element's containing block.
...the properties that work this way are box model properties and offset properties: the height, top, and bottom properties compute percentage values from the height of the containing block.
Inline formatting context - CSS: Cascading Style Sheets
therefore a paragraph is a set of inline line boxes, stacked in the block direction.
...in the next example there is a (<span>) element wrapping a set of words wrapping onto two lines.
Card - CSS: Cascading Style Sheets
when setting up the single column grid i use the following: .card { display: grid; grid-template-rows: max-content 200px 1fr; } the heading track is set to max-content, which prevents it from stretching.
...i then set the next track — which is where the content lives — to 1fr.
Grid wrapper - CSS: Cascading Style Sheets
for the central columns with a maximum width we can set a minimum value of 0 or greater and a maximum value that specifies the maximum size the column tracks will grow to.
... 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 code goes here */ max-width: none; margin: 0; } } to “break out” ...
Testing media queries programmatically - CSS: Cascading Style Sheets
for example, to set up a query list that determines if the device is in landscape or portrait orientation: const mediaquerylist = window.matchmedia("(orientation: portrait)"); checking the result of a query once you've created your media query list, you can check the result of the query by looking at the value of its matches property: if (mediaquerylist.matches) { /* the viewport is currently in portrait orie...
...they no longer use the unusual mediaquerylistlistener mechanism, but a standard event listener setup, passing an event object of type mediaquerylistevent as the argument to the callback function.
Specificity - CSS: Cascading Style Sheets
#myid#myid span { color: yellow; } .myclass.myclass span { color: orange; } how !important can be used: a) overriding inline styles your global css file that sets visual aspects of your site globally may be overwritten by inline styles defined directly on individual elements.
... in this case, you could set certain styles in your global css file as !important, thus overriding inline styles set directly on elements.
Cubic Bezier Generator - CSS: Cascading Style Sheets
ius, 0, 2 * math.pi); ctx.fill(); ctx.stroke(); ctx.closepath(); } else { alert('you need safari or firefox 1.5+ to see this demo.'); } } function mousedown(e) { var canvas = document.getelementbyid('bezier'); var x1 = cx(document.getelementbyid('x1').value); var y1 = cy(document.getelementbyid('y1').value); var x = e.pagex - canvas.offsetleft; var y = e.pagey - canvas.offsettop; var output = document.getelementbyid('output'); output.value = "(" + x + "," + y + ") should be (" + x1 + "," + y1 + ")"; if ((x1 + radius >= x) && (x1 - radius <= x) && (y1 + radius >= y) && (y1 - radius <= y)) { var output = document.getelementbyid('output'); output.value = "p1!"; dragsm = 1; } var x2 =...
... // if we are starting a drag if (dragsm != 0) { canvas.onmousemove = mousemove; } } function mouseup(e) { var output = document.getelementbyid('output'); output.value = "mouse up!"; dragsm = 0; canvas.onmousemove = null; } function mousemove(e) { if (dragsm != 0) { var canvas = document.getelementbyid('bezier'); var x = e.pagex - canvas.offsetleft; var y = e.pagey - canvas.offsettop; var output = document.getelementbyid('output'); output.value = "drag!"; if (dragsm == 1) { var x1 = document.getelementbyid('x1'); var y1 = document.getelementbyid('y1'); x1.value = reversex(x); x1.value = math.round(x1.value * 10000) / 10000; y1.value = reversey(...
CSS Tutorials - CSS: Cascading Style Sheets
WebCSSTutorials
using multiple backgrounds backgrounds are fundamental for nice styling: css allows you to set several of them on each box.
...learn to use counter-reset, counter-increment, counters(), and counter().
align-items - CSS: Cascading Style Sheets
the css align-items property sets the align-self value on all direct children as a group.
...-start; /* pack flex items from the start */ align-items: flex-end; /* pack flex items from the end */ /* baseline alignment */ align-items: baseline; align-items: first baseline; align-items: last baseline; /* overflow alignment (for positional alignment only) */ align-items: safe center; align-items: unsafe center; /* global values */ align-items: inherit; align-items: initial; align-items: unset; values normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
align-self - CSS: Cascading Style Sheets
start */ align-self: flex-end; /* put the flex item at the end */ /* baseline alignment */ align-self: baseline; align-self: first baseline; align-self: last baseline; align-self: stretch; /* stretch 'auto'-sized items to fit the container */ /* overflow alignment */ align-self: safe center; align-self: unsafe center; /* global values */ align-self: inherit; align-self: initial; align-self: unset; values auto computes to the parent's align-items value.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
backface-visibility - CSS: Cascading Style Sheets
the backface-visibility css property sets whether the back face of an element is visible when turned towards the user.
...(this property has no effect on 2d transforms, which have no perspective.) syntax /* keyword values */ backface-visibility: visible; backface-visibility: hidden; /* global values */ backface-visibility: inherit; backface-visibility: initial; backface-visibility: unset; the backface-visibility property is specified as one of the keywords listed below.
background-attachment - CSS: Cascading Style Sheets
the background-attachment css property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.
... syntax /* keyword values */ background-attachment: scroll; background-attachment: fixed; background-attachment: local; /* global values */ background-attachment: inherit; background-attachment: initial; background-attachment: unset; the background-attachment property is specified as one of the keyword values from the list below.
background-blend-mode - CSS: Cascading Style Sheets
the background-blend-mode css property sets how an element's background images should blend with each other and with the element's background color.
... syntax /* one value */ background-blend-mode: normal; /* two values, one per background */ background-blend-mode: darken, luminosity; /* global values */ background-blend-mode: initial; background-blend-mode: inherit; background-blend-mode: unset; values <blend-mode> the blending mode to be applied.
background-clip - CSS: Cascading Style Sheets
the background-clip css property sets whether an element's background extends underneath its border box, padding box, or content box.
... syntax /* keyword values */ background-clip: border-box; background-clip: padding-box; background-clip: content-box; background-clip: text; /* global values */ background-clip: inherit; background-clip: initial; background-clip: unset; values border-box the background extends to the outside edge of the border (but underneath the border in z-ordering).
background-color - CSS: Cascading Style Sheets
the background-color css property sets the background color of an element.
...kground-color: rgba(117, 190, 218, 0.5); /* 50% transparent */ /* hsl value */ background-color: hsl(50, 33%, 25%); /* fully opaque */ background-color: hsla(50, 33%, 25%, 0.75); /* 75% transparent */ /* special keyword values */ background-color: currentcolor; background-color: transparent; /* global values */ background-color: inherit; background-color: initial; background-color: unset; the background-color property is specified as a single <color> value.
border-block-end - CSS: Cascading Style Sheets
the border-block-end css property is a shorthand property for setting the individual logical block-end border property values in a single place in the style sheet.
... constituent properties this property is a shorthand for the following css properties: border-block-end-color border-block-end-style border-block-end-width syntax border-block-end: 1px; border-block-end: 2px dotted; border-block-end: medium dashed blue; border-block-end can be used to set the values for one or more of border-block-end-width, border-block-end-style, and border-block-end-color.
border-block-start - CSS: Cascading Style Sheets
the border-block-start css property is a shorthand property for setting the individual logical block-start border property values in a single place in the style sheet.
... constituent properties this property is a shorthand for the following css properties: border-block-start-color border-block-start-style border-block-start-width syntax border-block-start: 1px; border-block-start: 2px dotted; border-block-start: medium dashed blue; border-block-start can be used to set the values for one or more of border-block-start-width, border-block-start-style, and border-block-start-color.
border-bottom-width - CSS: Cascading Style Sheets
the border-bottom-width css property sets the width of the bottom border of an element.
... syntax /* keyword values */ border-bottom-width: thin; border-bottom-width: medium; border-bottom-width: thick; /* <length> values */ border-bottom-width: 10em; border-bottom-width: 3vmax; border-bottom-width: 6px; /* global keywords */ border-bottom-width: inherit; border-bottom-width: initial; border-bottom-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword.
border-inline - CSS: Cascading Style Sheets
the border-inline css property is a shorthand property for setting the individual logical inline border property values in a single place in the style sheet.
... the borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end.
border-left-width - CSS: Cascading Style Sheets
the border-left-width css property sets the width of the left border of an element.
... syntax /* keyword values */ border-left-width: thin; border-left-width: medium; border-left-width: thick; /* <length> values */ border-left-width: 10em; border-left-width: 3vmax; border-left-width: 6px; /* global keywords */ border-left-width: inherit; border-left-width: initial; border-left-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword.
border-right-width - CSS: Cascading Style Sheets
the border-right-width css property sets the width of the right border of an element.
... syntax /* keyword values */ border-right-width: thin; border-right-width: medium; border-right-width: thick; /* <length> values */ border-right-width: 10em; border-right-width: 3vmax; border-right-width: 6px; /* global keywords */ border-right-width: inherit; border-right-width: initial; border-right-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword.
border-top-width - CSS: Cascading Style Sheets
the border-top-width css property sets the width of the top border of an element.
... syntax /* keyword values */ border-top-width: thin; border-top-width: medium; border-top-width: thick; /* <length> values */ border-top-width: 10em; border-top-width: 3vmax; border-top-width: 6px; /* global keywords */ border-top-width: inherit; border-top-width: initial; border-top-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword.
border-width - CSS: Cascading Style Sheets
the border-width shorthand css property sets the width of an element's border.
...ues */ border-width: thin; border-width: medium; border-width: thick; /* <length> values */ border-width: 4px; border-width: 1.2rem; /* vertical | horizontal */ border-width: 2px 1.5em; /* top | horizontal | bottom */ border-width: 1px 2em 1.5cm; /* top | right | bottom | left */ border-width: 1px 2em 0 4rem; /* global keywords */ border-width: inherit; border-width: initial; border-width: unset; the border-width property may be specified using one, two, three, or four values.
box-pack - CSS: Cascading Style Sheets
WebCSSbox-pack
/* keyword values */ box-pack: start; box-pack: center; box-pack: end; box-pack: justify; /* global values */ box-pack: inherit; box-pack: initial; box-pack: unset; the direction of layout depends on the element's orientation: horizontal or vertical.
... if the packing is set using the element's pack attribute, then the style is ignored.
caption-side - CSS: Cascading Style Sheets
syntax /* directional values */ caption-side: top; caption-side: bottom; /* warning: non-standard values */ caption-side: left; caption-side: right; caption-side: top-outside; caption-side: bottom-outside; /* global values */ caption-side: inherit; caption-side: initial; caption-side: unset; the caption-side property is specified as one of the keyword values listed below.
... formal definition initial valuetopapplies totable-caption elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax top | bottom | block-start | block-end | inline-start | inline-end examples setting captions above and below html <table class="top"> <caption>caption above the table</caption> <tr> <td>some data</td> <td>some more data</td> </tr> </table> <br> <table class="bottom"> <caption>caption below the table</caption> <tr> <td>some data</td> <td>some more data</td> </tr> </table> css .top caption { caption-side: top; } .bottom caption { caption...
caret-color - CSS: Cascading Style Sheets
the caret-color css property sets the color of the insertion caret, the visible marker where the next character typed will be inserted.
...)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples setting a custom caret color html <input value="this field uses a default caret." size="64"/> <input class="custom" value="i have a custom caret color!" size="64"/> <p contenteditable class="custom">this paragraph can be edited, and its caret has a custom color as well!</p> css input { caret-color: auto; display: block; margin-bottom: .5em; } input.custom { caret-color: red; } p.cus...
clear - CSS: Cascading Style Sheets
WebCSSclear
the clear css property sets whether an element must be moved below (cleared) floating elements that precede it.
... #container::after { content: ""; display: block; clear: both; } syntax /* keyword values */ clear: none; clear: left; clear: right; clear: both; clear: inline-start; clear: inline-end; /* global values */ clear: inherit; clear: initial; clear: unset; values none is a keyword indicating that the element is not moved down to clear past floating elements.
clip - CSS: Cascading Style Sheets
WebCSSclip
/* keyword value */ clip: auto; /* <shape> values */ clip: rect(1px 10em 3rem 2ch); clip: rect(1px, 10em, 3rem, 2ch); /* global values */ clip: inherit; clip: initial; clip: unset; syntax note: where possible, authors are encouraged to use the newer clip-path property instead.
...the <top> and <bottom> values are offsets from the inside top border edge of the box, while <right> and <left> are offsets from the inside left border edge of the box — that is, the extent of the padding box.
column-count - CSS: Cascading Style Sheets
syntax /* keyword value */ column-count: auto; /* <integer> value */ column-count: 3; /* global values */ column-count: inherit; column-count: initial; column-count: unset; values auto the number of columns is determined by other css properties, such as column-width.
...if the column-width is also set to a non-auto value, it merely indicates the maximum allowed number of columns.
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
the column-gap css property sets the size of the gap (gutter) between an element's columns.
... syntax /* keyword value */ column-gap: normal; /* <length> values */ column-gap: 3px; column-gap: 2.5em; /* <percentage> value */ column-gap: 3%; /* global values */ column-gap: inherit; column-gap: initial; column-gap: unset; the column-gap property is specified as one of the values listed below.
column-span - CSS: Cascading Style Sheets
the column-span css property makes it possible for an element to span across all columns when its value is set to all.
... /* keyword values */ column-span: none; column-span: all; /* global values */ column-span: inherit; column-span: initial; column-span: unset; an element that spans more than one column is called a spanning element.
counter-increment - CSS: Cascading Style Sheets
note: the counter's value can be reset to an arbitrary number using the counter-reset css property.
...ncrement: my-counter; /* decrement "my-counter" by 1 */ counter-increment: my-counter -1; /* increment "counter1" by 1, and decrement "counter2" by 4 */ counter-increment: counter1 counter2 -4; /* do not increment/decrement anything: used to override less specific rules */ counter-increment: none; /* global values */ counter-increment: inherit; counter-increment: initial; counter-increment: unset; the counter-increment property is specified as either one of the following: a <custom-ident> naming the counter, followed optionally by an <integer>.
<display-outside> - CSS: Cascading Style Sheets
note: browsers that support the two value syntax, on finding the outer value only, such as when display: block or display: inline is specified, will set the inner value to flow.
... examples in the following example, span elements (normally displayed as inline elements) are set to display: block and so break onto new lines and expand to fill their container in the inline dimension.
element() - CSS: Cascading Style Sheets
WebCSSelement
on gecko browsers, you can use the non-standard document.mozsetimageelement() method to change the element being used as the background for a given css background element.
... see also image() image-set() <image> <gradient> element() cross-fade() document.mozsetimageelement() ...
empty-cells - CSS: Cascading Style Sheets
the empty-cells css property sets whether borders and backgrounds appear around <table> cells that have no visible content.
... syntax /* keyword values */ empty-cells: show; empty-cells: hide; /* global values */ empty-cells: inherit; empty-cells: initial; empty-cells: unset; the empty-cells property is specified as one of the keyword values listed below.
flex-direction - CSS: Cascading Style Sheets
the flex-direction css property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed).
... syntax /* the direction text is laid out in a line */ flex-direction: row; /* like <row>, but reversed */ flex-direction: row-reverse; /* the direction in which lines of text are stacked */ flex-direction: column; /* like <column>, but reversed */ flex-direction: column-reverse; /* global values */ flex-direction: inherit; flex-direction: initial; flex-direction: unset; values the following values are accepted: row the flex container's main-axis is defined to be the same as the text direction.
flex-flow - CSS: Cascading Style Sheets
WebCSSflex-flow
> */ flex-flow: row; flex-flow: row-reverse; flex-flow: column; flex-flow: column-reverse; /* flex-flow: <'flex-wrap'> */ flex-flow: nowrap; flex-flow: wrap; flex-flow: wrap-reverse; /* flex-flow: <'flex-direction'> and <'flex-wrap'> */ flex-flow: row nowrap; flex-flow: column wrap; flex-flow: column-reverse wrap-reverse; /* global values */ flex-flow: inherit; flex-flow: initial; flex-flow: unset; values see flex-direction and flex-wrap for details on the values.
... formal definition initial valueas each of the properties of the shorthand:flex-direction: rowflex-wrap: nowrapapplies toflex containersinheritednocomputed valueas each of the properties of the shorthand:flex-direction: as specifiedflex-wrap: as specifiedanimation typediscrete formal syntax <'flex-direction'> | <'flex-wrap'> examples setting column-reverse and wrap element { /* main-axis is the block direction with reversed main-start and main-end.
font-family - CSS: Cascading Style Sheets
it is often convenient to use the shorthand property font to set font-size and other font related properties all at once.
...mily name only */ font-family: serif; font-family: sans-serif; font-family: monospace; font-family: cursive; font-family: fantasy; font-family: system-ui; font-family: ui-serif; font-family: ui-sans-serif; font-family: ui-monospace; font-family: ui-rounded; font-family: emoji; font-family: math; font-family: fangsong; /* global values */ font-family: inherit; font-family: initial; font-family: unset; the font-family property lists one or more font families, separated by commas.
font-size-adjust - CSS: Cascading Style Sheets
the font-size-adjust css property sets the size of lower-case letters relative to the current font size (which defines the size of upper-case letters).
... /* use the specified font size */ font-size-adjust: none; /* use a font size that makes lowercase letters half the specified font size */ font-size-adjust: 0.5; /* global values */ font-size-adjust: inherit; font-size-adjust: initial; font-size-adjust: unset; the property is useful since the legibility of fonts, especially at small sizes, is determined more by the size of lowercase letters than by the size of capital letters.
font-stretch - CSS: Cascading Style Sheets
-condensed; font-stretch: extra-condensed; font-stretch: condensed; font-stretch: semi-condensed; font-stretch: normal; font-stretch: semi-expanded; font-stretch: expanded; font-stretch: extra-expanded; font-stretch: ultra-expanded; /* percentage values */ font-stretch: 50%; font-stretch: 100%; font-stretch: 200%; /* global values */ font-stretch: inherit; font-stretch: initial; font-stretch: unset; syntax this property may be specified as a single keyword value or a single <percentage> value.
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea font stretch formal syntax <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting font stretch percentages note that this example will only work in browsers that support <percentage> values.
font-variant-ligatures - CSS: Cascading Style Sheets
res; /* <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.
...mon-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]where <common-lig-values> = [ common-ligatures | no-common-ligatures ]<discretionary-lig-values> = [ discretionary-ligatures | no-discretionary-ligatures ]<historical-lig-values> = [ historical-ligatures | no-historical-ligatures ]<contextual-alt-values> = [ contextual | no-contextual ] examples setting font ligatures and contextual forms html <link href="//fonts.googleapis.com/css?family=lora" rel="stylesheet"> <p class="normal"> normal<br> if fi ff tf ft jf fj </p> <p class="none"> none<br> if fi ff tf ft jf fj </p> <p class="common-ligatures"> common-ligatures<br> if fi ff tf ft jf fj </p> <p class="no-common-ligatures"> no-common-ligatures<br> if fi ff tf ft jf fj </p> ...
grid-auto-flow - CSS: Cascading Style Sheets
syntax /* keyword values */ grid-auto-flow: row; grid-auto-flow: column; grid-auto-flow: dense; grid-auto-flow: row dense; grid-auto-flow: column dense; /* global values */ grid-auto-flow: inherit; grid-auto-flow: initial; grid-auto-flow: unset; this property may take one of two forms: a single keyword: one of row, column, or dense.
... formal definition initial valuerowapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ row | column ] | dense examples setting grid auto-placement html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> <div id="item4"></div> <div id="item5"></div> </div> <select id="direction" onchange="changegridautoflow()"> <option value="column">column</option> <option value="row">row</option> </select> <input id="dense" type="checkbox" onchange="changegridautoflow()"> <label for=...
grid-column-end - CSS: Cascading Style Sheets
auto; /* <custom-ident> values */ grid-column-end: somegridarea; /* <integer> + <custom-ident> values */ grid-column-end: 2; grid-column-end: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-column-end: span 3; grid-column-end: span somegridarea; grid-column-end: 5 somegridarea span; /* global values */ grid-column-end: inherit; grid-column-end: initial; grid-column-end: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
...] | [ span && [ <integer> | <custom-ident> ] ] examples setting column end for a grid item html <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> <div class="box5">five</div> </div> css .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; } .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1;...
grid-column-start - CSS: Cascading Style Sheets
m-ident> value */ grid-column-start: somegridarea; /* <integer> + <custom-ident> values */ grid-column-start: 2; grid-column-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-column-start: span 3; grid-column-start: span somegridarea; grid-column-start: span somegridarea 5; /* global values */ grid-column-start: inherit; grid-column-start: initial; grid-column-start: unset; this property is specified as a single <grid-line> value.
...] | [ span && [ <integer> | <custom-ident> ] ] examples setting column start for a grid item html <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> <div class="box5">five</div> </div> css .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; } .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: ...
grid-column - CSS: Cascading Style Sheets
the grid-column-start longhand is set to the value before the slash, and the grid-column-end longhand is set to the value after the slash.
...] | [ span && [ <integer> | <custom-ident> ] ] examples setting grid column size and location html <div id="grid"> <div id="item1"></div> <div id="item2"></div> <div id="item3"></div> </div> css #grid { display: grid; height: 100px; grid-template-columns: repeat(6, 1fr); grid-template-rows: 100px; } #item1 { background-color: lime; } #item2 { background-color: yellow; grid-column: 2 / 4; } #item3 { background-color: blue; gr...
grid-row-end - CSS: Cascading Style Sheets
word value */ grid-row-end: auto; /* <custom-ident> values */ grid-row-end: somegridarea; /* <integer> + <custom-ident> values */ grid-row-end: 2; grid-row-end: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-end: span 3; grid-row-end: span somegridarea; grid-row-end: 5 somegridarea span; /* global values */ grid-row-end: inherit; grid-row-end: initial; grid-row-end: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1.
...] | [ span && [ <integer> | <custom-ident> ] ] examples setting row end for a grid item html <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> <div class="box5">five</div> </div> css .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; } .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; ...
grid-row-start - CSS: Cascading Style Sheets
ow-start: auto; /* <custom-ident> values */ grid-row-start: somegridarea; /* <integer> + <custom-ident> values */ grid-row-start: 2; grid-row-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-start: span 3; grid-row-start: span somegridarea; grid-row-start: 5 somegridarea span; /* global values */ grid-row-start: inherit; grid-row-start: initial; grid-row-start: unset; this property is specified as a single <grid-line> value.
...] | [ span && [ <integer> | <custom-ident> ] ] examples setting row start for a grid item html <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> <div class="box5">five</div> </div> css .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; } .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; ...
grid-template-columns - CSS: Cascading Style Sheets
l, 200px) 20%; grid-template-columns: [linename1] 100px [linename2] repeat(auto-fit, [linename3 linename4] 300px) 100px; grid-template-columns: [linename1 linename2] 100px repeat(auto-fit, [linename1] 300px) [linename3]; /* global values */ grid-template-columns: inherit; grid-template-columns: initial; grid-template-columns: unset; values none indicates that there is no explicit grid.
...as a maximum, a <flex> value sets the track’s flex factor.
grid-template-rows - CSS: Cascading Style Sheets
repeat(auto-fill, 200px) 20%; grid-template-rows: [linename1] 100px [linename2] repeat(auto-fit, [linename3 linename4] 300px) 100px; grid-template-rows: [linename1 linename2] 100px repeat(auto-fit, [linename1] 300px) [linename3]; /* global values */ grid-template-rows: inherit; grid-template-rows: initial; grid-template-rows: unset; this property may be specified as: either the keyword value none or a <track-list> value or an <auto-track-list> value.
...as a maximum, a <flex> value sets the track’s flex factor.
hanging-punctuation - CSS: Cascading Style Sheets
s */ hanging-punctuation: first force-end; hanging-punctuation: first allow-end; hanging-punctuation: first last; hanging-punctuation: last force-end; hanging-punctuation: last allow-end; /* three keywords */ hanging-punctuation: first force-end last; hanging-punctuation: first allow-end last; /* global values */ hanging-punctuation: inherit; hanging-punctuation: initial; hanging-punctuation: unset; syntax the hanging-punctuation property may be specified with one, two, or three values.
... formal definition initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and closing quotes to hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit.
hyphens - CSS: Cascading Style Sheets
WebCSShyphens
syntax /* keyword values */ hyphens: none; hyphens: manual; hyphens: auto; /* global values */ hyphens: inherit; hyphens: initial; hyphens: unset; the hyphens property is specified as a single keyword value chosen from the list below.
... note: the auto setting's behavior depends on the language being properly tagged to select the appropriate hyphenation rules.
Inheritance - CSS: Cascading Style Sheets
css properties can be categorized in two types: inherited properties, which by default are set to the computed value of the parent element non-inherited properties, which by default are set to initial value of the property refer to any css property definition to see whether a specific property inherits by default ("inherited: yes") or not ("inherited: no").
... see also css values for controlling inheritance: inherit, initial, unset, and revert introducing the css cascade cascade and inheritance css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the initial, computed, resolved, specified, used, and actual values.
inline-size - CSS: Cascading Style Sheets
syntax /* <length> values */ inline-size: 300px; inline-size: 25em; /* <percentage> values */ inline-size: 75%; /* keyword values */ inline-size: max-content; inline-size: min-content; inline-size: fit-content(20em); inline-size: auto; /* global values */ inline-size: inherit; inline-size: initial; inline-size: unset; if the writing mode is vertically oriented, the value of inline-size relates to the height of the element; otherwise, it relates to the width of the element.
... formal definition initial valueautoapplies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc(); formal syntax <'width'> examples setting inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; inline-size: 110px; } result specifications specification status comment css logical properties and values level 1the definition of 'inline-size' in that specification.
margin-block-end - CSS: Cascading Style Sheets
syntax /* <length> values */ margin-block-end: 10px; /* an absolute length */ margin-block-end: 1em; /* relative to the text size */ margin-block-end: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-block-end: auto; /* global values */ margin-block-end: inherit; margin-block-end: initial; margin-block-end: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting block end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definitio...
margin-block-start - CSS: Cascading Style Sheets
syntax /* <length> values */ margin-block-start: 10px; /* an absolute length */ margin-block-start: 1em; /* relative to the text size */ margin-block-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-block-start: auto; /* global values */ margin-block-start: inherit; margin-block-start: initial; margin-block-start: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting block start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-block-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the defin...
margin-block - CSS: Cascading Style Sheets
/* <length> values */ margin-block: 10px 20px; /* an absolute length */ margin-block: 1em 2em; /* relative to the text size */ margin-block: 5% 2%; /* relative to the nearest block container's width */ margin-block: 10px; /* sets both start and end values */ /* keyword values */ margin-block: auto; /* global values */ margin-block: inherit; margin-block: initial; margin-block: unset; these values corresponds to the margin-top and margin-bottom, or margin-right, and margin-left property depending on the values defined for writing-mode, direction, and text-orientation.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete formal syntax <'margin-left'>{1,2} examples setting block start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1t...
margin-inline-end - CSS: Cascading Style Sheets
syntax /* <length> values */ margin-inline-end: 10px; /* an absolute length */ margin-inline-end: 1em; /* relative to the text size */ margin-inline-end: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-end: auto; /* global values */ margin-inline-end: inherit; margin-inline-end: initial; margin-inline-end: unset; it relates to margin-block-start, margin-block-end, and margin-inline-start, which define the other margins of the element.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting inline end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definit...
margin-inline - CSS: Cascading Style Sheets
/* <length> values */ margin-inline: 10px 20px; /* an absolute length */ margin-inline: 1em 2em; /* relative to the text size */ margin-inline: 5% 2%; /* relative to the nearest block container's width */ margin-inline: 10px; /* sets both start and end values */ /* keyword values */ margin-inline: auto; /* global values */ margin-inline: inherit; margin-inline: initial; margin-inline: unset; this property corresponds to the margin-top and margin-bottom, or margin-right, and margin-left properties, depending on the values defined for writing-mode, direction, and text-orientation.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete formal syntax <'margin-left'>{1,2} examples setting inline start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-inline: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level ...
margin - CSS: Cascading Style Sheets
WebCSSmargin
the margin css property sets the margin area on all four sides of an element.
... syntax /* apply to all four sides */ margin: 1em; margin: -3px; /* vertical | horizontal */ margin: 5% auto; /* top | horizontal | bottom */ margin: 1em auto 2em; /* top | right | bottom | left */ margin: 2px 1em 0 auto; /* global values */ margin: inherit; margin: initial; margin: unset; the margin property may be specified using one, two, three, or four values.
mask-border-repeat - CSS: Cascading Style Sheets
the mask-border-repeat css property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border.
... syntax /* keyword value */ mask-border-repeat: stretch; mask-border-repeat: repeat; mask-border-repeat: round; mask-border-repeat: space; /* vertical | horizontal */ mask-border-repeat: round stretch; /* global values */ mask-border-repeat: inherit; mask-border-repeat: initial; mask-border-repeat: unset; the mask-border-repeat property may be specified using one or two values chosen from the list of values below.
mask-clip - CSS: Cascading Style Sheets
WebCSSmask-clip
sk-clip: stroke-box; mask-clip: view-box; /* keyword values */ mask-clip: no-clip; /* non-standard keyword values */ -webkit-mask-clip: border; -webkit-mask-clip: padding; -webkit-mask-clip: content; -webkit-mask-clip: text; /* multiple values */ mask-clip: padding-box, no-clip; mask-clip: view-box, fill-box, border-box; /* global values */ mask-clip: inherit; mask-clip: initial; mask-clip: unset; syntax one or more of the keyword values listed below, separated by commas.
...if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute.
mask-mode - CSS: Cascading Style Sheets
WebCSSmask-mode
the mask-mode css property sets whether the mask reference defined by mask-image is treated as a luminance or alpha mask.
... /* keyword values */ mask-mode: alpha; mask-mode: luminance; mask-mode: match-source; /* multiple values */ mask-mode: alpha, match-source; /* global values */ mask-mode: inherit; mask-mode: initial; mask-mode: unset; syntax the mask-mode property is specified as one or more of the keyword values listed below, separated by commas.
max-inline-size - CSS: Cascading Style Sheets
syntax /* <length> values */ max-inline-size: 300px; max-inline-size: 25em; /* <percentage> values */ max-inline-size: 75%; /* keyword values */ max-inline-size: auto; max-inline-size: max-content; max-inline-size: min-content; max-inline-size: fit-content(20em); /* global values */ max-inline-size: inherit; max-inline-size: initial; max-inline-size: unset; values the max-inline-size property takes the same values as the max-width and max-height properties.
... formal definition initial value0applies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as max-width and max-heightanimation typea length, percentage or calc(); formal syntax <'max-width'> examples setting max inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; block-size: 100%; max-inline-size: 200px; } result specifications specification status comment css logical properties and values level 1the definition of 'max-inline-size' in that specification.
max() - CSS: Cascading Style Sheets
WebCSSmax
the max() css function lets you set the largest (most positive) value from a list of comma-separated expressions as the value of a css property value.
... formal syntax max( <calc-sum># )where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <dimension> | <percentage> | ( <calc-sum> ) examples setting a minimum size for a font another use case for css functions is allow a font size to grow while ensuring it is at least a mimum size, enabling responsive font sizes while ensuring legibility.
min-block-size - CSS: Cascading Style Sheets
syntax /* <length> values */ min-block-size: 100px; min-block-size: 5em; /* <percentage> values */ min-block-size: 10%; /* keyword values */ min-block-size: max-content; min-block-size: min-content; min-block-size: fit-content(20em); /* global values */ min-block-size: inherit; min-block-size: initial; min-block-size: unset; if the writing mode is vertically oriented, the value of min-block-size relates to the minimum width of the element; otherwise, it relates to the minimum height of the element.
... formal definition initial value0applies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as min-width and min-heightanimation typea length, percentage or calc(); formal syntax <'min-width'> examples setting minimum block size for vertical text html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; min-block-size: 200px; } result specifications specification status comment css logical properties and values level 1the definition of 'min-block-size' in that specification.
min-inline-size - CSS: Cascading Style Sheets
syntax /* <length> values */ min-inline-size: 100px; min-inline-size: 5em; /* <percentage> values */ min-inline-size: 10%; /* keyword values */ min-inline-size: max-content; min-inline-size: min-content; min-inline-size: fit-content(20em); /* global values */ min-inline-size: inherit; min-inline-size: initial; min-inline-size: unset; if the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element.
... formal definition initial value0applies tosame as width and heightinheritednopercentagesinline-size of containing blockcomputed valuesame as min-width and min-heightanimation typea length, percentage or calc(); formal syntax <'min-width'> examples setting minimum inline size for vertical text html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; block-size: 5%; min-inline-size: 200px; } result specifications specification status comment css logical properties and values level 1the definition of 'min-inline-size' in that specification.
object-fit - CSS: Cascading Style Sheets
the object-fit css property sets how the content of a replaced element, such as an <img> or <video>, should be resized to fit its container.
... 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="...
order - CSS: Cascading Style Sheets
WebCSSorder
the order css property sets the order to lay out an item in a flex or grid container.
... syntax /* <integer> values */ order: 5; order: -5; /* global values */ order: inherit; order: initial; order: unset; since order is only meant to affect the visual order of elements and not their logical or tab order.
outline-width - CSS: Cascading Style Sheets
the css outline-width property sets the thickness of an element's outline.
... formal definition initial valuemediumapplies toall elementsinheritednocomputed valuean absolute length; if the keyword none is specified, the computed value is 0animation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples setting an element's outline width html <span id="thin">thin</span> <span id="medium">medium</span> <span id="thick">thick</span> <span id="twopixels">2px</span> <span id="oneex">1ex</span> <span id="em">1.2em</span> css span { outline-style: solid; display: inline-block; margin: 20px; } #thin { outline-width: thin; } #medium { outline-width: medium; } #thick { outline-width: thic...
Guide to scroll anchoring - CSS: Cascading Style Sheets
to opt out the entire document, you can set it on the <body> element: body { overflow-anchor: none; } to opt out a certain part of the document use overflow-anchor: none on its container element: .container { overflow-anchor: none; } note: the specification details that once scroll anchoring has been opted out of, you cannot opt back into it from a child element.
... for example, if you opt out for the entire document, you will not be able to set overflow-anchor: auto elsewhere in the document to turn it back on for a subsection.
overflow-block - CSS: Cascading Style Sheets
the overflow-block css property sets what shows when content overflows the block start and block end edges of a box.
... syntax /* keyword values */ overflow-block: visible; overflow-block: hidden; overflow-block: scroll; overflow-block: auto; /* global values */ overflow-block: inherit; overflow-block: initial; overflow-block: unset; the overflow-block property is specified as a single keyword chosen from the list of values below.
overflow-wrap - CSS: Cascading Style Sheets
the overflow-wrap css property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
... syntax /* keyword values */ overflow-wrap: normal; overflow-wrap: break-word; overflow-wrap: anywhere; /* global values */ overflow-wrap: inherit; overflow-wrap: initial; overflow-wrap: unset; the overflow-wrap property is specified as a single keyword chosen from the list of values below.
overflow-x - CSS: Cascading Style Sheets
the overflow-x css property sets what shows when content overflows a block-level element's left and right edges.
... syntax /* keyword values */ overflow-x: visible; overflow-x: hidden; overflow-x: clip; overflow-x: scroll; overflow-x: auto; /* global values */ overflow-x: inherit; overflow-x: initial; overflow-x: unset; the overflow-x property is specified as a single keyword chosen from the list of values below.
padding-block-end - CSS: Cascading Style Sheets
syntax /* <length> values */ padding-block-end: 10px; /* an absolute length */ padding-block-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-end: inherit; padding-block-end: initial; padding-block-end: unset; values the padding-block-end property takes the same values as the padding-left property.
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block end padding for vertical text html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical proper...
padding-block-start - CSS: Cascading Style Sheets
syntax /* <length> values */ padding-block-start: 10px; /* an absolute length */ padding-block-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-start: inherit; padding-block-start: initial; padding-block-start: unset; values the padding-block-start property takes the same values as the padding-left property.
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and val...
padding-block - CSS: Cascading Style Sheets
/* <length> values */ padding-block: 10px 20px; /* an absolute length */ padding-block: 1em 2em; /* relative to the text size */ padding-block: 10px; /* sets both start and end values */ /* <percentage> values */ padding-block: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-block: inherit; padding-block: initial; padding-block: unset; these values corresponds to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-or...
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting block padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-block: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values lev...
padding-inline-end - CSS: Cascading Style Sheets
syntax /* <length> values */ padding-inline-end: 10px; /* an absolute length */ padding-inline-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-end: inherit; padding-inline-end: initial; padding-inline-end: unset; values the padding-inline-end property takes the same values as the padding-left property.
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline end padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-end: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level ...
padding-inline-start - CSS: Cascading Style Sheets
syntax /* <length> values */ padding-inline-start: 10px; /* an absolute length */ padding-inline-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-start: inherit; padding-inline-start: initial; padding-inline-start: unset; values the padding-inline-start property takes the same values as the padding-left property.
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-start: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values le...
padding-inline - CSS: Cascading Style Sheets
/* <length> values */ padding-inline: 10px 20px; /* an absolute length */ padding-inline: 1em 2em; /* relative to the text size */ padding-inline: 10px; /* sets both start and end values */ /* <percentage> values */ padding-inline: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-inline: inherit; padding-inline: initial; padding-inline: unset; constituent properties this property is a shorthand for the following css properties: padding-inline-end padding-inline-start syntax values the padding-inline pro...
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typediscrete formal syntax <'padding-left'>{1,2} examples setting inline padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-inline: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values l...
page-break-before - CSS: Cascading Style Sheets
/* keyword values */ page-break-before: auto; page-break-before: always; page-break-before: avoid; page-break-before: left; page-break-before: right; page-break-before: recto; page-break-before: verso; /* global values */ page-break-before: inherit; page-break-before: initial; page-break-before: unset; syntax values auto initial value.
...a subset of values should be aliased as follows: page-break-before break-before auto auto left left right right avoid avoid always page formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element.
page-break-inside - CSS: Cascading Style Sheets
/* keyword values */ page-break-inside: auto; page-break-inside: avoid; /* global values */ page-break-inside: inherit; page-break-inside: initial; page-break-inside: unset; syntax values auto initial value.
...a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element.
place-content - CSS: Cascading Style Sheets
ine values */ place-content: baseline center; place-content: first baseline space-evenly; place-content: last baseline right; /* distributed alignment */ place-content: space-between space-evenly; place-content: space-around space-evenly; place-content: space-evenly stretch; place-content: stretch space-evenly; /* global values */ place-content: inherit; place-content: initial; place-content: unset; the first value is the align-content property value, the second the justify-content one.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
place-self - CSS: Cascading Style Sheets
d normal; place-self: self-start auto; place-self: self-end normal; place-self: flex-start auto; place-self: flex-end normal; place-self: left auto; place-self: right normal; /* baseline alignment */ place-self: baseline normal; place-self: first baseline auto; place-self: last baseline normal; place-self: stretch auto; /* global values */ place-self: inherit; place-self: initial; place-self: unset; values auto computes to the parent's align-items value.
... baseline first baseline last baseline specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box’s first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the boxes in its baseline-sharing group.
repeating-conic-gradient() - CSS: Cascading Style Sheets
syntax /* starburst: a a blue on blue starburst: the gradient is a starburst of lighter and darker blue, centered in the upper left quandrant, offset by 3degrees so there is no up/down straight line */ background: repeating-conic-gradient( from 3deg at 25% 25%, hsl(200, 100%, 50%) 0deg 15deg, hsl(200, 100%, 60%) 10deg 30deg); ); values <angle> preceded by the from keyterm, and taking an angle as its value, defines the gradient rotation in clockwise direction.
...its concrete size will match the size of the element it applies to, or the size the <image> is set to if it's set to something other than the element's size.
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
WebCSSrow-gap
the row-gap css property sets the size of the gap (gutter) between an element's grid rows.
... syntax /* <length> values */ row-gap: 20px; row-gap: 1em; row-gap: 3vmin; row-gap: 0.5cm; /* <percentage> value */ row-gap: 10%; /* global values */ row-gap: inherit; row-gap: initial; row-gap: unset; values <length-percentage> is the width of the gutter separating the rows.
scroll-margin-block-end - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-block-end: 10px; scroll-margin-block-end: 1em; /* global values */ scroll-margin-block-end: inherit; scroll-margin-block-end: initial; scroll-margin-block-end: unset; values <length> an outset from the block end edge of the scroll container.
scroll-margin-block-start - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-block-start: 10px; scroll-margin-block-start: 1em; /* global values */ scroll-margin-block-start: inherit; scroll-margin-block-start: initial; scroll-margin-block-start: unset; values <length> an outset from the block start edge of the scroll container.
scroll-margin-bottom - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-bottom: 10px; scroll-margin-bottom: 1em; /* global values */ scroll-margin-bottom: inherit; scroll-margin-bottom: initial; scroll-margin-bottom: unset; values <length> an outset from the bottom edge of the scroll container.
scroll-margin-inline-end - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-inline-end: 10px; scroll-margin-inline-end: 1em; /* global values */ scroll-margin-inline-end: inherit; scroll-margin-inline-end: initial; scroll-margin-inline-end: unset; values <length> an outset from the inline end edge of the scroll container.
scroll-margin-inline-start - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-inline-start: 10px; scroll-margin-inline-start: 1em; /* global values */ scroll-margin-inline-start: inherit; scroll-margin-inline-start: initial; scroll-margin-inline-start: unset; values <length> an outset from the inline start edge of the scroll container.
scroll-margin-left - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-left: 10px; scroll-margin-left: 1em; /* global values */ scroll-margin-left: inherit; scroll-margin-left: initial; scroll-margin-left: unset; values <length> an outset from the left edge of the scroll container.
scroll-margin-right - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-right: 10px; scroll-margin-right: 1em; /* global values */ scroll-margin-right: inherit; scroll-margin-right: initial; scroll-margin-right: unset; values <length> an outset from the right edge of the scroll container.
scroll-margin-top - CSS: Cascading Style Sheets
the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the specified outsets.
... syntax /* <length> values */ scroll-margin-top: 10px; scroll-margin-top: 1em; /* global values */ scroll-margin-top: inherit; scroll-margin-top: initial; scroll-margin-top: unset; values <length> an outset from the top edge of the scroll container.
scroll-snap-destination - CSS: Cascading Style Sheets
/* <position> value */ scroll-snap-destination: 400px 600px; /* global values */ scroll-snap-destination: inherit; scroll-snap-destination: initial; scroll-snap-destination: unset; syntax values <position> specifies the offset of the snap destination from the start edge of the scroll container’s visual viewport.
...| [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]where <length-percentage> = <length> | <percentage> examples setting scroll snap destination html <div id="container"> <div> <p>at coordinate (0, 0)</p> <div class="scrollcontainer destination0"> <div>1</div> <div>2</div> <div>3</div> </div> </div> <div> <p>at coordinate (25, 0)</p> <div class="scrollcontainer destination25"> <div>1</div> <div>2</div> <div>3</div> </div> </div> <div> ...
scroll-snap-points-x - CSS: Cascading Style Sheets
/* keyword value */ scroll-snap-points-x: none; /* repeating snap points */ scroll-snap-points-x: repeat(400px); /* global values */ scroll-snap-points-x: inherit; scroll-snap-points-x: initial; scroll-snap-points-x: unset; syntax values none the scroll container does not define any snap points.
... formal definition initial valuenoneapplies toscroll containersinheritednopercentagesrelative to same axis of the padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting horizontal scroll snap points html <div id="container"> <div>1</div> <div>2</div> <div>3</div> </div> css #container { width: 200px; overflow: auto; white-space: nowrap; scroll-snap-points-x: repeat(100%); scroll-snap-type: mandatory; font-size: 0; } #container > div { width: 200px; height: 200px; display: inline-block; line-height: 200px; text-align: center; ...
scroll-snap-points-y - CSS: Cascading Style Sheets
/* keyword value */ scroll-snap-points-y: none; /* repeated snap points */ scroll-snap-points-y: repeat(400px); /* global values */ scroll-snap-points-y: inherit; scroll-snap-points-y: initial; scroll-snap-points-y: unset; syntax values none the scroll container does not define any snap points.
... formal definition initial valuenoneapplies toscroll containersinheritednopercentagesrelative to same axis of the padding-box of the scroll containercomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax none | repeat( <length-percentage> )where <length-percentage> = <length> | <percentage> examples setting vertical scroll snap points html <div id="container"> <div>1</div> <div>2</div> <div>3</div> </div> css #container { height: 200px; width: 220px; overflow-x: hidden; overflow-y: auto; scroll-snap-points-y: repeat(200px); scroll-snap-type: mandatory; font-size: 0; } #container > div { width: 200px; height: 200px; display: inline-block; line-height: 200px; tex...
scroll-snap-stop - CSS: Cascading Style Sheets
/* keyword values */ scroll-snap-stop: normal; scroll-snap-stop: always; /* global values */ scroll-snap-type: inherit; scroll-snap-type: initial; scroll-snap-type: unset; syntax values normal when the visual viewport of this element's scroll container is scrolled, it may "pass over" possible snap positions.
... css /* setup */ :root, body { height: 100%; display: flex; align-items: center; justify-content: space-between; flex-flow: column nowrap; font-family: monospace; } .container { display: flex; overflow: auto; outline: 1px dashed lightgray; flex: none; } .container.x { width: 100%; height: 128px; flex-flow: row nowrap; } .container.y { width: 256px; height: 256px; flex-flow: ...
shape-image-threshold - CSS: Cascading Style Sheets
the shape-image-threshold css property sets the alpha channel threshold used to extract the shape using an image as the value for shape-outside.
... /* <number> value */ shape-image-threshold: 0.7; /* global values */ shape-image-threshold: inherit; shape-image-threshold: initial; shape-image-threshold: unset; syntax values <alpha-value> sets the threshold used for extracting a shape from an image.
text-align-last - CSS: Cascading Style Sheets
the text-align-last css property sets how the last line of a block or a line, right before a forced line break, is aligned.
... syntax /* keyword values */ text-align-last: auto; text-align-last: start; text-align-last: end; text-align-last: left; text-align-last: right; text-align-last: center; text-align-last: justify; /* global values */ text-align-last: inherit; text-align-last: initial; text-align-last: unset; values auto the affected line is aligned per the value of text-align, unless text-align is justify, in which case the effect is the same as setting text-align-last to start.
text-decoration-color - CSS: Cascading Style Sheets
the text-decoration-color css property sets the color of decorations added to text by text-decoration-line.
... syntax /* <color> values */ text-decoration-color: currentcolor; text-decoration-color: red; text-decoration-color: #00ff00; text-decoration-color: rgba(255, 128, 128, 0.5); text-decoration-color: transparent; /* global values */ text-decoration-color: inherit; text-decoration-color: initial; text-decoration-color: unset; values <color> the color of the line decoration.
text-emphasis - CSS: Cascading Style Sheets
text-emphasis doesn't reset the value of text-emphasis-position.
...it may be computed to or rendered as 'f' only */ /* keywords value */ text-emphasis: filled; text-emphasis: open; text-emphasis: filled sesame; text-emphasis: open sesame; /* keywords value combined with a color */ text-emphasis: filled sesame #555; /* global values */ text-emphasis: inherit; text-emphasis: initial; text-emphasis: unset; values none no emphasis marks.
text-indent - CSS: Cascading Style Sheets
the text-indent css property sets the length of empty space (indentation) that is put before lines of text in a block.
... syntax /* <length> values */ text-indent: 3mm; text-indent: 40px; /* <percentage> value relative to the containing block width */ text-indent: 15%; /* keyword values */ text-indent: 5em each-line; text-indent: 5em hanging; text-indent: 5em hanging each-line; /* global values */ text-indent: inherit; text-indent: initial; text-indent: unset; values <length> indentation is specified as an absolute <length>.
text-orientation - CSS: Cascading Style Sheets
the text-orientation css property sets the orientation of the text characters in a line.
... syntax /* keyword values */ text-orientation: mixed; text-orientation: upright; text-orientation: sideways-right; text-orientation: sideways; text-orientation: use-glyph-orientation; /* global values */ text-orientation: inherit; text-orientation: initial; text-orientation: unset; the text-orientation property is specified as a single keyword from the list below.
text-overflow - CSS: Cascading Style Sheets
the text-overflow css property sets how hidden overflow content is signaled to users.
...to make text overflow its container you have to set other css properties: overflow and white-space.
text-size-adjust - CSS: Cascading Style Sheets
/* keyword values */ text-size-adjust: none; text-size-adjust: auto; /* <percentage> value */ text-size-adjust: 80%; /* global values */ text-size-adjust: inherit; text-size-adjust: initial; text-size-adjust: unset; because many websites have not been developed with small devices in mind, mobile browsers differ from desktop browsers in the way they render web pages.
...this value is used to cancel a none value previously set with css.
text-transform - CSS: Cascading Style Sheets
syntax /* keyword values */ text-transform: none; text-transform: capitalize; text-transform: uppercase; text-transform: lowercase; text-transform: full-width; text-transform: full-size-kana; /* global values */ text-transform: inherit; text-transform: initial; text-transform: unset; capitalize is a keyword that converts the first letter of each word to uppercase.
... accessibility concerns large sections of text set with a text-transform value of uppercase may be difficult for people with cognitive concerns such as dyslexia to read.
touch-action - CSS: Cascading Style Sheets
the touch-action css property sets how an element's region can be manipulated by a touchscreen user (for example, by zooming features built into the browser).
... /* keyword values */ touch-action: auto; touch-action: none; touch-action: pan-x; touch-action: pan-left; touch-action: pan-right; touch-action: pan-y; touch-action: pan-up; touch-action: pan-down; touch-action: pinch-zoom; touch-action: manipulation; /* global values */ touch-action: inherit; touch-action: initial; touch-action: unset; by default, panning (scrolling) and pinching gestures are handled exclusively by the browser.
transform-box - CSS: Cascading Style Sheets
/* keyword values */ transform-box: content-box; transform-box: border-box; transform-box: fill-box; transform-box: stroke-box; transform-box: view-box; /* global values */ transform-box: inherit; transform-box: initial; transform-box: unset; syntax the transform-box property is specified as one of the keyword values listed below.
...if a viewbox attribute is specified for the svg viewport creating element, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute, and the dimension of the reference box is set to the width and height values of the viewbox attribute.
translateZ() - CSS: Cascading Style Sheets
in the above interactive examples, perspective: 550px; (to create a 3d space) and transform-style: preserve-3d; (so the children, the 6 sides of the cube, are also positioned in the 3d space), have been set on the cube.
...this has the effect of making the element appear larger when viewed on a 2d display, or closer when viewed using a vr headset or other 3d display device.
<transform-function> - CSS: Cascading Style Sheets
perspective perspective() sets the distance between the user and the z=0 plane.
...otatex(-90deg) translatez(50px); } .select-form { margin-top: 50px; } javascript const selectelem = document.queryselector('select'); const example = document.queryselector('#example-element'); selectelem.addeventlistener('change', () => { if(selectelem.value === 'choose a function') { return; } else { example.style.transform = `rotate3d(1, 1, 1, 30deg) ${selectelem.value}`; settimeout(function() { example.style.transform = 'rotate3d(1, 1, 1, 30deg)'; }, 2000) } }) result specifications specification status comment css transforms level 2the definition of '<transform-function>' in that specification.
transition - CSS: Cascading Style Sheets
different states may be defined using pseudo-classes like :hover or :active or dynamically set using javascript.
...erty name | duration | timing function */ transition: margin-right 4s ease-in-out; /* property name | duration | timing function | delay */ transition: margin-right 4s ease-in-out 1s; /* apply to 2 properties */ transition: margin-right 4s, color 1s; /* apply to all changed properties */ transition: all 0.5s ease-out; /* global values */ transition: inherit; transition: initial; transition: unset; the transition property is specified as one or more single-property transitions, separated by commas.
vertical-align - CSS: Cascading Style Sheets
the vertical-align css property sets vertical alignment of an inline, inline-block or table-cell box.
...*/ vertical-align: baseline; vertical-align: sub; vertical-align: super; vertical-align: text-top; vertical-align: text-bottom; vertical-align: middle; vertical-align: top; vertical-align: bottom; /* <length> values */ vertical-align: 10em; vertical-align: 4px; /* <percentage> values */ vertical-align: 20%; /* global values */ vertical-align: inherit; vertical-align: initial; vertical-align: unset; the vertical-align property is specified as one of the values listed below.
widows - CSS: Cascading Style Sheets
WebCSSwidows
the widows css property sets the minimum number of lines in a block container that must be shown at the top of a page, region, or column.
... /* <integer> values */ widows: 2; widows: 3; /* global values */ widows: inherit; widows: initial; widows: unset; in typography, a widow is the last line of a paragraph that appears alone at the top of a page.
word-break - CSS: Cascading Style Sheets
the word-break css property sets whether line breaks appear wherever the text would otherwise overflow its content box.
... syntax /* keyword values */ word-break: normal; word-break: break-all; word-break: keep-all; word-break: break-word; /* deprecated */ /* global values */ word-break: inherit; word-break: initial; word-break: unset; the word-break property is specified as a single keyword chosen from the list of values below.
word-spacing - CSS: Cascading Style Sheets
the word-spacing css property sets the length of space between words and between tags.
... syntax /* keyword value */ word-spacing: normal; /* <length> values */ word-spacing: 3px; word-spacing: 0.3em; /* <percentage> values */ word-spacing: 50%; word-spacing: 200%; /* global values */ word-spacing: inherit; word-spacing: initial; word-spacing: unset; values normal the normal inter-word spacing, as defined by the current font and/or the browser.
z-index - CSS: Cascading Style Sheets
WebCSSz-index
the z-index css property sets the z-order of a positioned element and its descendants or flex items.
... syntax /* keyword value */ z-index: auto; /* <integer> values */ z-index: 0; z-index: 3; z-index: 289; z-index: -1; /* negative values to lower the priority */ /* global values */ z-index: inherit; z-index: initial; z-index: unset; the z-index property is specified as either the keyword auto or an <integer>.
CSS: Cascading Style Sheets
WebCSS
here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features.
...we have covered the necessary prerequisites so we can now dive deep into css layout, looking at different display settings, modern layout tools like flexbox, css grid, and positioning, and some of the legacy techniques you might still want to know about.
exsl:object-type() - EXSLT
in particular, treating something that's not a node-set as a node-set will do so.
... returns the object's type, which will be one of the following: string number boolean node-set rtf external specifications exslt - exsl:object-type ...
math:highest() - EXSLT
WebEXSLTmathhighest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:highest() returns the node in the specified node-set with the highest value (where the highest value calculated using math:max()).
... syntax math:highest(nodeset) parameters nodeset the node-set whose highest value is to be returned.
math:lowest() - EXSLT
WebEXSLTmathlowest
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes math:lowest() returns the node in the specified node-set with the lowest value (where the lowest value calculated using math:min()).
... syntax math:lowest(nodeset) parameters nodeset the node-set whose lowest value is to be returned.
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.
... note: you can find a guide to encoding hls and mpeg-dash for use on the web at setting up adaptive streaming media sources.
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
in html5, document.write() can only be called from a script that is created by a <script> tag that does not have the async or defer attributes set.
... some contexts from which you should not call document.write() include: scripts created using document.createelement() event handlers settimeout() setinterval() <script async src="..."> <script defer src="..."> if you use the same mechanism for loading script libraries for all browsers including ie, then your code probably will not be affected by this change.
HTML5 - Developer guides
WebGuideHTMLHTML5
it is a new version of the language html, with new elements, attributes, and behaviors, and a larger set of technologies that allows the building of more diverse and powerful web sites and applications.
... this set is sometimes called html5 & friends and often shortened to just html5.
Mobile Web Development - Developer guides
WebGuideMobile
working with small screens responsive web design is a term for a set of techniques that enables your web site to adapt its layout as its viewing environment — most obviously, the size and orientation of the screen — changes.
... for example, if you set a gradient as a background for some text using a vendor-prefixed property like -webkit-linear-gradient, it's best to include the other vendor-prefixed versions of the linear-gradient() property.
HTML attribute: accept - HTML: Hypertext Markup Language
because a given file type may be identified in more than one manner, it's useful to provide a thorough set of type specifiers when you need files of specific type, or use the wild card to denote a type of any format is acceptable.
... examples when set on a file input type, the native file picker that opens up should only enable selecting files of the correct file type.
HTML attribute: required - HTML: Hypertext Markup Language
conversely, inputs that support the required attribute but don't have the attribute set match the :optional pseudo-class.
... note: setting aria-required="true" tells a screen reader that an element (any element) is required, but has no bearing on the optionality of the element.
Block-level elements - HTML: Hypertext Markup Language
in html5, this binary distinction is replaced with a more complex set of content categories.
... <fieldset> field set label.
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcontent
catednon-standardchrome full support 35edge full support 79firefox no support 33 — 59disabled no support 33 — 59disabled disabled from version 33 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true).
...droid full support 37chrome android full support 37firefox android no support 33 — 59disabled no support 33 — 59disabled disabled from version 33 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true).
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
when the user clicks on the widget or focuses it then presses the space bar, it "twists" open, revealing its contents: from there, you can use css to style the disclosure widget, and you can programmatically open and close the widget by setting/removing its open attribute.
...for example, we can remove the disclosure widget icon by setting list-style: none.
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
confecta res esset.
...later on, a link is created using <a> with the href attribute set to "#definition-dfn" to set up the link back to the definition.
<font> - HTML: Hypertext Markup Language
WebHTMLElementfont
color this attribute sets the text color using either a named color or a color specified in the hexadecimal #rrggbb format.
...it can be defined using a relative value, like +2 or -3, which set it relative to the value of the size attribute of the <basefont> element, or relative to 3, the default value, if none does exist.
<frame> - HTML: Hypertext Markup Language
WebHTMLElementframe
a frame should be used within a <frameset>.
... example <frameset cols="50%,50%"> <frame src="https://udn.realityripple.com/docs/web/html/element/iframe" /> <frame src="https://udn.realityripple.com/docs/web/html/element/frame" /> </frameset> ...
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
it groups a set of <h1>–<h6> elements.
... so in the abstract outline produced by the html outline algorithm defined in the html specification, the <hgroup> as a whole forms a single logical heading, with the entire set of <h1>–<h6> children of the <hgroup> going into the outline as one multi-level unit, to comprise that single logical heading in the abstract outline.
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
WebHTMLElementi
the html idiomatic text element (<i>) represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others.
... usage notes use the <i> element for text that is set off from the normal prose for readability reasons.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
allowfullscreen set to true if the <iframe> can activate fullscreen mode by calling the requestfullscreen() method.
... allowpaymentrequest set to true if a cross-origin <iframe> should be allowed to invoke the payment request api.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
content categories flow content, phrasing content, interactive content, listed, labelable, submittable, resettable form-associated element, palpable content.
...(note that only a subset of the curves named there may actually be supported in any particular browser.) if the keyparams parameter string is not a recognized curve name string, then a curve is chosen according to the user's chosen key strength (low, medium, high), using the curve named "secp384r1" for high, and the curve named "secp256r1" for medium keys.
<legend> - HTML: Hypertext Markup Language
WebHTMLElementlegend
the html <legend> element represents a caption for the content of its parent <fieldset>.
... permitted parents a <fieldset> whose first child is this <legend> element implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmllegendelement attributes this element only includes the global attributes.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
content categories flow content, phrasing content, listed, labelable, resettable form-associated element, palpable content.
...(if this attribute is not set, the <output> is associated with its ancestor <form> element, if any.) this attribute lets you associate <output> elements to <form>s anywhere in the document, not just inside a <form>.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
the end tag may be omitted if the <p> element is immediately followed by an <address>, <article>, <aside>, <blockquote>, <div>, <dl>, <fieldset>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <header>, <hr>, <menu>, <nav>, <ol>, <pre>, <section>, <table>, <ul> or another <p> element, or if there is no more content in the parent element and the parent element is not an <a> element.
.../p> css p { margin: 0; text-indent: 3ch; } p.pilcrow { text-indent: 0; display: inline; } p.pilcrow + p.pilcrow::before { content: " ¶ "; } javascript document.queryselector('button').addeventlistener('click', function (event) { document.queryselectorall('p').foreach(function (paragraph) { paragraph.classlist.toggle('pilcrow'); }); var newbuttontext = event.target.dataset.toggletext; var oldtext = event.target.innertext; event.target.innertext = newbuttontext; event.target.dataset.toggletext = oldtext; }); result accessibility concerns breaking up content into paragraphs helps make a page more accessible.
<style>: The Style Information element - HTML: Hypertext Markup Language
WebHTMLElementstyle
type this attribute defines the styling language as a mime type (charset should not be specified).
... title this attribute specifies alternative style sheet sets.
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
WebHTMLElementtrack
if the kind attribute is set to subtitles, then srclang must be defined.
... usage notes track data types the type of data that track adds to the media is set in the kind attribute, which can take values of subtitles, captions, descriptions, chapters or metadata.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
to underline text, you should instead apply a style that includes the css text-decoration property set to underline.
... non-semantic underlines to underline text without implying any semantic meaning, use a <span> element with the text-decoration property set to "underline", as shown below.
accesskey - HTML: Hypertext Markup Language
recommendation from html 4.01 specification, several characters can now be set as the accesskey.
... also, it can be set on any element.
dir - HTML: Hypertext Markup Language
if not set, its value is auto.
... recommendation supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>.
draggable - HTML: Hypertext Markup Language
if this attribute is not set, its default value is auto, which means drag behavior is the default browser behavior: only text selections, images, and links can be dragged.
... for other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example.
itemscope - HTML: Hypertext Markup Language
you can use the id attribute to set a global identifier for the new item.
...each itemscope attribute sets the scope of its corresponding itemtype attribute.
spellcheck - HTML: Hypertext Markup Language
if this attribute is not set, its default value is element-type and browser-defined.
...typically non-editable elements are not checked for spelling errors, even if the spellcheck attribute is set to true and the browser supports spellchecking.
Microdata - HTML: Hypertext Markup Language
this vocabulary defines a standard set of type names and property names, for example, schema.org music event indicates a concert performance, with startdate and location properties to specify the concert's key details.
...itemscope is used to set the scope of where in the data structure the vocabulary set by itemtype will be active.
Data URLs - HTTP
note: data urls are treated as unique opaque origins by modern browsers, rather than inheriting the origin of the settings object responsible for the navigation.
...if omitted, defaults to text/plain;charset=us-ascii if the data is textual, you can simply embed the text (using the appropriate entities or escapes based on the enclosing document's type).
Browser detection using the user agent - HTTP
function(mq) { for (var i=0,len=mql.length|0; i<len; i=i+1|0) if (mql[i][0] === mq) mql.splice(i, 1); mq.removelistener(whenmediachanges); } : listentomediaquery; var orientationchanged = false; addeventlistener("orientationchange", function(){ orientationchanged = true; }, passive_listener_option); addeventlistener("resize", settimeout.bind(0,function(){ if (orientationchanged && !mediaqueryupdated) for (var i=0,len=mql.length|0; i<len; i=i+1|0) mql[i][1]( mql[i][0] ); mediaqueryupdated = orientationchanged = false; },0)); which part of the user agent contains the information you are looking for?
... most browsers set the name and version in the format browsername/versionnumber, with the notable exception of internet explorer.
Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’ - HTTP
the cors request was attempted with the credentials flag set, but the server is configured using the wildcard ("*") as the value of access-control-allow-origin, which doesn't allow the use of credentials.
... if the request is being issued using xmlhttprequest, make sure you're not setting withcredentials to true.
Configuring servers for Ogg media - HTTP
setting payload to auto tells the browser to automatically begin downloading the media as soon as the page is loaded, under the assumption that the user will play it.
...the output from oggz-info looks like this: $ oggz-info /g/media/bruce_vs_ironman.ogv content-duration: 00:01:00.046 skeleton: serialno 1976223438 4 packets in 3 pages, 1.3 packets/page, 27.508% ogg overhead presentation-time: 0.000 basetime: 0.000 theora: serialno 0170995062 1790 packets in 1068 pages, 1.7 packets/page, 1.049% ogg overhead video-framerate: 29.983 fps video-width: 640 video-height: 360 vorbis: serialno 0708996688 4531 packets in 167 pages, 27.1 packets/page, 1.408% ogg overhead audio-samplerate: 44100 hz audio-channels: 2 note that you can't simp...
Connection management in HTTP/1.x - HTTP
this model is the default model used in http/1.0 (if there is no connection header, or if its value is set to close).
...setting connection to anything other than close, usually retry-after, will make them persistent.
Using Feature Policy - HTTP
writing a policy a policy is described using a set of individual policy directives.
...if the iframe has an allow attribute, the policies of the parent page and the allow attribute are combined, using the most restrictive subset.
Access-Control-Allow-Credentials - HTTP
for a cors request with credentials, in order for browsers to expose the response to frontend javascript code, both the server (using the access-control-allow-credentials header) and the client (by setting the credentials mode for the xhr, fetch, or ajax request) must indicate that they’re opting in to including credentials.
...if you don't need credentials, omit this header entirely (rather than setting its value to false).
Content-Location - HTTP
the server specifies where the new post is with content-location: http/1.1 201 created content-type: text/plain; charset=utf-8 content-location: /my-first-blog-post ✅ success!
... http/1.1 200 ok content-type: text/html; charset=utf-8 content-location: /my-receipts/38 <!doctype html> (lots of html…) <p>you sent $38.00 to exampleuser.</p> (lots more html…) specifications specification title rfc 7231, section 3.1.4.2: content-location hypertext transfer protocol (http/1.1): semantics and content ...
CSP: child-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: connect-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: default-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: font-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: frame-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: img-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: manifest-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: media-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: prefetch-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: script-src-attr - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: script-src-elem - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: style-src-attr - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: style-src-elem - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
CSP: worker-src - HTTP
'none' refers to the empty set; that is, no urls match.
...specifying nonce makes a modern browser ignore 'unsafe-inline' which could still be set for older browsers without nonce support.
Cookie - HTTP
WebHTTPHeadersCookie
the cookie http request header contains stored http cookies previously sent by the server with the set-cookie header.
... the cookie header is optional and may be omitted if, for example, the browser's privacy settings block cookies.
Cross-Origin-Embedder-Policy - HTTP
examples certain features depend on cross-origin isolation you can only access certain features like sharedarraybuffer objects or performance.now() with unthrottled timers, if your document has a coep header with the value require-corp value set.
... cross-origin-embedder-policy: require-corp cross-origin-opener-policy: same-origin see also the cross-origin-opener-policy header which you'll need to set as well.
Cross-Origin-Resource-Policy - HTTP
note: due to a bug in chrome, setting cross-origin-resource-policy can break pdf rendering, preventing visitors from being able to read past the first page of some pdfs.
... due to a bug in firefox, setting cross-origin-resource-policy can prevent some resources (such as pdfs) from being downloaded in some circumstances.
ETag - HTTP
WebHTTPHeadersETag
they might also be set to persist indefinitely by a tracking server.
...if a user visits a given url again (that has an etag set), and it is stale (too old to be considered usable), the client will send the value of its etag along in an if-none-match header field: if-none-match: "33a64df551425fcc55e4d42a148795d9f25f89d4" the server compares the client's etag (sent with if-none-match) with the etag for its current version of the resource, and if both values match (that is, the resource has not changed), the server sends b...
Early-Data - HTTP
the early-data header is set by an intermediary to indicate that the request has been conveyed in tls early data, and also indicates that the intermediary understands the 425 (too early) status code.
... the early-data header is not set by the originator of the request (i.e., a browser).
Feature-Policy: document-domain - HTTP
the http feature-policy header document-domain directive controls whether the current document is allowed to set document.domain.
... when this policy is enabled, attempting to set document.domain will fail and cause a securityerror domexception to be be thrown.
Feature-Policy - HTTP
document-domain controls whether the current document is allowed to set document.domain.
... when this policy is disabled, attempting to set document.domain will fail and cause a securityerror domexception to be be thrown.
Large-Allocation - HTTP
the document with the large-allocation header was loaded in a window which was opened by window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set.
... the document with the large-allocation header has opened another window with window.open(), <a target="_blank"> or other similar methods without rel="noopener" or the "noopener" feature being set.
Strict-Transport-Security - HTTP
should it be necessary to disable strict transport security, setting the max-age to 0 (over a https connection) will immediately expire the strict-transport-security header, allowing access via http.
... strict-transport-security: max-age=31536000; includesubdomains in the following example, max-age is set to 2 years, raised from what was a former limit max-age of 1 year.
TE - HTTP
WebHTTPHeadersTE
in http/2 - the te header field is only accepted if the trailers value is set.
...however, it is useful for setting if the client is accepting trailer fields in a chunked transfer coding using the "trailers" value.
Trailer - HTTP
WebHTTPHeadersTrailer
the te request header needs to be set to "trailers" to allow trailer fields.
...these header fields are disallowed: message framing headers (e.g., transfer-encoding and content-length), routing headers (e.g., host), request modifiers (e.g., controls and conditionals, like cache-control, max-forwards, or te), authentication headers (e.g., authorization or set-cookie), or content-encoding, content-type, content-range, and trailer itself.
Firefox user agent string reference - HTTP
g 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.
...the recommended way to do this, if it's absolutely necessary (remember that it slows down every request) is to set a custom http header.
X-Content-Type-Options - HTTP
make sure to set both headers correctly.
... site security testers usually expect this header to be set.
Link prefetching FAQ - HTTP
a web page provides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching specified documents and stores them in its cache.
... yes, there is a hidden preference that you can set to disable link prefetching.
An overview of HTTP - HTTP
WebHTTPOverview
basic authentication may be provided by http, either using the www-authenticate and similar headers, or by setting a specific session using http cookies.
...the modern fetch api provides the same features with a more powerful and flexible feature set.
Proxy servers and tunneling - HTTP
the javascript function contained in the pac file defines the function: the auto-config file should be saved to a file with a .pac filename extension: proxy.pac and the mime type set to: application/x-ns-proxy-autoconfig the file consists of a function called findproxyforurl.
... the example below will work in an environment where the internal dns server is set up so that it can only resolve internal host names, and the goal is to use a proxy only for hosts that aren't resolvable: function findproxyforurl(url, host) { if (isresolvable(host)) return "direct"; else return "proxy proxy.mydomain.com:8080"; } see proxy auto-configuration (pac) for more examples.
206 Partial Content - HTTP
WebHTTPStatus206
if there is only one range, the content-type of the whole response is set to the type of the document, and a content-range is provided.
... if several ranges are sent back, the content-type is set to multipart/byteranges and each fragment covers one range, with content-range and content-type describing it.
HTTP
WebHTTP
when serving an http request, a server can send a set-cookie http header with the response.
...the cookie can also be set to expire on a certain date, or restricted to a specific domain and path.
Equality comparisons and sameness - JavaScript
there are four equality algorithms in es2015: abstract equality comparison (==) strict equality comparison (===): used by array.prototype.indexof, array.prototype.lastindexof, and case-matching samevaluezero: used by %typedarray% and arraybuffer constructors, as well as map and set operations, and also string.prototype.includes and array.prototype.includes since es2016 samevalue: used in all other places javascript provides three different value-comparison operations: === - strict equality comparison ("strict equality", "identity", "triple equals") == - abstract equality comparison ("loose equality", "double equals") object.is provides samevalue (new in es2015).
... we can see that with double and triple equals, with the exception of doing a type check upfront in 11.9.6.1, the strict equality algorithm is a subset of the abstract equality algorithm, because 11.9.6.2–7 correspond to 11.9.3.1.a–f.
Introduction - JavaScript
javascript contains a standard library of objects, such as array, date, and math, and a core set of language elements such as operators, control structures, and statements.
... javascript documentation versus the ecmascript specification the ecmascript specification is a set of requirements for implementing ecmascript.
Regular expressions - JavaScript
(this property is set only if the regular expression uses the g option, described in advanced searching with flags.) 5 source the text of the pattern.
... the change event activated when the user presses enter sets the value of regexp.input.
Text formatting - JavaScript
it is a set of "elements" of 16-bit unsigned integer values (utf-16 code units).
... substring, substr return the specified subset of the string, either by specifying the start and end indexes or the start index and a length.
JavaScript technologies overview - JavaScript
introduction whereas html defines a webpage's structure and content and css sets the formatting and appearance, javascript adds interactivity to a webpage and creates rich web applications.
... other notable apis the settimeout and setinterval functions were first specified on the window interface in html standard.
constructor - JavaScript
this.name = 'square'; } get area() { return this.height * this.width; } set area(value) { this.height = value**0.5; this.width = value**0.5; } } another example here the prototype of square class is changed—but the constructor of its base class polygon is still called when a new instance of a square is created.
... class polygon { constructor() { this.name = "polygon"; } } class square extends polygon { constructor() { super(); } } class rectangle {} object.setprototypeof(square.prototype, rectangle.prototype); console.log(object.getprototypeof(square.prototype) === polygon.prototype); //false console.log(object.getprototypeof(square.prototype) === rectangle.prototype); //true let newinstance = new square(); console.log(newinstance.name); //polygon specifications specification ecmascript (ecma-262)the definition of 'constructor method' in that specification.
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
there are two ways to assign a source map, either by using a comment or by setting a header to the javascript file.
... 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 ...
TypeError: More arguments needed - JavaScript
message typeerror: argument is not an object and is not null (edge) typeerror: object.create requires at least 1 argument, but only 0 were passed typeerror: object.setprototypeof requires at least 2 arguments, but only 0 were passed typeerror: object.defineproperties requires at least 1 argument, but only 0 were passed error type typeerror.
... examples required arguments not provided the object.create() method requires at least one argument and the object.setprototypeof() method requires at least two arguments: var obj = object.create(); // typeerror: object.create requires at least 1 argument, but only 0 were passed var obj = object.setprototypeof({}); // typeerror: object.setprototypeof requires at least 2 arguments, but only 1 were passed you can fix this by setting null as the prototype, for example: var obj = object.create(null); var obj = object.setprototypeof({}, null); ...
Method definitions - JavaScript
syntax const obj = { get property() {}, set property(value) {}, property( parameters… ) {}, *generator( parameters… ) {}, async property( parameters… ) {}, async* generator( parameters… ) {}, // with computed keys get [property]() {}, set [property](value) {}, [property]( parameters… ) {}, *[generator]( parameters… ) {}, async [property]( parameters… ) {}, async* [generator]( parameters… ) {}, }; d...
...escription the shorthand syntax is similar to the getter and setter syntax introduced in ecmascript 2015.
Array() constructor - JavaScript
arraylength if the only argument passed to the array constructor is an integer between 0 and 232-1 (inclusive), this returns a new javascript array with its length property set to that number (note: this implies an array of arraylength empty slots, not slots with actual undefined values).
...an array with its length property set to that number and the array elements are empty slots.
Array.prototype.reduceRight() - JavaScript
is [4, 5, 2, 3, 0, 1] run a list of asynchronous functions with callbacks in series each passing their results to the next const waterfall = (...functions) => (callback, ...args) => functions.reduceright( (composition, fn) => (...results) => fn(composition, ...results), callback )(...args); const randint = max => math.floor(math.random() * max) const add5 = (callback, x) => { settimeout(callback, randint(1000), x + 5); }; const mult3 = (callback, x) => { settimeout(callback, randint(1000), x * 3); }; const sub2 = (callback, x) => { settimeout(callback, randint(1000), x - 2); }; const split = (callback, x) => { settimeout(callback, randint(1000), x, x); }; const add = (callback, x, y) => { settimeout(callback, randint(1000), x + y); }; const div4 = (callback, x) =>...
... { settimeout(callback, randint(1000), x / 4); }; const computation = waterfall(add5, mult3, sub2, split, add, div4); computation(console.log, 5) // -> 14 // same as: const computation2 = (input, callback) => { const f6 = x=> div4(callback, x); const f5 = (x, y) => add(f6, x, y); const f4 = x => split(f5, x); const f3 = x => sub2(f4, x); const f2 = x => mult3(f3, x); add5(f2, input); } ​​​​​​difference between reduce and reduceright var a = ['1', '2', '3', '4', '5']; var left = a.reduce(function(prev, cur) { return prev + cur; }); var right = a.reduceright(function(prev, cur) { return prev + cur; }); console.log(left); // "12345" console.log(right); // "54321" defining composible function the concept of compose function is simple it combines n function...
Array.prototype.every() - JavaScript
the range of elements processed by every is set before the first invocation of callback.
...(it is vacuously true that all elements of the empty set satisfy any given condition.) polyfill every was added to the ecma-262 standard in the 5th edition, and it may not be present in other implementations of the standard.
Array.prototype.filter() - JavaScript
the range of elements processed by filter() is set before the first invocation of callback.
...((typeof func === 'function' || typeof func === 'function') && this) ) throw new typeerror(); var len = this.length >>> 0, res = new array(len), // preallocate array t = this, c = 0, i = -1; var kvalue; if (thisarg === undefined){ while (++i !== len){ // checks to see if the key was set if (i in this){ kvalue = t[i]; // in case t is changed in callback if (func(t[i], i, t)){ res[c++] = kvalue; } } } } else{ while (++i !== len){ // checks to see if the key was set if (i in this){ kvalue = t[i]; if (func.call(thisarg, t[i], i, t)){ res[c++] = kvalue; ...
Array.prototype.map() - JavaScript
it is not called for missing elements of the array; that is: indexes that have never been set; which have been deleted; or which have never been assigned a value.
... the range of elements processed by map is set before the first invocation of callback.
Array.prototype.slice() - JavaScript
a negative index can be used, indicating an offset from the end of the sequence.
... a negative index can be used, indicating an offset from the end of the sequence.
BigInt64Array - JavaScript
bigint64array.prototype.byteoffset returns the offset (in bytes) of the bigint64array from the start of its arraybuffer.
... bigint64array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
BigUint64Array - JavaScript
biguint64array.prototype.byteoffset returns the offset (in bytes) of the biguint64array from the start of its arraybuffer.
... biguint64array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Date.prototype.getTime() - JavaScript
reduced time precision to offer protection against timing attacks and fingerprinting, the precision of new date().gettime() might get rounded depending on browser settings.
... // since month is zero based, birthday will be january 10, 1995 var birthday = new date(1994, 12, 10); var copy = new date(); copy.settime(birthday.gettime()); measuring execution time subtracting two subsequent gettime() calls on newly generated date objects, give the time span between these two calls.
Date.prototype.getYear() - JavaScript
var xmas = new date('december 25, 1800 23:15:00'); var year = xmas.getyear(); // returns -100 setting and getting a year between 1900 and 1999 the third statement assigns the value 95 to the variable year, representing the year 1995.
... var xmas = new date('december 25, 2015 23:15:00'); xmas.setyear(95); var year = xmas.getyear(); // returns 95 specifications specification ecmascript (ecma-262)the definition of 'date.prototype.getyear' in that specification.
Date.prototype.toString() - JavaScript
"26" space the string "gmt" timezone offset sign, either: "+" for positive offsets (0 or greater) "-" for negative offsets (less than zero) two digit hour offset, e.g.
... "14" two digit minute offset, e.g.
Float32Array - JavaScript
float32array.prototype.byteoffset returns the offset (in bytes) of the float32array from the start of its arraybuffer.
... float32array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Float64Array - JavaScript
float64array.prototype.byteoffset returns the offset (in bytes) of the float64array from the start of its arraybuffer.
... float64array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Int16Array - JavaScript
int16array.prototype.byteoffset returns the offset (in bytes) of the int16array from the start of its arraybuffer.
... int16array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Int32Array - JavaScript
int32array.prototype.byteoffset returns the offset (in bytes) of the int32array from the start of its arraybuffer.
... int32array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Int8Array - JavaScript
int8array.prototype.byteoffset returns the offset (in bytes) of the int8array from the start of its arraybuffer.
... int8array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Intl.Collator.supportedLocalesOf() - JavaScript
return value an array of strings representing a subset of the given locale tags that are supported in collation without having to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags provided in locales.
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
setting an entry in the bag for year (with any value) will yield both the and the yearname gregorian relatedyear: let opts = { year: "numeric", month: "numeric", day: "numeric" }; let df = new intl.datetimeformat("zh-u-ca-chinese", opts); df.formattoparts(date.utc(2012, 11, 17, 3, 0, 42)); // return value [ { type: 'relatedyear', value: '2012' }, { type: 'literal', value: '年' }, { type: ...
...'month', value: '十一月' }, { type: 'day', value: '4' } ] if the year option is not set in the bag (to any value), the result will include only the relatedyear: let df = new intl.datetimeformat("zh-u-ca-chinese"); df.formattoparts(date.utc(2012, 11, 17, 3, 0, 42)); // return value [ { type: 'relatedyear', value: '2012' }, { type: 'literal', value: '年' }, { type: 'month', value: '十一月' }, { type: 'day', value: '4' } ] in cases where the year would be output, .format() may commonly present these side-by-side: let df = new intl.datetimeformat("zh-u-ca-chinese", {year: "numeric"}); df.format(date.utc(2012, 11, 17, 3, 0, 42)); // return value 2012壬辰年 this also makes it possible to mix locale and calendar in both format: let df = new intl.datetimeformat(...
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags provided in locales.
Intl.DisplayNames.supportedLocalesOf() - JavaScript
return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags provided in locales.
Intl.ListFormat.supportedLocalesOf() - JavaScript
return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags provided in locales.
Intl.Locale.prototype.baseName - JavaScript
examples basic example let myloc = new intl.locale("fr-latn-ca"); // sets locale to canadian french console.log(myloc.tostring()); // prints out "fr-latn-ca-u-ca-gregory" console.log(myloc.basename); // prints out "fr-latn-ca" example with options in the input string // sets language to japanese, region to japan, // calendar to gregorian, hour cycle to 24 hours let japan = new intl.locale("ja-jp-u-ca-gregory-hc-24"); console.log(japan.tostring()); // prints out "ja...
...-jp-u-ca-gregory-hc-h24" console.log(japan.basename); // prints out "ja-jp" example with options that override input string // input string indicates language as dutch and region as belgium, // but options object overrides the region and sets it to the netherlands let dutch = new intl.locale("nl-latn-be", {region: "nl"}); console.log(dutch.basename); // prints out "nl-latn-nl" specifications specification ecmascript internationalization api (ecma-402) ...
Intl.Locale.prototype.region - JavaScript
examples setting the region in the locale identifer string argument the region is the third part of a valid unicode language identifier string, and can be set by adding it to the locale identifier string that is passed into the locale constructor.
... the region is a mandatory part of a let regionstr = new intl.locale("en-latn-us"); console.log(regionstr.region); // prints "us" setting the region via the configuration object the locale constructor takes a configuration object, which can be used to set the region subtag and property.
Intl.NumberFormat() constructor - JavaScript
you can enable this formatting by setting the currencysign option to "accounting".
...a subset of units from the full list was selected for use in ecmascript.
Intl.NumberFormat.supportedLocalesOf() - JavaScript
return value an array of strings representing a subset of the given locale tags that are supported in number formatting without having to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags provided in locales.
Intl.PluralRules.supportedLocalesOf() - JavaScript
return value an array of strings representing a subset of the given locale tags that are supported in plural formatting without having to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags provided in locales.
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
return value an array of strings representing a subset of the given locale tags that are supported in date and time formatting without having to fall back to the runtime's default locale.
... description returns an array with a subset of the language tags provided in locales.
Map.prototype.size - JavaScript
a set accessor function for size is undefined; you can not change this property.
... examples using size var mymap = new map(); mymap.set('a', 'alpha'); mymap.set('b', 'beta'); mymap.set('g', 'gamma'); mymap.size // 3 specifications specification ecmascript (ecma-262)the definition of 'map.prototype.size' in that specification.
Object.getOwnPropertyDescriptor() - JavaScript
set a function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only).
... examples using object.getownpropertydescriptor var o, d; o = { get foo() { return 17; } }; d = object.getownpropertydescriptor(o, 'foo'); // d is { // configurable: true, // enumerable: true, // get: /*the getter function*/, // set: undefined // } o = { bar: 42 }; d = object.getownpropertydescriptor(o, 'bar'); // d is { // configurable: true, // enumerable: true, // value: 42, // writable: true // } o = { [symbol.for('baz')]: 73 } d = object.getownpropertydescriptor(o, symbol.for('baz')); // d is { // configurable: true, // enumerable: true, // value: 73, // writable: true // } o = {}; object.defineproper...
Promise() constructor - JavaScript
note that if you call resolutionfunc or rejectionfunc and pass another promise object as an argument, you can say that it is "resolved", but still cannot be said to be "settled".
... // // resolve(somevalue) // fulfilled // or // reject("failure reason") // rejected }); making functions return a promise to provide a function with promise functionality, have it return a promise: function myasyncfunction(url) { return new promise((resolve, reject) => { const xhr = new xmlhttprequest() xhr.open("get", url) xhr.onload = () => resolve(xhr.responsetext) xhr.onerror = () => reject(xhr.statustext) xhr.send() }); } specifications specification ecmascript (ecma-262)the definition of 'promise constructor' in that specification.
SharedArrayBuffer.prototype.slice() - JavaScript
a negative index can be used, indicating an offset from the end of the sequence.
... a negative index can be used, indicating an offset from the end of the sequence.
String.prototype.fontsize() - JavaScript
description when you specify size as an integer, you set the font size of str to one of the 7 defined sizes.
... when you specify size as a string such as "-2", you adjust the font size of str relative to the size set in the <basefont> tag.
String.prototype.replaceAll() - JavaScript
syntax const newstr = str.replaceall(regexp|substr, newsubstr|function) when using a `regexp` you must have to set the global ("g") flag; otherwise, it will throw a typeerror: "replaceall must be called with a global regexp".
... offset the offset of the matched substring within the whole string being examined.
Symbol.isConcatSpreadable - JavaScript
spreadable writable no enumerable no configurable no examples arrays by default, array.prototype.concat() spreads (flattens) arrays into its result: let alpha = ['a', 'b', 'c'], let numeric = [1, 2, 3] let alphanumeric = alpha.concat(numeric) console.log(alphanumeric) // result: ['a', 'b', 'c', 1, 2, 3] when setting symbol.isconcatspreadable to false, you can disable the default behavior: let alpha = ['a', 'b', 'c'], let numeric = [1, 2, 3] numeric[symbol.isconcatspreadable] = false let alphanumeric = alpha.concat(numeric) console.log(alphanumeric) // result: ['a', 'b', 'c', [1, 2, 3] ] array-like objects for array-like objects, the default is to not spread.
... symbol.isconcatspreadable needs to be set to true in order to get a flattened array: let x = [1, 2, 3] let fakearray = { [symbol.isconcatspreadable]: true, length: 2, 0: 'hello', 1: 'world' } x.concat(fakearray) // [1, 2, 3, "hello", "world"] note: the length property is used to control the number of object properties to be added.
Symbol.match - JavaScript
now, if the match symbol is set to false (or a falsy value), it indicates that the object is not intended to be used as a regular expression object.
... however, if you set symbol.match to false, the isregexp check (that uses the match property) will indicate that the object is not a regular expression object.
Symbol - JavaScript
to create symbols available across files and even across realms (each of which has its own global scope), use the methods symbol.for() and symbol.keyfor() to set and retrieve symbols from the global symbol registry.
...note that every object is initialized with no own symbol properties, so that this array will be empty unless you've set symbol properties on the object.
TypedArray.prototype.slice() - JavaScript
a negative index can be used, indicating an offset from the end of the sequence.
... a negative index can be used, indicating an offset from the end of the sequence.
Uint16Array - JavaScript
uint16array.prototype.byteoffset returns the offset (in bytes) of the uint16array from the start of its arraybuffer.
... uint16array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Uint32Array - JavaScript
uint32array.prototype.byteoffset returns the offset (in bytes) of the uint32array from the start of its arraybuffer.
... uint32array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
Uint8Array - JavaScript
uint8array.prototype.byteoffset returns the offset (in bytes) of the uint8array from the start of its arraybuffer.
... uint8array.prototype.set() stores multiple values in the typed array, reading input values from a specified array.
WeakMap() constructor - JavaScript
examples using weakmap const wm1 = new weakmap(), wm2 = new weakmap(), wm3 = new weakmap(); const o1 = {}, o2 = function() {}, o3 = window; wm1.set(o1, 37); wm1.set(o2, 'azerty'); wm2.set(o1, o2); // a value can be anything, including an object or a function wm2.set(o3, undefined); wm2.set(wm1, wm2); // keys and values can be any objects.
... wm1.get(o2); // "azerty" wm2.get(o2); // undefined, because there is no key for o2 on wm2 wm2.get(o3); // undefined, because that is the set value wm1.has(o2); // true wm2.has(o2); // false wm2.has(o3); // true (even if the value itself is 'undefined') wm3.set(o1, 37); wm3.get(o1); // 37 wm1.has(o1); // true wm1.delete(o1); wm1.has(o1); // false specifications specification ecmascript (ecma-262)the definition of 'weakmap constructor' in that specification.
WebAssembly.Memory() constructor - JavaScript
unshared webassembly memories don't need to set a maximum, but shared memories do.
...if set to true, it is a shared memory.
WebAssembly.Table - JavaScript
table.prototype.set() sets an element stored at a given index to a given value.
... 52notes notes disabled in the firefox 52 extended support release (esr).opera android full support 43safari ios full support 11samsung internet android full support 7.0nodejs full support 8.0.0setchrome full support 57edge full support 16firefox full support 52notes full support 52notes notes disabled in the firefox 52 extended support release (esr).ie no support noop...
encodeURI() - JavaScript
~ * ' ( ) # examples encodeuri vs encodeuricomponent encodeuri() differs from encodeuricomponent() as follows: var set1 = ";,/?:@&=+$#"; // reserved characters var set2 = "-_.!~*'()"; // unreserved marks var set3 = "abc abc 123"; // alphanumeric characters + space console.log(encodeuri(set1)); // ;,/?:@&=+$# console.log(encodeuri(set2)); // -_.!~*'() console.log(encodeuri(set3)); // abc%20abc%20123 (the space gets encoded as %20) console.log(encodeuricomponent(set1)); // %3b%2c%2f%3f%3a%40%26%3d%2b%24%23 cons...
...ole.log(encodeuricomponent(set2)); // -_.!~*'() console.log(encodeuricomponent(set3)); // abc%20abc%20123 (the space gets encoded as %20) note that encodeuri() by itself cannot form proper http get and post requests, such as for xmlhttprequest, because "&", "+", and "=" are not encoded, which are treated as special characters in get and post requests.
encodeURIComponent() - JavaScript
~ * ' ( ) encodeuricomponent() differs from encodeuri as follows: var set1 = ";,/?:@&=+$"; // reserved characters var set2 = "-_.!~*'()"; // unescaped characters var set3 = "#"; // number sign var set4 = "abc abc 123"; // alphanumeric characters + space console.log(encodeuri(set1)); // ;,/?:@&=+$ console.log(encodeuri(set2)); // -_.!~*'() console.log(encodeuri(set3)); // # console.log(encodeuri(set4)); // abc%20abc%20123 (the space gets encoded as %20) c...
...onsole.log(encodeuricomponent(set1)); // %3b%2c%2f%3f%3a%40%26%3d%2b%24 console.log(encodeuricomponent(set2)); // -_.!~*'() console.log(encodeuricomponent(set3)); // %23 console.log(encodeuricomponent(set4)); // abc%20abc%20123 (the space gets encoded as %20) note that a urierror will be thrown if one attempts to encode a surrogate which is not part of a high-low pair, e.g., // high-low pair ok console.log(encodeuricomponent('\ud800\udfff')); // lone high surrogate throws "urierror: malformed uri sequence" console.log(encodeuricomponent('\ud800')); // lone low surrogate throws "urierror: malformed uri sequence" console.log(encodeuricomponent('\udfff')); use encodeuricomponent() on user-entered fields from forms post'd to the server.
globalThis - JavaScript
however, this causes csp violations in some settings, so es6-shim uses a check like this, for example: var getglobal = function () { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } throw new error('unable to locate global object'); }; var globals = getglobal(); if (typeof globals.settimeout !== 'function') { // no settimeo...
...} with globalthis available, the additional search for the global across environments is not necessary anymore: if (typeof globalthis.settimeout !== 'function') { // no settimeout in this environment!
Standard built-in objects - JavaScript
the iterable collections (map and set) contain elements which are easily iterated in the order of insertion.
... map set weakmap weakset structured data these objects represent and interact with structured data buffers and data coded using javascript object notation (json).
Operator precedence - JavaScript
first, b is set to 5.
... then the a is also set to 5, the return value of b = 5, aka right operand of the assignment.
await - JavaScript
description the await expression causes async function execution to pause until a promise is settled (that is, fulfilled or rejected), and to resume execution of the async function after fulfillment.
... function resolveafter2seconds(x) { return new promise(resolve => { settimeout(() => { resolve(x); }, 2000); }); } async function f1() { var x = await resolveafter2seconds(10); console.log(x); // 10 } f1(); thenable objects thenable objects will be fulfilled just the same.
for...of - JavaScript
the for...of statement creates a loop iterating over iterable objects, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined iterables.
...ypedarray const iterable = new uint8array([0x00, 0xff]); for (const value of iterable) { console.log(value); } // 0 // 255 iterating over a map const iterable = new map([['a', 1], ['b', 2], ['c', 3]]); for (const entry of iterable) { console.log(entry); } // ['a', 1] // ['b', 2] // ['c', 3] for (const [key, value] of iterable) { console.log(value); } // 1 // 2 // 3 iterating over a set const iterable = new set([1, 1, 2, 2, 3, 3]); for (const value of iterable) { console.log(value); } // 1 // 2 // 3 iterating over the arguments object you can iterate over the arguments object to examine all of the parameters passed into a javascript function: (function() { for (const argument of arguments) { console.log(argument); } })(1, 2, 3); // 1 // 2 // 3 iterating over a ...
for - JavaScript
var i = 0; for (;;) { if (i > 3) break; console.log(i); i++; } using for without a statement the following for cycle calculates the offset position of a node in the final-expression section, and therefore it does not require the use of a statement section, a semicolon is used instead.
... function showoffsetpos(sid) { var nleft = 0, ntop = 0; for ( var oitnode = document.getelementbyid(sid); /* initialization */ oitnode; /* condition */ nleft += oitnode.offsetleft, ntop += oitnode.offsettop, oitnode = oitnode.offsetparent /* final-expression */ ); /* semicolon */ console.log('offset position of \'' + sid + '\' element:\n left: ' + nleft + 'px;\n top: ' + ntop + 'px;'); } /* example call: */ showoffsetpos('content'); // output: // "offset position of "content" element: // left: 0px; // top: 153px;" note: this is one of the few cases in javascript where the semicolon is mandatory.
function* - JavaScript
the done property of the object returned by it will be set to true).
... if a value is returned, it will be set as the value property of the object returned by the generator.
JavaScript
this module gives you some fundamental background knowledge about how client-side frameworks work and how they fit into your toolset, before moving on to tutorial series covering some of today's most popular ones.
... standard objects get to know standard built-in objects array, boolean, date, error, function, json, math, number, object, regexp, string, map, set, weakmap, weakset, and others.
<mfenced> - MathML
href used to set a hyperlink to a specified uri.
...by specifying more than one character, it is possible to set different separators for each argument in the expression.
<mfrac> - MathML
WebMathMLElementmfrac
otherwise, if set to false (which is the default value), numerator and denominator are on top of each other.
... href used to set a hyperlink to a specified uri.
<ms> - MathML
WebMathMLElementms
by default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display.
... href used to set a hyperlink to a specified uri.
<semantics> - MathML
beware that <annotation-xml> elements are only recognized, if the encoding attribute is set to one of the following: "application/mathml-presentation+xml" "mathml-presentation" "svg1.1" "text/html" "image/svg+xml" "application/xml".
... attributes the following attributes can be set on <annotation> and <annotation-xml>: definitionurl the location of the annotation key symbol.
Digital audio concepts - Web media technologies
some codecs have a number of values you can adjust (some of which may require a deep understanding of both psychoacoustics and of the codec's algorithms), and others offer a simple "quality" parameter you can set, which automatically adjusts various properties of the algorithm.
... variable bit rate variable bit rate (vbr) encoding works by accepting as an input into the encoder a constant quality setting.
Media container formats (file types) - Web media technologies
[2] firefox support for av1 is currently disabled by default; it can be enabled by setting the preference media.av1.enabled to true.
... the video is offered first in webm format (with the type attribute set to video/webm).
Using images in HTML - Web media technologies
WebMediaimages
css object-fit the object-fit css property sets how the content of a replaced element, such as an <img> or <video>, should be resized to fit its container.
... background-image the background-image css property sets one or more background images for an element.
Performance budgets - Web Performance
during development, there are a few tools to run checks against new or modified assets: a module bundler (e.g.
... webpack), has performance features that will notify you when assets exceed specified limits.
Progressive web app structure - Progressive web apps (PWAs)
the folder structure looks like this: the html from the html point of view, the app shell is everything outside the content section: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta property="...
...: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } the service worker the last file we will quickly look at is the service worker: sw.js — it first imports data from the games.js file: self.importscripts('data/games.js'); next, it creates a list of all the files to be cached, both from the app shell and the content: var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pw...
Structural overview of progressive web apps - Progressive web apps (PWAs)
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta property="...
...f the code in the file: function randomnotification() { var randomitem = math.floor(math.random()*games.length); var notiftitle = games[randomitem].name; var notifbody = 'created by '+games[randomitem].author+'.'; var notifimg = 'data/img/'+games[randomitem].slug+'.jpg'; var options = { body: notifbody, icon: notifimg } var notif = new notification(notiftitle, options); settimeout(randomnotification, 30000); } the service worker the last file we'll briefly look at here is the service worker, which is found in the file sw.js.
Web API reference - Web technology reference
WebReferenceAPI
device apis this set of apis allows access to various hardware features available to web pages and applications.
... data management apis user data can be stored and managed using this set of apis.
clip-path - SVG: Scalable Vector Graphics
this is the same as having a custom clipping path with a clippathunits set to objectboundingbox --> <rect x="11" y="1" width="8" height="8" stroke="green" clip-path="circle() fill-box" /> <!-- bottom-left --> <rect x="1" y="11" width="8" height="8" stroke="green" clip-path="circle() stroke-box" /> <!-- bottom-right: apply a css basic shape on a view-box geometry.
... this is the same as having a custom clipping path with a clippathunits set to userspaceonuse --> <rect x="11" y="11" width="8" height="8" stroke="green" clip-path="circle() view-box" /> </svg> usage notes value <url> | [ <basic-shape> || <geometry-box> ] | none default value none animatable yes <geometry-box> an extra information to tell how a <basic-shape> is applied to an element: fill-box indicates to use the object bounding box; stroke-box indicates to use the object bounding box extended with the stroke; view-box indicates to use the nearest svg viewport as the reference box.
color-interpolation-filters - SVG: Scalable Vector Graphics
therefore, it has no effect on filter primitives like <feoffset>, <feimage>, <fetile> or <feflood>.
... as a presentation attribute, it can be applied to any element but it only has an effect on the following eighteen elements: <fespotlight>, <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence> usage notes value auto | srgb | linearrgb default value linearrgb animatable yes auto indicates that the user agent can choose either the srgb or linearrgb spaces for color interpolation.
data-* - SVG: Scalable Vector Graphics
WebSVGAttributedata-*
their custom data are available via the svgelement interface of the element the attributes belong to, with the svgelement.dataset property.
... the svgelement.dataset property is a domstringmap that provides the attribute data-test-value via svgelement.dataset.testvalue.
dur - SVG: Scalable Vector Graphics
WebSVGAttributedur
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="3s" repeatcount="indefinite"/> </rect> </svg> usage notes value <clock-value> | media | indefinite default value indefinite animatable no <clock-value> this value speci...
... note: the interpolation will not work if the simple duration is indefinite (although this may still be useful for <set> elements).
exponent - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="gamma" exponent="1"/> <fefuncg type="gamma" exponent="1"/> <fefuncb type="gamma" exponent="1"/> </fecomponenttransfer...
...00" fill="url(#gradient)" style="filter: url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the component element is set to gamma, this value specifies the exponent of the gamma function specifications specification status comment filter effects module level 1the definition of 'exponent' in that specification.
fr - SVG: Scalable Vector Graphics
WebSVGAttributefr
only one element is using this attribute: <radialgradient> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient1" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> <radialgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="25%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r="100" f...
...ill="url(#gradient2)" style="transform: translatex(240px);" /> </svg> usage notes value <length> default value 0 animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="60" r...
fx - SVG: Scalable Vector Graphics
WebSVGAttributefx
only one element is using this attribute: <radialgradient> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient1" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> <radialgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.75" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r...
... animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="...
fy - SVG: Scalable Vector Graphics
WebSVGAttributefy
only one element is using this attribute: <radialgradient> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient1" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> <radialgradient id="gradient2" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.75" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient1)" /> <circle cx="100" cy="100" r...
... animatable none example <svg viewbox="0 0 120 120" width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> </defs> <rect x="10" y="10" rx="15" ry="15" width="100" height="100" fill="url(#gradient)" stroke="black" stroke-width="2"/> <circle cx="60" cy="60" r="50" fill="transparent" stroke="white" stroke-width="2"/> <circle cx="35" cy="35" r="2" fill="white" stroke="white"/> <circle cx="60" cy="...
gradientTransform - SVG: Scalable Vector Graphics
two elements are using this attribute: <lineargradient> and <radialgradient> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <radialgradient id="gradient1" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="skyblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <radialgradient id="gradient2" gradientunits="userspaceonuse" cx="100" cy="100" r="100" fx="100" fy="100" gradienttransform="skewx(20) translate(-35, 0)"> <stop offset="0%" stop-color="darkblue" /> <stop offset="50%" stop-color="sk...
...yblue" /> <stop offset="100%" stop-color="darkblue" /> </radialgradient> <rect x="0" y="0" width="200" height="200" fill="url(#gradient1)" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient2)" style="transform: translatex(220px);" /> </svg> usage notes default value identity transform value <transform-list> animatable yes <transform-list> a list of transformation functions specifying some additional transformation from the gradient coordinate system onto the target coordinate system.
height - SVG: Scalable Vector Graphics
WebSVGAttributeheight
twenty five elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"> <!-- with a height of 0 or less, nothing will be rendered --> <rect y="0" x="0" width="90" height="0"/> <rect y="0" x="100" width="90" height="60"/> <rect y="0" x="200" width="90" height="100%"/> </svg> ...
... value <length> | <percentage> default value 100% animatable yes feoffset for <feoffset>, height defines the vertical length for the rendering area of the primitive.
intercept - SVG: Scalable Vector Graphics
the intercept attribute defines the intercept of the linear function of color component transfers when the type attribute is set to linear.
... four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="linear" intercept="0"/> <fefuncg type="linear" intercept="0"/> <fefuncb type="linear" intercept="0"/> </fecomponenttransfer> </filter> <filter id="componenttransfer2" x="0" y="0" w...
opacity - SVG: Scalable Vector Graphics
WebSVGAttributeopacity
circle>, <ellipse>, <foreignobject>, <g>, <iframe>, <image>, <line>, <marker>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use>, <unknown>, and <video> html, body, svg { height: 100%; } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" x1="0%" y1="0%" x2="0" y2="100%"> <stop offset="0%" style="stop-color:skyblue;" /> <stop offset="100%" style="stop-color:seagreen;" /> </lineargradient> </defs> <rect x="0" y="0" width="100%" height="100%" fill="url(#gradient)" /> <circle cx="50" cy="50" r="40" fill="black" /> <circle cx="150" cy="50" r="40" fill="black" opacity="0.3" /> </svg> usage notes default value 1 value <alpha-value> ...
... animatable yes <alpha-value> the uniform opacity setting to be applied across an entire object, as a <number>.
viewBox - SVG: Scalable Vector Graphics
WebSVGAttributeviewBox
{ display: inline-block; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a large viewbox the circle looks small as it is using user units for the r attribute: 4 resolved against 100 as set in the viewbox --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <!-- with relative unit such as percentage, the visual size of the square looks unchanged regardless of the viewbox` --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with a small viewbox the circle looks large as it is using user units ...
...for the r attribute: 4 resolved against 10 as set in the viewbox --> <circle cx="50%" cy="50%" r="4" fill="white"/> </svg> <svg viewbox="-5 -5 10 10" xmlns="http://www.w3.org/2000/svg"> <!-- the point of coordinate 0,0 is now in the center of the viewport, and 100% is still resolve to a width or height of 10 user units so the rectangle looks shifted to the bottom/right corner of the viewport --> <rect x="0" y="0" width="100%" height="100%"/> <!-- with the point of coordinate 0,0 in the center of the viewport the value 50% is resolve to 5 which means the center of the circle is in the bottom/right corner of the viewport.
visibility - SVG: Scalable Vector Graphics
note: if the visibility attribute is set to hidden on a text element, then the text is invisible but still takes up space in text layout calculations.
... depending on the value of attribute pointer-events, graphics elements which have their visibility attribute set to hidden still might receive events.
width - SVG: Scalable Vector Graphics
WebSVGAttributewidth
twenty five elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, <feturbulence>, <filter>, <foreignobject>, <image>, <mask>, <pattern>, <rect>, <svg>, and <use> html,body,svg { height:100% } <svg viewbox="0 0 100 300" xmlns="http://www.w3.org/2000/svg"> <!-- with a width of 0 or less, nothing will be rendered --> <rect x="0" y="0" width="0" height="90"/> <rect x="0" y="100" width="60" height="90"/> <rect x="0" y="200" width="100%" height="90"/> </svg> ...
... value <length> | <percentage> default value 100% animatable yes feoffset for <feoffset>, width defines the horizontal length for the rendering area of the primitive.
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" /> <re...
... value <length> | <percentage> default value 0% animatable yes feoffset for <feoffset>, x defines the minimum x coordinate for the rendering area of the primitive.
xlink:show - SVG: Scalable Vector Graphics
this is similar to the effect achieved by an html <a> element with target set to _blank.
...this is similar to the effect achieved by an html <a> element with target set to _self.
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" /> <re...
... value <length> | <percentage> default value 0% animatable yes feoffset for <feoffset>, y defines the minimum y coordinate for the rendering area of the primitive.
y1 - SVG: Scalable Vector Graphics
WebSVGAttributey1
--> <lineargradient y1="0%" id="g0"> <stop offset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at the bottom left corner of the bounding box of the shape it is applied to.
... --> <lineargradient y1="100%" id="g1"> <stop offset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'y1' in that specification.
y2 - SVG: Scalable Vector Graphics
WebSVGAttributey2
--> <lineargradient y2="0%" id="g0"> <stop offset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector end at the bottom right corner of the bounding box of the shape it is applied to.
... --> <lineargradient y2="100%" id="g1"> <stop offset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the definition of 'y2' in that specification.
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
otably: requiredextensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect,...
... aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 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...
<altGlyph> - SVG: Scalable Vector Graphics
WebSVGElementaltGlyph
if the reference is to an <altglyphdef> element, then if an appropriate set of alternate glyphs is located from processing the <altglyphdef> element, then those alternate glyphs are rendered instead of the character(s) that are inside of the <altglyph> element.
...ensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate dom interface this element implements the svgaltglyphelement interface.
<circle> - SVG: Scalable Vector Graphics
WebSVGElementcircle
ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<circle>' in that spe...
<defs> - SVG: Scalable Vector Graphics
WebSVGElementdefs
html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- some graphical objects to use --> <defs> <circle id="mycircle" cx="0" cy="0" r="5" /> <lineargradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="20%" stop-color="gold" /> <stop offset="90%" stop-color="red" /> </lineargradient> </defs> <!-- using my graphical objects --> <use x="5" y="5" xlink:href="#mycircle" fill="url('#mygradient')" /> </svg> attributes global attributes core attributes most notably: id lang styling attributes class, style event attributes global event attributes, document element event ...
...attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-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...
<ellipse> - SVG: Scalable Vector Graphics
WebSVGElementellipse
ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<ellipse>' in that sp...
<feGaussianBlur> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in stddeviation edgemode dom interface this element implements the svgfegaussianblurelement interface.
...ircle cx="60" cy="60" r="50" fill="green" /> <circle cx="170" cy="60" r="50" fill="green" filter="url(#blurme)" /> </svg> result screenshotlive sample drop shadow example svg <svg width="120" height="120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="dropshadow"> <fegaussianblur in="sourcealpha" stddeviation="3" /> <feoffset dx="2" dy="4" /> <femerge> <femergenode /> <femergenode in="sourcegraphic" /> </femerge> </filter> <circle cx="60" cy="60" r="50" fill="green" filter="url(#dropshadow)" /> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the definition of '<fegaussianblur>' in that s...
<foreignObject> - SVG: Scalable Vector Graphics
systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<foreignobject>' in that specification.
<g> - SVG: Scalable Vector Graphics
WebSVGElementg
ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 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>, <imag...
<line> - SVG: Scalable Vector Graphics
WebSVGElementline
ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<line>' in that speci...
<linearGradient> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="5%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </lineargradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="url('#mygradient')" /> </svg> attributes gradientunits this attribute defines the coordinate system for attributes x1, x2, y1, y2 value type: userspaceonuse|objectboundingbox ; default value: objectboundingbox; an...
... core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment ...
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
s most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 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>...
<path> - SVG: Scalable Vector Graphics
WebSVGElementpath
ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment svg pathsthe definition of '<path>' in that specification.
<pattern> - SVG: Scalable Vector Graphics
WebSVGElementpattern
value type: <url>; default value: none; animatable: yes note: for browsers implementing href, if both href and xlink:href are set, xlink:href will be ignored and only href will be used.
...s most notably: id, tabindex styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-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>, <col...
<polyline> - SVG: Scalable Vector Graphics
WebSVGElementpolyline
ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<polyline>' in that s...
<radialGradient> - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="mygradient"> <stop offset="10%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </radialgradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="url('#mygradient')" /> </svg> attributes cx this attribute defines the x coordinate of the end circle of the radial gradient.
... core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment ...
<rect> - SVG: Scalable Vector Graphics
WebSVGElementrect
ional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the definition of '<rect>' in that speci...
<stop> - SVG: Scalable Vector Graphics
WebSVGElementstop
html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <lineargradient id="mygradient" gradienttransform="rotate(90)"> <stop offset="5%" stop-color="gold" /> <stop offset="95%" stop-color="red" /> </lineargradient> </defs> <!-- using my linear gradient --> <circle cx="5" cy="5" r="4" fill="url('#mygradient')" /> </svg> attributes offset this attribute defines where the gradient stop is placed along the gradient vector.
... global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes presentation attributes most notably: color, display, stop-color, stop-opacity, visibility usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> specifications specification status comment scalable vector graphics (svg) 2the definition of '<stop>' in that specification.
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 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>, <imag...
<switch> - SVG: Scalable Vector Graphics
WebSVGElementswitch
in particular, setting display:none on a child has no effect on the true/false testing for <switch> processing.
... svg <switch> example this example demonstrates showing different text content depending on the browser's language settings.
<symbol> - SVG: Scalable Vector Graphics
WebSVGElementsymbol
ably: id styling attributes class, style event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowt...
...o, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 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>, <imag...
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
tributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expande...
...d, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-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 ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
feoffset implemented.
... animation module animate implemented set implemented animatemotion implemented animatetransform implemented animatecolor not implemented (bug 436296).
SVG animation with SMIL - SVG: Scalable Vector Graphics
you can set the attribute to define whether the object rotates following the tangent of the path.
...by setting the value of the repeatcount attribute to indefinite, we indicate that the animation should loop forever, as long as the svg image exists.
Basic shapes - SVG: Scalable Vector Graphics
the one on the right has its rx and ry parameters set, giving it rounded corners.
... if they're not set, they default to 0.
Basic Transformations - SVG: Scalable Vector Graphics
with this helper, you can assign properties to a complete set of elements.
...to combine several transformations, one can set the resulting matrix directly with the matrix(a, b, c, d, e, f) transformation which maps coordinates from a previous coordinate system into a new coordinate system by {xnewcoordsys=axprevcoordsys+cyprevcoordsys+eynewcoordsys=bxprevcoordsys+dyprevcoordsys+f\left{ \begin{matrix} x_{\mathrm{prevcoordsys}} = a x_{\mathrm{newcoordsys}} + c y_{\mathrm{newcoordsys}} + e \\ y_{\mathrm{prevcoordsys}} = ...
SVG image element - SVG: Scalable Vector Graphics
type svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg width="5cm" height="4cm" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="firefox.jpg" x="0" y="0" height="50px" width="50px"/> </svg> there are some important things to take note of (referenced from the w3 specs): if you do not set the x or y attributes, they will be set to 0.
... if you do not set the height or width attributes, they will be set to 0.
SVG and CSS - SVG: Scalable Vector Graphics
ll to get all of it: <svg width="600px" height="600px" viewbox="-300 -300 600 600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>svg demonstration</title> <desc>mozilla css getting started - svg demonstration</desc> <defs> <radialgradient id="fade" cx="0" cy="0" r="200" gradientunits="userspaceonuse"> <stop id="fade-stop-1" offset="33%"/> <stop id="fade-stop-2" offset="95%"/> </radialgradient> </defs> <text id="heading" x="-280" y="-270">svg demonstration</text> <text id="caption" x="-280" y="-250">move your mouse pointer over the flower.</text> <g id="flower"> <circle id="overlay" cx="0" cy="0" r="200" stroke="none" fill="url(#fade)"/> <g id="outer-petals"> <g class="quadrant"> ...
...ansform="rotate(72)"/> </g> <g id="petals"> <use xlink:href="#quadrant"/> <use xlink:href="#quadrant" transform="rotate(90)"/> <use xlink:href="#quadrant" transform="rotate(180)"/> <use xlink:href="#quadrant" transform="rotate(270)"/> </g> <radialgradient id="fade" cx="0" cy="0" r="200" gradientunits="userspaceonuse"> <stop id="fade-stop-1" offset="33%"/> <stop id="fade-stop-2" offset="95%"/> </radialgradient> </defs> <text id="heading" x="-280" y="-270">svg demonstration</text> <text id="caption" x="-280" y="-250">move your mouse pointer over the flower.</text> <g id="flower"> <circle id="overlay" cx="0" cy="0" r="200" stroke="none" fill="url(#fade)"/> <use id="outer-petals" xlink:href="#petals"/> <use id=...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
it's adapted from jp fiset's comment in bug 303581 which in turn was adapted from jeff schiller's comment in bug 303581.
...this will set up the os to associate the .svg filename extension with the incorrect media type "image/svg-xml" instead of "image/svg+xml".
Using templates and slots - Web Components
the following set of code snippets show how to use <slot> together with <template> and some javascript to: create a <element-details> element with named slots in its shadow root design the <element-details> element in such a way that, when used in documents, it is rendered from composing the element’s content together with content from its shadow root—that is, pieces of the element’s content are used to ...
...ment-name">need name</slot>&gt;</code> <i class="desc"><slot name="description">need description</slot></i> </span> </summary> <div class="attributes"> <h4><span>attributes</span></h4> <slot name="attributes"><p>none</p></slot> </div> </details> <hr> </template> that <template> element has several features: the <template> has a <style> element with a set of css styles that are scoped just to the document fragment the <template> creates.
Web Components
custom elements: a set of javascript apis that allow you to define custom elements and their behaviour, which can then be used as desired in your user interface.
... shadow dom: a set of javascript apis for attaching an encapsulated "shadow" dom tree to an element — which is rendered separately from the main document dom — and controlling associated functionality.
xml:base - XML: Extensible Markup Language
WebXMLxml:base
use cases if you have an inline svg you use as icons that needs to work in a document with a html baseelement , you can reset the uri on your icon sprite by setting the xml:base.
...p://www.w3.org/1999/xlink"> <defs> <style type="text/css"><![cdata[ .s9_999{ font-size: 9.17px; font-family: zapfdingbats_ghr; fill: #161615; } ]]></style> <text x="647" y="412" dx="0" class="s9_999" >r</text> <style type="text/css"><![cdata[ @font-face { font-family: zapfdingbats_ghr; src: url("fonts/zapfdingbats_ghr.woff") format("woff"); } ]]></style> </svg> setting the xml:base on the svg element means you can inline the svg and thereby bypass cors issue while not changing the base uri for your entire document.
boolean - XPath
the expression can refer to numbers and node-sets as well as booleans.
... a node-set evaluates to true if it is non-empty.
generate-id - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the generate-id function generates a unique id for the first node in a given node-set and returns a string containing that id.
... syntax generate-id( [node-set] ) arguments node-set (optional) an id will be generated for the first node in this node-set.
local-name - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the local-name function returns a string representing the local name of the first node in a given node-set.
... syntax local-name( [node-set] ) arguments node-set (optional) the local name of the first node in this node-set will be returned.
name - XPath
WebXPathFunctionsname
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the name function returns a string representing the qname of the first node in a given node-set.
... syntax name( [node-set] ) arguments node-set (optional) the qname of the first node in this node-set will be returned.
namespace-uri - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the namespace-uri function returns a string representing the namespace uri of the first node in a given node-set.
... syntax namespace-uri( [node-set] ) arguments node-set (optional) the namespace uri of the first node in this node-set will be returned.
<xsl:attribute> - XSLT: Extensible Stylesheet Language Transformations
you cannot set the related namespace prefix with this element.
... type instruction, appears within a template or an <xsl:attribute-set> element.
<xsl:element> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementelement
syntax <xsl:element name=name namespace=uri use-attribute-sets=list-of-names > template </xsl:element> required attributes name specifies the desired name of the output element.
... use-attribute-sets a whitespace‐separated list of attribute-set element names to be applied to the element element’s output element.
<xsl:for-each> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementfor-each
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:for-each> element selects a set of nodes and processes each of them in the same way.
... it is often used to iterate through a set of nodes or to change the current node.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
<xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:transform>...
...<xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:copy> <xsl:copy-of> <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:transform> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
examples set the parameter 'color' to the string 'red': <?xslt-param name="color" value="red"?> set the parameter 'columns' to the number 2: <?xslt-param name="columns" select="2"?> set the parameter 'books' to a nodeset containing all <book> elements in the null namespace: <?xslt-param name="books" select="//book"?> set the parameter 'show-toc' to boolean true: <?xslt-param name="show-toc" select=...
... examples set the parameter 'books' to a nodeset containing all <book> elements in the 'http://www.example.org/mynamespace' namespace: <?xslt-param-namespace prefix="my" namespace="http://www.example.org/mynamespace"?> <?xslt-param name="books" select="//my:book"?> supported versions supported as of firefox 2.0.0.1.
Exported WebAssembly functions - WebAssembly
an example let's look at an example to clear things up (you can find this on github as table-set.html; see it running live also, and check out the wasm text representation): var othertable = new webassembly.table({ element: "anyfunc", initial: 2 }); webassembly.instantiatestreaming(fetch('table.wasm')) .then(obj => { var tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 othertable.set(0,tbl.get(0)); othertable.set(1,tbl.get(1)); ...
...next, we use set() to make the othertable table contain references to the same functions as the tbl table.
Communicating With Other Scripts - Archive of obsolete content
r tabs = require("sdk/tabs"); var mod = require("sdk/page-mod"); var self = require("sdk/self"); var pageurl = self.data.url("page.html") var pagemod = mod.pagemod({ include: pageurl, contentscriptfile: self.data.url("content-script.js"), contentscriptwhen: "ready" }) tabs.open(pageurl); the target web page "page.html" includes a button and a page script: <html> <head> <meta charset="utf-8"> </head> <body> <input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcusto...
Cross-domain Content Scripts - Archive of obsolete content
ml> the "panel-script.js" uses xmlhttprequest to fetch the latest forecast: // panel-script.js var url = "http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/json/500?key=your-api-key"; self.port.on("show", function () { var request = new xmlhttprequest(); request.open("get", url, true); request.onload = function () { var jsonresponse = json.parse(request.responsetext); var summary = getsummary(jsonresponse); var element = document.getelementbyid("forecast_summary"); element.textcontent = summary; }; request.send(); }); function getsummary(forecast) { return forecast.regionalfcst.fcstperiods.period[0].paragraph[0].$; } finally, we need to add the "cross-domain-content" key to "package.json": "permissions": { "cross-domain-content": [...
port - Archive of obsolete content
for example, to include an array of strings in the payload: // main.js var pagemods = require("sdk/page-mod"); var self = require("sdk/self"); var pagemod = pagemods.pagemod({ include: ['*'], contentscriptfile: self.data.url("content-script.js"), onattach: setuplistener }); function setuplistener(worker) { worker.port.on('loaded', function(pageinfo) { console.log(pageinfo[0]); console.log(pageinfo[1]); }); } //content-script.js self.port.emit('loaded', [ document.location.tostring(), document.title ]); ...
Content Processes - Archive of obsolete content
content workers combine these ideas, allowing you to inject a content script into a content process, and automatically set up a communication channel between them.
SDK API Lifecycle - Archive of obsolete content
unstable the api is in the process of settling, but has not yet had sufficient real-world testing to be considered stable.
SDK and XUL Comparison - Archive of obsolete content
the sdk's supported apis expose a relatively small set of this functionality.
Two Types of Scripts - Archive of obsolete content
so there are two distinct sorts of javascript scripts you might include in your add-on and they have access to different sets of apis.
Working with Events - Archive of obsolete content
for example, the following add-on registers a listener with the tabs module to listen for the ready event, and logs a string to the console reporting the event: var tabs = require("sdk/tabs"); tabs.on("ready", function () { console.log("tab loaded"); }); it is not possible to enumerate the set of listeners for a given event.
l10n - Archive of obsolete content
globals functions get(identifier, count, placeholder1...n) this function takes a string parameter which it uses as an identifier to look up and return a localized string in the locale currently set for firefox.
private-browsing - Archive of obsolete content
opting into private browsing add-ons built using the sdk must opt into private browsing by setting the following key in their package.json file: "permissions": {"private-browsing": true} if an add-on has not opted in, then the high-level sdk modules will not expose private windows, or objects (such as tabs) that are associated with private windows: the windows module will not list any private browser windows, generate any events for private browser windows, or let the add-on open a...
windows - Archive of obsolete content
windows.open("http://www.example.com"); // open a new window and set a listener for "open" event.
chrome - Archive of obsolete content
the chrome module gives an add-on sdk add-on access to the components object, which in turn gives it access to a large set of privileged low-level firefox apis.
console/plain-text - Archive of obsolete content
it's implemented using console.jsm, and is prefixed with the addon's name, and log levels set based off of startup instruction.
content/symbiont - Archive of obsolete content
usage a symbiont loads the specified contenturl and content scripts into a frame, and sets up an asynchronous channel between the content scripts and the add-on code, enabling them to exchange messages using the port or postmessage apis.
core/namespace - Archive of obsolete content
let { dom } = require('./view'); widget.prototype.setinnerhtml = function setinnerhtml(html) { dom(this).element.innerhtml = string(html); }; ...
frame/utils - Archive of obsolete content
usage module exports create function that takes the nsidomdocument of a privileged document and creates a browser element in its documentelement: let { open } = require('sdk/window/utils'); let { create } = require('sdk/frame/utils'); let window = open('data:text/html,foo'); let frame = create(window.document); optionally create can be passed set of options to configure created frame even further.
preferences/event-target - Archive of obsolete content
this enables add-ons to listen to change events to the system-wide settings.
system/child_process - Archive of obsolete content
the sdk versions don't: so when you specify a command you must pass in a complete path to the command or use the env option to set up the child process environment.
system/events - Archive of obsolete content
var events = require("sdk/system/events"); var { ci } = require("chrome"); function listener(event) { var channel = event.subject.queryinterface(ci.nsihttpchannel); channel.setrequestheader("user-agent", "mybrowser/1.0", false); } events.on("http-on-modify-request", listener); globals functions emit(type, event) send an event to observer service parameters type : string the event type.
test/harness - Archive of obsolete content
experimental test harness setup and execution.
ui/toolbar - Archive of obsolete content
event is emitted when the toolbar has been destroyed: var { toolbar } = require("sdk/ui/toolbar"); var { frame } = require("sdk/ui/frame"); var frame = new frame({ url: "./frame.html" }); var toolbar = toolbar({ title: "my toolbar", items: [frame] }); toolbar.on("attach", attached); toolbar.on("detach", detached); function attached() { console.log("attached"); require("sdk/timers").settimeout(destroytoolbar, 1000); } function destroytoolbar() { toolbar.destroy(); } function detached() { console.log("detached"); } show this event is emitted when the user shows the toolbar.
util/array - Archive of obsolete content
let { fromiterator } = require('sdk/util/array'); let i = new set(); i.add('otoro'); i.add('unagi'); i.add('keon'); fromiterator(i) // ['otoro', 'unagi', 'keon'] parameters iterator : iterator the iterator object over which to iterate and place results into an array.
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.
jpm-mobile - Archive of obsolete content
after that you can install jpm just as you would any other npm package: npm install jpm-mobile -g depending on your setup, you might need to run this as an administrator: sudo npm install jpm-mobile -g at the command prompt, type: jpm-mobile you should see a screen summarizing the available jpm-mobile commands.
package.json - Archive of obsolete content
permissions an object describing the set of permissions that the add-on needs.
Storing annotations - Archive of obsolete content
annotation list html and css here's the html for the annotation list: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>saved annotations</title> <link rel="stylesheet" type="text/css" href="annotation-list.css" /> </head> <body> <div id="annotation-list"> </div> <div id="template"> <div class="annotation-details"> <a class="url"></a> <div class="selection-text"></div> <div class="annotation-text"></div> </div> </div> </body> </html> here's the corresponding css: #annot...
Creating Event Targets - Archive of obsolete content
ng from four modules: event/core gives us emit(): note that we don't need on, once, or off, since we will use eventtarget for adding and removing listeners event/target gives us eventtarget, which implements the interface for adding and removing listeners core/heritage gives us class(), which we can use to inherit from eventtarget util/object gives us merge(), which just simplifies setting up the bookmarkmanager's properties we use class to inherit from eventtarget.
Display a Popup - Archive of obsolete content
// // set the focus to the text area so the user can // just start typing.
Getting started (cfx) - Archive of obsolete content
this means that if you want to see output from console.log() messages, you'll have to tweak a setting.
Developing for Firefox Mobile - Archive of obsolete content
setting up the environment first you'll need an android device capable of running the native version of firefox mobile.
Add-on SDK - Archive of obsolete content
this guide includes a comparison of the two toolsets and a working example of porting a xul add-on.
Cookies - Archive of obsolete content
setting a cookie the following code demonstrates how to set a cookie in firefox.
Customizing the download progress bar - Archive of obsolete content
defaultcreatedownloaditem : null, init : function fdm_init() { mydownloadmanager.defaultcreatedownloaditem = window.createdownloaditem; window.createdownloaditem = function(aattrs) { var dl = mydownloadmanager.defaultcreatedownloaditem(aattrs); if (dl) { if (...whatever condition you use to decide whether to change this download...) { dl.setattribute("myspecialdownload", "true"); } } return dl; } } }; window.addeventlistener("load", function(e) { mydownloadmanager.init(); }, false); in your css file, change richdownloaditem (both occurrences) to richdownloaditem[myspecialdownload="true"].
Finding window handles - Archive of obsolete content
.treeowner .queryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsibasewindow); var hwndstring = basewindow.nativehandle; components.utils.import('resource://gre/modules/ctypes.jsm'); var user32 = ctypes.open('user32.dll'); /* http://msdn.microsoft.com/en-us/library/ms633539%28v=vs.85%29.aspx * bool winapi setforegroundwindow( * __in_ hwnd hwnd * ); */ var setforegroundwindow = user32.declare('setforegroundwindow', ctypes.winapi_abi, ctypes.bool, // return bool ctypes.voidptr_t // hwnd ); var hwnd = ctypes.voidptr_t(ctypes.uint64(hwndstring)); var rez_setforegroundwindow = setforegroundwindow(hwnd); console.log('rez_setforegroundwindow:', rez_setforegroundwindow, rez_setforegroundwindow.
JS XPCOM - Archive of obsolete content
faces; function abouthandler() {} abouthandler.prototype = { newchannel: function(uri) { var channel = services.io.newchannel("chrome://mystuff/content/mystuff.xul", null, null); channel.originaluri = uri; return channel; }, geturiflags: function(uri) { // do not return ci.nsiaboutmodule.uri_safe_for_untrusted_content unless // you make sure to set a non-system principal in newchannel.
LookupNamespaceURI - Archive of obsolete content
however, due to bug 312019, this method does not work with dynamically assigned namespaces (e.g., those set with node.prefix).
Progress Listeners - Archive of obsolete content
firefox 3.5 includes a way to set up a listener for all tabs, selected and not: listening to events on all tabs.
Tabbox - Archive of obsolete content
handling onclosetab event assuming the tabbox, tabs, and tabpanels widgets with id's the same as their nodename, this function will correctly remove the current tab and tab panel for the onclosetab tabs event: function removetab(){ var tabbox = document.getelementbyid("tabbox"); var currentindex = tabbox.selectedindex; if(currentindex>=0){ var tabs=document.getelementbyid("tabs"); var tabpanels=document.getelementbyid("tabpanels"); tabpanels.removechild(tabpanels.childnodes[currentindex]); tabs.removeitemat(currentindex); /*wo...
Delayed Execution - Archive of obsolete content
queuing a task in the main event loop when a task needs to be only briefly delayed, such that it runs after the current call chain returns, it can be added directly to the main thread's event queue rather than scheduled as a timeout: function executesoon(func) { services.tm.mainthread.dispatch(func, ci.nsithread.dispatch_normal); } using nsitimers to schedule tasks in instances where settimeout() and setinterval() are unavailable, or insufficient, tasks can be scheduled with delays using nsitimer instances.
Toolbar - Archive of obsolete content
var toolbar = document.getelementbyid(toolbarid); // if no afterid is given, then append the item to the toolbar var before = null; if (afterid) { let elem = document.getelementbyid(afterid); if (elem && elem.parentnode == toolbar) before = elem.nextelementsibling; } toolbar.insertitem(id, before); toolbar.setattribute("currentset", toolbar.currentset); document.persist(toolbar.id, "currentset"); if (toolbarid == "addon-bar") toolbar.collapsed = false; } } if (firstrun) { installbutton("nav-bar", "my-extension-navbar-button"); // the "addon-bar" is available since firefox 4 installbutton("addon-bar", "my-extension-addon-bar-button"); } ...
Windows - Archive of obsolete content
you could improve this code by checking the event.target element and only setting the startpos if the element matches some criteria.
Custom about: URLs - Archive of obsolete content
setup for firefox 4+ this is a simple example of a custom about page for bootstrapped addons.
Displaying web content in an extension without security issues - Archive of obsolete content
so in the simplest case you would have: <iframe type="content" src="data:text/html,%3chtml%3e%3cbody%3e%3c/body%3e%3c/html%3e"/> but usually you don’t want to start with an empty document, you would rather want to load some template into the frame: var request = new xmlhttprequest(); request.open("get", "chrome://foo/content/template.html", false); request.send(null); frame.setattribute("src", "data:text/html," + encodeuricomponent(request.responsetext)); that way you can have the template in your extension but still strip it off all privileges when it is loaded in a frame.
Extension Packaging - Archive of obsolete content
when using this method you must verify that the file system permissions for the directories, and files for the extension, are set properly.
Extension Theming Guidelines - Archive of obsolete content
this is a set of guidelines on how to control the look and feel of your extension while leaving it open for styling by custom themes.
Extension Etiquette - Archive of obsolete content
however, please make sure the default set of preferences is adequate — don't require people to tweak options in order to get your extension's core functionality.
Migrating raw components to add-ons - Archive of obsolete content
if you would like to install firefox add-ons in an automated, programmatic way, we have documented a set of best practices.
Appendix: What you should know about open-source software licenses - Archive of obsolete content
it makes explicit that any modifications of code released under it must also be released under the same license, while setting practical limits.
Local Storage - Archive of obsolete content
s is a fatal message."); this._logger.error("this is an error message."); this._logger.warn("this is a warning message."); this._logger.info("this is an info message."); this._logger.config("this is a config message."); this._logger.debug("this is a debug message."); this._logger.trace("this is a trace message."); you can filter the output of the global logger or any specific logger instance by setting the level property.
XUL School Tutorial - Archive of obsolete content
introduction introduction getting started with firefox extensions the essentials of an extension setting up a development environment javascript object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics t...
Overlay extensions - Archive of obsolete content
more resources setting up your environment setting up the application for extension development.
Extensions support in SeaMonkey 2 - Archive of obsolete content
is: <vbox id="browser-bottombox"> <something insertbefore="status-bar" /> </vbox> use the following technique to make your overlay work on both seamonkey 2 and firefox 3: <window id="main-window"> <vbox id="browser-bottombox" insertbefore="status-bar"> <something insertbefore="status-bar" /> </vbox> </window> thunderbird 3 gfolderdisplay api seamonkey 2.0 only supports a reduced set of methods: selectedcount selectedmessage selectedmessageisfeed selectedmessageisimap selectedmessageisnews selectedmessageisexternal selectedindices selectedmessages selectedmessageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascript tweaks firefox supports some shorthand in various places.
Security best practices in extensions - Archive of obsolete content
sandboxed http connections the main purpose of sandboxed http connections is to interact with a web service, without interfering with the cookies set in the browser by that service/site.
Case Sensitivity in class and id Names - Archive of obsolete content
class = cdata-list [cs] this attribute assigns a class name or set of class names to an element.
Install.js - Archive of obsolete content
['classic', 'modern'] extpostinstallmessage: null, // set to null for no post-install message // --- editable items end --- profileinstall: true, silentinstall: false, install: function() { var jarname = this.extshortname + '.jar'; var profiledir = install.getfolder('profile', 'chrome'); // parse http arguments this.parsearguments(); // check if extension is already installed in profile if (file.exists(install.getfolder(profil...
cert_override.txt - Archive of obsolete content
the key and the website are not valid: # psm certificate override settings file # this is a generated file!
Defining Cross-Browser Tooltips - Archive of obsolete content
on the other hand, the html 4.01 definition of the title attribute states: title = text cs this attribute offers advisory information about the element for which it is set.
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
assuming you have cvs somewhere in your path, type this from a command prompt: c:\> set cvsroot=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot c:\> set home=\temp c:\> cvs login (logging in to anonymous@cvs-mirror.mozilla.org) cvs password: anonymous c:\> cvs -z3 co mozilla/embedding/browser/activex/src/pluginhostctrl this fetches the source for the control into mozilla\embedding\browser\activex\src\pluginhostctrl.
Automated testing tips and tricks - Archive of obsolete content
tent/quit.xul how to create a new profile from the command line first, use the -createprofile command line flag to add a profile entry to profiles.ini and populate the new profile directory with a prefs.js file firefox-bin -createprofile "testprofile ${profile_dir}/testprofile" next, start firefox to populate the new profile directory with the rest of the default settings firefox-bin -p testprofile -chrome chrome://tests/content/quit.xul<code> the above process may exit before the profile is completely created.
Enabling quicklaunch for all users - Archive of obsolete content
enabling quicklaunch for all users unlike all other settings, quicklaunch is stored in the windows registry.
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
here is an example of what this may look like: [general] startwithlastprofile=1 [profile0] name=default isrelative=1 path=profiles/default.uda if you want to point this to a location of your choice (for example h:\thunderbird), you need to perform to changes: set isrelative to be 0 update the path to point to the desired place.
Introduction - Archive of obsolete content
moreover, we want to lock certain settings, so that users cannot change them.
Kill the XUL.mfl file for good - Archive of obsolete content
unfortunately, there appears to be no "clean" way of doing so (javascript command in prefs.js or registry setting).
Automatic Mozilla Configurator - Archive of obsolete content
ozilla configurator:how mozilla finds its configuration files automatic mozilla configurator:how thunderbird and firefox find their configuration files automatic mozilla configurator:protecting mozilla's registry.dat file automatic mozilla configurator:enabling quicklaunch for all users automatic mozilla configurator:kill the xul.mfl file for good automatic mozilla configurator:locked config settings automatic mozilla configurator:other mozilla customization pages online configurator tools: registry.dat mozilla.cfg (locked preferences) ...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
build create a new project in visual studio for a win32 gui library (dll) (in .net 2003: win32 template, then switch to dll in application settings in the following dialog, export symbols too?)(in visual studio 2008, it is visualc++|win32|win32 project, then check dll in the wizard).
Enabling the behavior - retrieving tinderbox status - Archive of obsolete content
we use new to create a new instance of it, set the instance's onload property to updatetinderboxstatus(), the function we want to execute when the document finishes loading, call its open method with the type of http request we want to make and the url of the document to retrieve, and then call its send method to send the request.
Enabling the behavior - updating the status periodically - Archive of obsolete content
function loadtinderboxstatus() { gxmlhttprequest = new xmlhttprequest(); gxmlhttprequest.onload = updatetinderboxstatus; gxmlhttprequest.open("get", "http://tinderbox.mozilla.org/seamonkey/panel.html"); gxmlhttprequest.send(null); window.settimeout(loadtinderboxstatus, 60000); } window.settimeout(loadtinderboxstatus, 1000); window.settimeout schedules functions to run at some future time.
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
</rdf:seq> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://tinderstatus/content/tinderstatusoverlay.xul</rdf:li> </rdf:seq> </rdf:rdf> install.js, on the other hand, goes into the tinderstatus-installer directory: initinstall( "mozilla tinderstatus extension", "/mozdev/tinderstatus", "0.1"); var installdir = getfolder("chrome","tinderstatus"); setpackagefolder(installdir); adddirectory("tinderstatus"); registerchrome( content | delayed_chrome, getfolder(installdir, "content")); var result = performinstall(); if ( result != success ) cancelinstall(result); once all the files are in place, use your zip utility from within the tinderstatus-installer directory to create a zip archive called tinderstatus.xpi with install.js and ...
Tinderbox - Archive of obsolete content
it consists of a set of client machines that continuously build and test mozilla and report their results back to a server that makes those results available via a web page.
Getting Started - Archive of obsolete content
install your new theme before you can see the changes you make to a seamonkey theme (since live edits are restrictively difficult to set up) you must first learn how to repackage the classic theme to make it installable.
Creating a Skin for Mozilla - Archive of obsolete content
contents getting started setup changing borders and colours changing images creating the install script in-depth system colours mozilla css commands how do i know what to modify?
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
install your new theme before you can see the changes you make to a firefox theme (since live edits are restrictively difficult to set up) you must first learn how to repackage the classic theme to make it installable.
Dehydra Frequently Asked Questions - Archive of obsolete content
does dehydra provide any adts such as map/set?
Embedding FAQ - Archive of obsolete content
r; import org.eclipse.swt.widgets.display; import org.eclipse.swt.widgets.shell; import org.mozilla.xpcom.nsidomdocument; public class test { public static void main(string args[]) { display display = new display(); shell shell = new shell(display); final mozillabrowser browser = new mozillabrowser(shell,wt.border); browser.seturl("http://www.google.com"); browser.addprogresslistener(new progresslistener() { public void changed(progressevent event) { } public void completed(progressevent event) { nsidomdocument doc = browser.getdocument(); system.out.println(doc); ...
Building Firefox with Rust code - Archive of obsolete content
you can use it to check that rust is enabled and working with your build setup.
JSS build instructions for OSX 10.6 - Archive of obsolete content
setting ld_library_path didnt work ...
Gecko Coding Help Wanted - Archive of obsolete content
you're up for some adventure, though, and you're set to take the plunge.
Hidden prefs - Archive of obsolete content
address book "get map" button pref ("mail.addr_book.mapit_url.format" ) the format for this pref is: @a1 == address, part 1 @a2 == address, part 2 @ci == city @st == state @zi == zip code @co == country if the pref is set to "", no "get map" button will appear in the addressbook card preview pane.
Enabling Experimental Jetpack Features - Archive of obsolete content
list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import().
Enabling - Archive of obsolete content
list()returns an array of the set of potential stringmountpath as used in jetpack.future.import().
Meta - Archive of obsolete content
first run control over the content and experience of your jetpack's initial use me introspection of your jetpack's dynamic state settings interface for defining and accessing user settings with built-in ui ...
Jetpack Snippets - Archive of obsolete content
sing firebug lite in a slidebar jetpack.future.import("slidebar");jetpack.slidebar.append({ html: <html><head></head><body> <p>some slidbar you want to debug</p> <a href="javascript:console.log('hello!')">test</a> <script><![cdata[ //firebug lite bookmarklet code: var firebug=document.createelement('script'); firebug.setattribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'); document.body.appendchild(firebug); (function(){if(window.firebug.version){firebug.init();}else{settimeout(arguments.callee);}})();void(firebug); ]]></script> </body></html>, width: 800, //wide enough to use firebug onselect: function(slide) { sli...
Storage - Archive of obsolete content
simple storage an easy-to-use persistent object data store file access interface for performing file i/o settings settings persist across browser sessions and are accessible to jetpacks via simple object retrieval and assignment.
Clipboard Test - Archive of obsolete content
features can get and set the clipboard in various flavors of data type.
Enabling Experimental Jetpack Features - Archive of obsolete content
ArchiveMozillaJetpackdocsMetaFuture
list() arrayreturns an array of the set of potential stringmountpath as used in jetpack.future.import().
Litmus tests - Archive of obsolete content
bfts, or basic functionality tests this set of tests would take longer to run, but will cover an entire release.
Makefile.mozextension.2 - Archive of obsolete content
04/em-rdf#"> <description about="urn:mozilla:install-manifest"> <id>$(project_id)</id> <name>$(project_name)</name> <version>$(project_version)</version> <description>$(project_desc)</description> <creator>$(project_author)</creator> <contributor>here is a place for you who helped me</contributor> <homepageurl>http://$(project).mozdev.org/</homepageurl> <optionsurl>chrome://$(project)/content/settings.xul</optionsurl> <abouturl>chrome://$(project)/content/about.xul</abouturl> <iconurl>chrome://$(project)/skin/mainicon.png</iconurl> <updateurl>http://$(project).mozdev.org/update.rdf</updateurl> <type>2</type> <targetapplication> <description> <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id> <minversion>2.0</minversion> <maxversion>9.0</maxversion> </description> </targetap...
Measuring add-on startup performance - Archive of obsolete content
to test with about:startup, you should set up a new firefox profile, install this add-on, and then open and quit firefox repeatedly.
LIR - Archive of obsolete content
the lir instruction set is best learnt by reading nanojit/liropcode.tbl.
New Security Model for Web Services - Archive of obsolete content
quite complex settings may be required to permit the user to allow access to desired external services without risking other resources.
Porting NSPR to Unix Platforms - Archive of obsolete content
nspr has a user-level threading library where thread context switches are done by <tt>setjmp/longjmp</tt> or <tt>sigsetjmp/siglongjmp</tt>.
Bundles - Archive of obsolete content
the bundle can hold additional resources currently limited to: application ini settings application icon script for the application chrome, not the web content installing a bundle when prism opens a webapp bundle it will unpack it into the webapps/{webapp-id} folder.
HostWindow - Archive of obsolete content
to display the status bar, the statusbar option in webapp.ini must be set to true.
Remote XUL - Archive of obsolete content
this also means you can't load xul using file:// urls unless you set the preference dom.allow_xul_xbl_for_file to true.
Standard Makefile Header - Archive of obsolete content
this header sets variables which tell the makefile where it is and where the source directory is, and then include autoconf.mk, to pick up makefile variables which are set during configuration.
Static Analysis for Windows Code under Linux - Archive of obsolete content
hg clone http://hg.mozilla.org/users/tglek_mo...-moz-plugin-mq .hg/patches # apply gty.diff and plugin.diff # if you have mq setup, do hg qpush -a (for file in `cat .hg/patches/series`; do cat .hg/patches/$file; done) |patch -p1 cd ..
Stress testing - Archive of obsolete content
also be warned: always remember the -time option, or you may be hitting that physical reset button sooner than you would have liked!
Table Cellmap - Archive of obsolete content
#define span 0x00000001 // there a row or col span #define row_span 0x00000002 // there is a row span #define row_span_0 0x00000004 // the row span is 0 #define row_span_offset 0x0000fff8 // the row offset to the data containing the original cell #define col_span 0x00010000 // there is a col span #define col_span_0 0x00020000 // the col span is 0 #define overlap 0x00040000 // there is a row span and col span but no by same cell #define col_span_offset 0xfff80000 // the col offset to the data containing the original cell #define row_span_shift ...
Table Layout Strategy - Archive of obsolete content
min_con des_con fix min_adj des_adj fix_adj pct pct_adj min_pro final the width parameter have the following meaning: #define width_not_set -1 #define num_widths 10 #define num_major_widths 3 // min, des, fix #define min_con 0 // minimum width required of the content + padding #define des_con 1 // desired width of the content + padding #define fix 2 // fixed width either from the content or cell, col, etc.
Abc Assembler Tests - Archive of obsolete content
pushnull convert_o pop findproperty fail pushstring "convert_o null" pushstring "exception should have been thrown: typeerror: error #1009: cannot access a property or method of a null object reference." getlocal1 callpropvoid fail 3 jump finished_convert_o_null } .catch { getlocal0 pushscope setlocal2 // save typeerror findproperty compare_typeerror pushstring "convert_o null" // test name pushstring "typeerror: error #1009" // expected getlocal2 // actual callpropvoid compare_typeerror 3 } finished_convert_o_null: } ...
Tamarin Acceptance Test Template - Archive of obsolete content
this is the test template for tamarin acceptance tests (placed in test/acceptance/feature_name): /* -*- mode: js; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */ /* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */ /* ***** begin license block ***** * version: mpl 1.1/gpl 2.0/lgpl 2.1 * * the contents of this file are subject to the mozilla public license version * 1.1 (the "license"); you may not use this file except in compliance with * the license.
Cmdline tests - Archive of obsolete content
two use cases for the cmdline testsuite: use case 1: test the interactive cmdline debugger test contents: start avmshell -d test.abc, set breakpoint on a line, show local variable value, quit from cmdutils import * def run(): r=runtestlib() r.run_test( 'debugger locals', '%s -d testdata/debug.abc'%r.avmrd, input='break 53\ncontinue\nnext\ninfo locals\nnext\ninfo locals\nquit\n', expectedout=['local1 = undefined','local2 = 10','local2 = 15'] ) use case 2: test -memstats returns memory logs to std...
Tamarin Acceptance Testing - Archive of obsolete content
to build and setup the tools see building_tamarin_windows_mobile_utilities.
Tamarin-central rev 703:2cee46be9ce0 - Archive of obsolete content
-700740k tc-703655k known issues known failures in the acceptance testsuite include: number failures in testsuite when running on linux windows mobile system.privatebytes and -memstats privatebytes always returns 0 amd64 longjmp hack needs reengineering on non-windows platforms different runtime errors when -dforcemir set in acceptance test run arm: math failures running with thumb or arm jit and interp.
Tamarin - Archive of obsolete content
it currently implements adobe actionscript™ 3 (a superset of ecmascript edition 3) and is embedded within the adobe® flash® player versions 9 and later.
Tuning Pageload - Archive of obsolete content
firefox (and all mozilla products/projects which do page-loading) ship with what are considered the "best" settings for the most cases.
Using cross commit - Archive of obsolete content
if you don't, however, then from the parent directory of your source dir, do: cvs co mozilla/tools/cross-commit note that you will need to have $cvsroot and such set up correctly for this to work.
[Deprecated] The Mozilla build VM - Archive of obsolete content
thanks to significant improvements in our build environment setup process, it's much simpler and easier to get set up and stay up to date by starting with building firefox instead.
When To Use ifdefs - Archive of obsolete content
there are three major kinds of ifdefs in use in the mozilla tree: platform/widget ifdefs, feature ifdefs, and application-specific ifdefs: platform/widget ifdefs the mozilla code will frequently need to differentiate between code for different platforms or widget sets.
Event Handlers - Archive of obsolete content
when set, the corresponding fields in the event object must match for the event to fire.
XBL 1.0 Reference - Archive of obsolete content
bindings binding content children implementation constructor destructor field property getter setter method parameter body handlers handler resources stylesheet image binding attachment and detachment attachment using css attachment using element.style property <constructor> call <destructor> call binding documents dom interfaces the nsidomdocumentxbl interface anonymous content introduction scoping and access using the dom content generation rules for gener...
XBL - Archive of obsolete content
it is supposed to include a subset of xbl 2.0 features needed for svg.
Install.addDirectory - Archive of obsolete content
var vi = "10.10.10.10"; var xpisrc = "adddir1"; initinstall("addfilenovers1", "adddir_1", vi, 1); f = getfolder("program"); setpackagefolder(f); err = adddirectory(xpisrc); logcomment("the error = " + err); if (0 == getlasterror()) performinstall(); else cancelinstall(); ...
Install.addFile - Archive of obsolete content
var xpisrc = "file.txt"; initinstall( "adding a file", "testfile", "1.0.1.7", 1); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); if (0 == getlasterror()) performinstall(); else cancelinstall(); ...
addFile - Archive of obsolete content
example var xpisrc = "file.txt"; initinstall("adding a file", "addfile", "1.0.1.7", 1); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); if (0 == getlasterror()) performinstall(); else cancelinstall(); ...
cancelInstall - Archive of obsolete content
example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code: initinstall("royal airways tripplanner","/royalairways/ tripplanner","1.0.0.0"); ...
confirm - Archive of obsolete content
abuttonflags a set of flags defining the buttons that should appear in the dialog.
getLastError - Archive of obsolete content
description use getlasterror method to obtain the most recent nonzero error code since initinstall or reseterror were called.
performInstall - Archive of obsolete content
example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code: initinstall("royal airways tripplanner", "/royalairways/tripplanner", "1.0.0.0"); ...
refreshPlugins - Archive of obsolete content
example // install dll into plugins // install xpt into components var xpisrc = "npmcult3dp.dll"; var xpisrc2 = "nsic3dpscriptablepeer.xpt"; initinstall( "cult3d plugin file", "@cycore.com/cult3d;version=1.0.0", "1.0.0"); setpackagefolder(getfolder("plugins")); addfile(xpisrc); addfile("",xpisrc2,getfolder("components"),""); var err = getlasterror(); if (err == success) { err = performinstall(); if (err == success) refreshplugins(); } else cancelinstall(err); ...
Properties - Archive of obsolete content
note that due to branching (different versions of gecko with different feature sets might be built on the same day), using this property to "detect" the application version may produce false results.
writeString - Archive of obsolete content
example to set the name of the wallpaper file from the desktop section of the win.ini file, use this call: ini = getwinprofile (getfolder("windows"), "win.ini"); ini.writestring ("desktop", "wallpaper", "newpathname"); ...
enumKeys - Archive of obsolete content
var winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_local_machine); var index = 0; var basekey = "software\\mozilla"; while ( (mozillaversion = winreg.enumkeys(basekey,index)) != null ) { logcomment("mozillaversion = " + mozillaversion); subkey = basekey + "\\" + mozillaversion + "\\extensions"; pluginsdir = winreg.getvaluestring ( subkey, "plugins" ); if ( pluginsdir ) logcomment("pluginsdir = " + pluginsdir); el...
enumValueNames - Archive of obsolete content
var winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_local_machine); v1 = winreg.enumvaluenames("software\\mozilla\\", 0); logcomment("the first subkey value of the mozilla key: " + v1) ...
isKeyWritable - Archive of obsolete content
example winreg = getwinregistry(); if ( winreg != null ) { winreg.setrootkey ( winreg.hkey_local_machine ); if(winreg.iskeywritable("software")) { //iskeywritable returned true } else { //iskeywritable returned false } ...
keyExists - Archive of obsolete content
example winreg = getwinregistry(); if ( winreg != null ) { winreg.setrootkey( winreg.hkey_local_machine); if(winreg.keyexists("software\\mozilla")) { //keyexists returned true } else { //keyexists returned false } } ...
valueExists - Archive of obsolete content
example winreg = getwinregistry(); if ( winreg != null ) { winreg.setrootkey( winreg.hkey_local_machine); if(winreg.valueexists("software\\mozilla", "value name")) { //valueexists returned true } else { //valueexists returned false } } ...
WinRegValue - Archive of obsolete content
returns a new winregvalue object, with the data members type and data set to the values passed to this constructor.
Learn XPI Installer Scripting by Example - Archive of obsolete content
var xpisrc = "cd_ripper.exe"; var xpidoc = "readme_cdrip"; initinstall("my cd ripper", "cdrip", "1.0.1.7"); f = getfolder("program"); setpackagefolder(f); addfile(xpisrc); addfile(xpidoc); if (0 == getlasterror()) performinstall(); else cancelinstall(); the example above shows this minimal installation.
browserid - Archive of obsolete content
you should use the browser property to get and set this value from a script.
Flexgroup - Archive of obsolete content
"flexgroup" is used to group flexible elements together and should be set to an integer.
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.
treelines - Archive of obsolete content
« xul reference home treelines type: boolean when set to true, lines are drawn connecting the lines in the tree; when false, the lines are not drawn.
accelerated - Archive of obsolete content
« xul reference homeaccelerated type: booleanset this attribute to true to allow hardware layer managers to accelerate the window.
acceltext - Archive of obsolete content
if this value is set, it overrides an assigned key set in the key attribute.
accesskey - Archive of obsolete content
« xul reference home attribute of: button, checkbox, caption, description, label, listitem, menu, menuitem, menulist, tab, radio, toolbarbutton, textbox accesskey type: character this should be set to a character that is used as a shortcut key.
autocompleteenabled - Archive of obsolete content
« xul reference home autocompleteenabled type: boolean set to true to enable autocomplete of fields.
autofill - Archive of obsolete content
« xul reference home autofill new in thunderbird 3 requires seamonkey 2.0 type: boolean if set to true, the best match will be filled into the textbox as the user types.
backdrag - Archive of obsolete content
« xul reference home backdrag type: boolean setting the backdrag attribute on a xul panel lets the user move the panel by clicking and dragging anywhere on its background area.
button.type - Archive of obsolete content
menu set the type attribute to the value menu to create a button with a menu popup.
checkbox.src - Archive of obsolete content
« xul reference home src type: uri set this to an uri pointing to an image to appear in the checkbox.
close - Archive of obsolete content
« xul reference home close type: boolean if the panel has a titlebar, set the panel's close attribute to true to have a close button appear on the titlebar.
collapsed - Archive of obsolete content
it is equivalent to setting the css visibility property to collapse.
colorpicker.type - Archive of obsolete content
if this is set to the text button, the colorpicker is displayed as a button.
commandupdater - Archive of obsolete content
« xul reference home commandupdater type: boolean if true, the commandset is used for updating commands.
completedefaultindex - Archive of obsolete content
if set to false or omitted, the value must be selected from the list.
containment - Archive of obsolete content
it may be set to a space-separated list of rdf properties or resources.
context - Archive of obsolete content
« xul reference home context type: id should be set to the value of the id of the popup element that should appear when the user context-clicks on the element.
crop - Archive of obsolete content
ArchiveMozillaXULAttributecrop
depending on the platform and theme being used, some elements will have set a maximum width so they will always appear cropped.
current - Archive of obsolete content
« xul reference home current type: boolean this attribute will be set to true if the listitem is the current item.
cycler - Archive of obsolete content
if the cycler attribute is not set, the cell is a regular text cell.
datasources - Archive of obsolete content
if you plan on adding a datasource to an element but don't want one to be added right away, set this attribute to 'rdf:null'.
datepicker.type - Archive of obsolete content
« xul reference home type type: one of the values below you can set the type attribute to one of the values below to specify the type of datepicker to use normal a datepicker with three fields for entering the year, month and date.
disableKeyNavigation - Archive of obsolete content
this feature may be disabled by setting this attribute to true.
disablechrome - Archive of obsolete content
« xul reference home disablechrome type: boolean set this attribute to true to disable chrome in the window.
disablesecurity - Archive of obsolete content
« xul reference home disablesecurity type: boolean set this attribute to true to disable the security ui for this browser.
dlgtype - Archive of obsolete content
for example, if the dlgtype is set to accept, the button will replace the dialog box's accept button, which is usually labeled ok.
editor.type - Archive of obsolete content
« xul reference home type type: string if set to the string content-primary, this editor becomes the primary content for the page.
enableColumnDrag - Archive of obsolete content
« xul reference home enablecolumndrag type: boolean when set to true, the user may drag the column headers around to change the order in which they are displayed.
events - Archive of obsolete content
if this attribute is not specified, or you set it to the value '*', all events are valid.
fadein - Archive of obsolete content
« xul reference home fadein type: boolean this attribute is set to true if the tab is fading in or out.
flags - Archive of obsolete content
« xul reference home flags type: space-separated list of the values below a set of flags used for miscellaneous purposes.
fullscreenbutton - Archive of obsolete content
« xul reference home fullscreenbutton type: boolean set this attribute to true to display a button in the window chrome to allow the user to switch the window into full screen mode.
hidechrome - Archive of obsolete content
« xul reference home hidechrome type: boolean set this attribute to true to have the chrome including the titlebar hidden.
homepage - Archive of obsolete content
« xul reference home homepage type: url this attribute allows you to set a homepage for the browser element.
icon - Archive of obsolete content
ArchiveMozillaXULAttributeicon
« xul reference home icon mozilla 1.8 type: string this attribute should be used to set the usage for common buttons.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
example <button id="foo" label="click me" oncommand="dosomething()"/> <script> function dosomething(){ var mybutton = document.getelementbyid('foo'); mybutton.setattribute('label','the button was pressed'); } </script> a more abstract version of the above would be a <button id="foo" label="click me" oncommand="setwidgetlabel(this, 'i was pressed')"/> <script> function setwidgetlabel(idname, newcaption){ document.getelementbyid( idname.id ).setattribute('label',newcaption) } </script> not specifying the id attribute for a window or a prefwindow fill...
iframe.transparent - Archive of obsolete content
« xul reference hometransparenttype: one of the values belowset the background of an iframe as transparent.transparentthis results in the iframe's background being transparent.
ignorecase - Archive of obsolete content
« xul reference home ignorecase type: boolean set to true to indicate that the case does not matter when making comparisons.
inverted - Archive of obsolete content
« xul reference home inverted type: boolean for boolean preferences, if this attribute is set to true, it indicates that the value of the preference is the reverse of the user interface element attached to it.
key - Archive of obsolete content
ArchiveMozillaXULAttributekey
this should be set to a displayable character.
label - Archive of obsolete content
see also treeitem.label, <label> element examples in javascript <label value="whaw" id="the-big-label" command="the-big-button"/> <button id="the-big-button" label="click me" oncommand="alert(document.getelementbyid('the-big-label').value)"/> <label id="mylabel" value="my label"/> <button label="click me" oncommand="document.getelementbyid('mylabel').setattribute('value','value changed');" /> <checkbox label="my checkbox" id="mycheckbox"/> <button label="another click" oncommand="document.getelementbyid('mycheckbox').setattribute('label','still not checked');"/> <button label="show label of checkbox" oncommand="alert( document.getelementbyid('mycheckbox').getattribute('label') )"/> ...
lastSelected - Archive of obsolete content
« xul reference home lastselected type: string set this to the id of the last selected pane.
listitem.type - Archive of obsolete content
« xul reference home type type: string you can make an item in a listbox a checkbox by setting this attribute to the value checkbox.
max - Archive of obsolete content
ArchiveMozillaXULAttributemax
« xul reference home type: integer the maximum value that the scale or number box may be set to.
member - Archive of obsolete content
« xul reference home member type: string may optionally be set to the variable to use as the member variable.
menuactive - Archive of obsolete content
« xul reference home menuactive type: boolean this attribute is set on an item in a menu when it is being hovered over.
menuitem.key - Archive of obsolete content
« xul reference home key type: id set to the id of a key element whose key shortcut is displayed in the menuitem.
multiple - Archive of obsolete content
« xul reference home multiple type: boolean set to true to indicate that the value contains multiple values separated by commas.
negate - Archive of obsolete content
« xul reference home negate type: boolean set to true to indicate that the comparison should be reversed.
nomatch - Archive of obsolete content
« xul reference home nomatch type: boolean this attribute will be set to true if the last search resulted in no matches.
observes - Archive of obsolete content
« xul reference home observes type: id set to an id of a broadcaster element that is being observed by the element.
onpopupshowing - Archive of obsolete content
this handler is usually used to dynamically set the contents when the user requests to display it.
open - Archive of obsolete content
ArchiveMozillaXULAttributeopen
« xul reference home open type: boolean for the menu type buttons, the open attribute is set to true when the menu is open.
pageid - Archive of obsolete content
« xul reference home pageid type: id this attribute should be set to a string that identifies the page's identifer in the wizard.
panel.fade - Archive of obsolete content
« xul reference homefadetype: one of the values belowthe fade attribute, which may only be used with arrow panels, lets you set up a panel that will automatically fade away after a short time.
panel.flip - Archive of obsolete content
this attribute, set to both, permits that behavior.
parent - Archive of obsolete content
« xul reference home parent type: element tag name if set, the rule will only match the corresponding tag.
persist - Archive of obsolete content
persistence will not remember the absence of an attribute, so for boolean attributes like checked where absence means false, you will need to explicitly set the attribute to false before the window closes (bug 15232).
phase - Archive of obsolete content
this should be set to the value capturing to indicate during the event capturing phase or target to indicate at the target element or left out entirely for the bubbling phase.
pinned - Archive of obsolete content
« xul reference home pinned type: boolean this attribute is set to true if the tab has been pinned (that is, if it's an app tab).
popup - Archive of obsolete content
« xul reference home popup type: id should be set to the value of the id of the popup element that should appear when the user clicks on the element.
preference.name - Archive of obsolete content
for example, the browser's home page is set with the preference browser.startup.homepage.
preference.type - Archive of obsolete content
bool a boolean set to either true or false.
prefpane.selected - Archive of obsolete content
« xul reference home selected type: boolean this attribute will be set to true for the currently selected prefpane.
prefwindow.type - Archive of obsolete content
« xul reference home type type: string set this attribute to child for preference dialogs that are child dialogs of a main preferences window.
progressmeter.value - Archive of obsolete content
for instance, if no maximum value has been set, setting the value to "0" shows an empty bar, "100" shows a bar at full length and "25" shows the first quarter of the bar.
properties - Archive of obsolete content
« xul reference home properties type: space-separated list of property names sets the properties of the element, which can be used to style the element.
readonly - Archive of obsolete content
« xul reference home readonly type: boolean if set to true, then the user cannot change the value of the element.
reserved - Archive of obsolete content
setting this attribute to "true" indicates that the command is reserved for chrome code and is not available for use in the content.
resizer.type - Archive of obsolete content
« xul reference hometypetype: stringset this to the value "window" for a resizing grip that appears in the bottom corner of the window, used for resizing the window.
selected - Archive of obsolete content
to change the selection, set either the selectedindex or selecteditem property of the containing element.
selectedIndex - Archive of obsolete content
« xul reference home selectedindex type: integer gets and sets the index of the currently selected panel.
showpopup - Archive of obsolete content
you can set this to false and set the autofill attribute to true to emulate a communicator 4.x style autocomplete textbox.
sizemode - Archive of obsolete content
setting this attribute does not change the window state.
sizetopopup - Archive of obsolete content
if the sizetopopup attribute is left out or set to none, the menu will be its preferred width and the popup may extend outside of this width, unaffected by the maximum width of the menu itself.
sort - Archive of obsolete content
ArchiveMozillaXULAttributesort
« xul reference home sort type: uri or xml attribute set this to a rdf property or xml attribute to have the data in the column sorted based on that property.
sortActive - Archive of obsolete content
« xul reference home sortactive type: boolean this should be set to true for the column which should be sorted by default.
sortDirection - Archive of obsolete content
« xul reference home sortdirection type: one of the values below set this attribute to set the direction that template-generated content is sorted.
statusbar - Archive of obsolete content
« xul reference home statusbar type: id if you set this attribute to the id of a statusbar element, the label on the statusbar will update to the statustext of the items on the menu as the user moves the mouse over them.
suppressonselect - Archive of obsolete content
if set to true, the select event is never fired.
tab.selected - Archive of obsolete content
« xul reference home selected type: boolean this attribute is set to true if the tab is selected by default.
targets - Archive of obsolete content
if this attribute is not specified, or you set it to the value '*', all elements are valid.
template.container - Archive of obsolete content
« xul reference home container type: string may optionally be set to the variable to use as the container or reference variable.
template - Archive of obsolete content
this template attribute should be set to the id of the template element.
textbox.autoFill - Archive of obsolete content
« xul reference home autofill obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif set to true, the best match will be filled into the textbox as the user types.
textbox.disablehistory - Archive of obsolete content
this attribute only works correctly in seamonkey 1.x; for thunderbird and seamonkey 2.0 you should also set the enablehistory attribute; as of gecko 2.0 this attribute is completely superseded by it.
timeout - Archive of obsolete content
if the user types another character, the timer resets.
timepicker.increment - Archive of obsolete content
this should be used in combination with setting hideseconds to true.
toolbarbutton.title - Archive of obsolete content
it overrides the value of label, which is used if title is not set.
tooltiptextnew - Archive of obsolete content
« xul reference home tooltiptextnew not in firefox type: string used to set the text which appears in the tooltip when the user moves the mouse over the new button in the tab row.
treecell.src - Archive of obsolete content
« xul reference home src type: uri set this to the uri of an image to appear in the tree cell.
unread - Archive of obsolete content
« xul reference home unread type: boolean this attribute is set to true if the tab is unread; that is, either it has not yet been selected during the current session, or has changed since the last time it was selected.
uri - Archive of obsolete content
ArchiveMozillaXULAttributeuri
the value should be set to rdf:*.
userAction - Archive of obsolete content
« xul reference home useraction type: one of the values below this attribute will be set to the action the user is currently performing.
windowtype - Archive of obsolete content
« xul reference home windowtype type: string set to a string which can be used to identify the type of window.
wrap - Archive of obsolete content
ArchiveMozillaXULAttributewrap
« xul reference home wrap type: string set this attribute to the value off to disable word wrapping in the textbox.
command - Archive of obsolete content
ArchiveMozillaXULEventscommand
currently only set when a command event is redirected though use of the command attribute.
commandupdate - Archive of obsolete content
the commandupdate event is executed when a command update occurs on a <commandset>.
Moving, Copying and Deleting Files - Archive of obsolete content
in this last example, the destination filename is set to an empty string.
Menus - Archive of obsolete content
copies a link links context-viewimage views an image at full size images context-copyimage-contents copies an image to the clipboard images context-copyimage copies the url of an image to the clipboard images context-saveimage saves an image images context-sendimage sends an image in an email images context-setdesktopbackground sets an image as the desktop background images context-blockimage blocks an image images context-back goes back a page context-forward goes forward a page context-reload reloads a page context-stop stops loading a page context-bookmarkpage bookmarks a page context-sa...
International characters in XUL JavaScript - Archive of obsolete content
if the script file is loaded via http, the http header can contain a character encoding declaration as part of the content-type header, for example: content-type: application/javascript; charset=utf-8 if no charset parameter is specified, the same rules as above apply.
addTab - Archive of obsolete content
ArchiveMozillaXULMethodaddTab
« xul reference home addtab( url, referreruri, charset, postdata, owner, allowthirdpartyfixup ) addtab( url, {referreruri: ..., charset: ..., postdata: ..., owner: ..., allowthirdpartyfixup: ..., relatedtocurrent: ...
advance - Archive of obsolete content
ArchiveMozillaXULMethodadvance
the canadvance property must be set to true for the page to be changed.
appendCustomToolbar - Archive of obsolete content
« xul reference home appendcustomtoolbar( name, currentset ) firefox only return type: element adds a custom toolbar to the toolbox with the given name.
appendGroup - Archive of obsolete content
a referreruri property may also be optionally used to set the referrer page.
appendItem - Archive of obsolete content
you may optionally set a value.
getIcon - Archive of obsolete content
ArchiveMozillaXULMethodgetIcon
see seticon to set the icon.
getSearchAt - Archive of obsolete content
the components are set with the autocompletesearch attribute.
insertItemAt - Archive of obsolete content
you may optionally set a value.
loadGroup - Archive of obsolete content
a referreruri property may also be optionally used to set the referrer page.
loadOneTab - Archive of obsolete content
« xul reference home loadonetab( url, referreruri, charset, postdata, loadinbackground, allowthirdpartyfixup ) loadonetab( url, { referreruri: ..., charset: ..., postdata: ..., inbackground: ..., allowthirdpartyfixup: ..., relatedtocurrent: ...
loadTabs - Archive of obsolete content
« xul reference home loadtabs( uris, loadinbackground, replace ) loadtabs( uris, params ) return type: no return value loads a set of uris, specified by the array uris, into tabs.
loadURI - Archive of obsolete content
ArchiveMozillaXULMethodloadURI
(this one has no post data parameter, see loaduriwithflags for a version that does) loaduri( uri, referrer, charset ) return type: no return value load a url into the document, with the given referrer and character set.
menulist.appendItem - Archive of obsolete content
you may optionally set a value and description.
openSubDialog - Archive of obsolete content
if the child dialog is also a prefwindow, set its type attribute to child so that preferences will be saved properly when the main dialog is closed.
reloadWithFlags - Archive of obsolete content
load_flags_charset_change: this flag is used if the document needs to be reloaded because the character set changed.
rewind - Archive of obsolete content
ArchiveMozillaXULMethodrewind
the canrewind property must be set to true for the page to be changed.
stopEditing - Archive of obsolete content
if the shouldaccept parameter is true, the cell's label is changed to the edited value (the tree view's nsitreeview.setcelltext() method is called to change the cell contents).
Other Resources - Archive of obsolete content
demostrates flexing, layouts, set up of trees and such.
Special per-platform menu considerations - Archive of obsolete content
this can be accomplished by ensuring that certain common ids are set for the menu items that need to be placed on the application menu.
PopupKeys - Archive of obsolete content
when the ignorekeys attribute is placed on a <menupopup> or <panel> element, and its value is set to the value true, the key listener is not used.
Popup Guide - Archive of obsolete content
a tooltip can be created by setting the tooltiptext attribute on an element or by using the tooltip element.
browser - Archive of obsolete content
« xul reference browser type: browser element lets you set and get the browser in which the findbar is located.
flexGroup - Archive of obsolete content
« xul referenceflexgrouptype: integergets and sets the value of the flexgroup attribute.
highlightNonMatches - Archive of obsolete content
« xul reference highlightnonmatches new in thunderbird 1 requires seamonkey 1.0 type: boolean gets and sets the value of the highlightnonmatches attribute.
searchButton - Archive of obsolete content
« xul reference searchbutton type: boolean gets and sets the value of the searchbutton attribute.
accessKey - Archive of obsolete content
« xul reference accesskey type: character gets and sets the value of the accesskey attribute.
align - Archive of obsolete content
ArchiveMozillaXULPropertyalign
« xul reference align type: string gets and sets the value of the align attribute.
allowEvents - Archive of obsolete content
« xul reference allowevents type: boolean gets and sets the value of the allowevents attribute.
alwaysOpenPopup - Archive of obsolete content
« xul reference alwaysopenpopup obsolete since gecko 1.9.1 type: boolean gets and sets the value of the alwaysopenpopup attribute.
autoCheck - Archive of obsolete content
« xul reference autocheck type: boolean gets and sets the value of the autocheck attribute.
autoFill - Archive of obsolete content
« xul reference autofill type: boolean gets and sets the value of the autofill (or autofill) attribute.
autoFillAfterMatch - Archive of obsolete content
« xul reference autofillaftermatch obsolete since gecko 1.9.1 type: boolean gets and sets the value of the autofillaftermatch attribute.
browser.preferences - Archive of obsolete content
« xul reference preferences type: nsiprefservice this read-only property contains an nsipref object for getting and setting user preferences.
checkState - Archive of obsolete content
« xul reference checkstate type: integer, values 0, 1, or 2 gets and sets the value of the checkstate attribute.
checked - Archive of obsolete content
« xul reference checked type: boolean gets and sets the value of the checked attribute.
className - Archive of obsolete content
« xul reference classname type: string gets and sets the value of the class attribute.
clickSelectsAll - Archive of obsolete content
« xul reference clickselectsall type: boolean if set to true, the contents of the textbox are selected when focused; otherwise, the cursor is left unchanged.
collapsed - Archive of obsolete content
« xul reference collapsed type: boolean gets and sets the value of the collapsed attribute.
colorpicker.open - Archive of obsolete content
set this property to true to open the popup or false to close the popup.
command - Archive of obsolete content
« xul reference command type: element id gets and sets the value of the command attribute.
completeDefaultIndex - Archive of obsolete content
« xul reference completedefaultindex new in thunderbird 3requires seamonkey 2.0 type: boolean gets and sets the value of the completedefaultindex attribute.
contentView - Archive of obsolete content
« xul reference contentview type: nsitreecontentview for trees built with a content builder - that is, those that do not have flags set -- the contentview will be a reference to the nsitreecontentview for the tree.
contextMenu - Archive of obsolete content
« xul reference contextmenu type: popup element id gets and sets the value of the contextmenu attribute.
control - Archive of obsolete content
« xul reference control type: element id gets and sets the value of the control attribute.
crop - Archive of obsolete content
ArchiveMozillaXULPropertycrop
« xul reference crop type: string gets and sets the value of the crop attribute.
current - Archive of obsolete content
« xul reference current type: boolean gets and sets the value of the current attribute.
currentIndex - Archive of obsolete content
« xul reference currentindex type: integer set to the row index of the tree caret in the tree.
database - Archive of obsolete content
set to null for elements that do not have a datasources attribute.
datasources - Archive of obsolete content
« xul reference datasources type: space-separated list of datasource uris gets and sets the value of the datasources attribute.
date - Archive of obsolete content
ArchiveMozillaXULPropertydate
set this property to change the selected date.
datepicker.open - Archive of obsolete content
set this property to open or close the popup.
datepicker.value - Archive of obsolete content
set this property to change the selected date.
decimalPlaces - Archive of obsolete content
« xul reference decimalplaces type: integer gets and sets the value of the decimalplaces attribute.
defaultValue - Archive of obsolete content
« xul reference defaultvalue type: string gets and sets the the default value in a textbox.
description - Archive of obsolete content
« xul reference description type: string set to the description of the currently selected menuitem.
dir - Archive of obsolete content
ArchiveMozillaXULPropertydir
« xul reference dir type: string gets and sets the value of the dir attribute.
disableAutocomplete - Archive of obsolete content
« xul reference disableautocomplete type: boolean gets and sets the value of the disableautocomplete (or disableautocomplete) attribute.
disableKeyNavigation - Archive of obsolete content
« xul reference disablekeynavigation type: boolean gets or sets the value of the disablekeynavigation attribute.
disableautoselect - Archive of obsolete content
« xul reference disableautoselect type: boolean gets and sets the value of the disableautoselect attribute.
disabled - Archive of obsolete content
« xul reference disabled type: boolean gets and sets the value of the disabled attribute.
dlgType - Archive of obsolete content
« xul reference dlgtype type: string gets and sets the value of the dlgtype attribute.
emptyText - Archive of obsolete content
« xul reference emptytext deprecated since gecko 2 type: string gets and sets a string that appears in the textbox when it has no value.
enableColumnDrag - Archive of obsolete content
« xul reference enablecolumndrag type: boolean when set to true, the user may drag the column headers around to change the order in which they are displayed.
eventNode - Archive of obsolete content
« xul reference eventnode type: eventtarget indicates the node where keyboard navigation events listener is set up.
flex - Archive of obsolete content
ArchiveMozillaXULPropertyflex
« xul reference flex type: integer gets and sets the value of the flex attribute.
focused - Archive of obsolete content
« xul reference focused type: boolean gets and sets the value of the focused attribute.
focusedItem - Archive of obsolete content
you can change the focused item by setting this property.
forceComplete - Archive of obsolete content
« xul reference forcecomplete type: boolean gets and sets the value of the forcecomplete (or forcecomplete) attribute.
group - Archive of obsolete content
ArchiveMozillaXULPropertygroup
« xul reference group type: string group name gets and sets the value of the group attribute.
handleCtrlPageUpDown - Archive of obsolete content
« xul reference handlectrlpageupdown type: boolean gets and sets the value of the handlectrlpageupdown attribute.
handleCtrlTab - Archive of obsolete content
« xul reference handlectrltab type: boolean gets and sets the value of the handlectrltab attibute.
height - Archive of obsolete content
« xul reference height type: integer gets and sets the value of the height attribute.
hidden - Archive of obsolete content
« xul reference hidden type: boolean gets and sets the value of the hidden attribute.
homePage - Archive of obsolete content
« xul reference homepage type: string home page url this property holds the value of the user's home page setting.
hour - Archive of obsolete content
ArchiveMozillaXULPropertyhour
set this property to change the selected hour.
id - Archive of obsolete content
ArchiveMozillaXULPropertyid
« xul reference id type: element id, must be unique in the window gets and sets the value of the id attribute.
ignoreBlurWhileSearching - Archive of obsolete content
« xul reference ignoreblurwhilesearching type: boolean gets and sets the value of the ignoreblurwhilesearching (or ignoreblurwhilesearching) attribute.
image - Archive of obsolete content
ArchiveMozillaXULPropertyimage
« xul reference image type: image url gets and sets the value of the image attribute.
increment - Archive of obsolete content
« xul reference increment type: integer gets and sets the value of the increment attribute.
instantApply - Archive of obsolete content
« xul referenceinstantapplytype: booleanyou can set this attribute to true to make the preference apply instantly, even when the global setting is not to use instant apply.
inverted - Archive of obsolete content
« xul reference inverted type: boolean gets and sets the value of the inverted attribute.
isSearching - Archive of obsolete content
« xul reference issearching type: boolean this property is set to true while a search is occuring.
isWaiting - Archive of obsolete content
« xul reference iswaiting type: boolean this property is set to true during the period while waiting for the timeout between the time when a user has pressed a key and a search is performed.
label - Archive of obsolete content
ArchiveMozillaXULPropertylabel
« xul reference label type: string gets and sets the value of the label attribute.
labelElement - Archive of obsolete content
this is set when a label has a control attribute pointing to this element.
lastSelected - Archive of obsolete content
« xul reference lastselected type: string set this to the id of the last selected pane.
left - Archive of obsolete content
ArchiveMozillaXULPropertyleft
« xul reference left type: integer gets and sets the value of the left attribute.
linkedPanel - Archive of obsolete content
« xul reference linkedpanel type: id of a tabpanel element gets and sets the value of the linkedpanel attribute.
listbox.currentIndex - Archive of obsolete content
« xul reference currentindex type: integer set to the index of the currently focused item in the list.
max - Archive of obsolete content
ArchiveMozillaXULPropertymax
« xul reference max type: integer gets and sets the value of the max attribute.
maxHeight - Archive of obsolete content
« xul reference maxheight type: integer gets and sets the value of the maxheight attribute.
maxRows - Archive of obsolete content
« xul reference maxrows type: integer gets and sets the value of the maxrows attribute.
menu - Archive of obsolete content
ArchiveMozillaXULPropertymenu
« xul reference menu type: popup element id gets and sets the value of the menu attribute.
min - Archive of obsolete content
ArchiveMozillaXULPropertymin
« xul reference min type: integer gets and sets the value of the min attribute.
minHeight - Archive of obsolete content
« xul reference minheight type: integer gets and sets the value of the minheight attribute.
minResultsForPopup - Archive of obsolete content
« xul reference minresultsforpopup type: integer gets and sets the value of the minresultsforpopup (or minresultsforpopup) attribute.
minWidth - Archive of obsolete content
« xul reference minwidth type: integer gets and sets the value of the minwidth attribute.
minute - Archive of obsolete content
set this property to change the selected minute.
mode - Archive of obsolete content
ArchiveMozillaXULPropertymode
« xul reference mode type: string gets and sets the value of the mode attribute.
month - Archive of obsolete content
ArchiveMozillaXULPropertymonth
set this property to change the selected month.
name - Archive of obsolete content
ArchiveMozillaXULPropertyname
for example, the browser's home page is set with the preference browser.startup.homepage.
noMatch - Archive of obsolete content
« xul reference nomatch type: boolean this property will be set to true if the last search resulted in no matches.
observes - Archive of obsolete content
« xul reference observes type: broadcaster element id gets and sets the value of the observes attribute.
onFirstPage - Archive of obsolete content
« xul reference onfirstpage type: boolean this property is set to true if the user is on the first page, which may or may not be the first index.
onLastPage - Archive of obsolete content
« xul reference onlastpage type: boolean this property is set to true if the user is on the last page of the wizard.
open - Archive of obsolete content
ArchiveMozillaXULPropertyopen
« xul reference open type: boolean gets and sets the value of the open attribute.
ordinal - Archive of obsolete content
« xul reference ordinal type: integer gets and sets the value of the ordinal attribute.
orient - Archive of obsolete content
« xul reference orient type: string gets and sets the value of the orient attribute.
pack - Archive of obsolete content
ArchiveMozillaXULPropertypack
« xul reference pack type: string gets and sets the value of the pack attribute.
pageIncrement - Archive of obsolete content
« xul reference pageincrement type: integer gets and sets the value of the pageincrement attribute.
pageid - Archive of obsolete content
« xul reference pageid type: string wizardpage id this attribute should be set to a string that identifies the page's identifer in the wizard.
persist - Archive of obsolete content
« xul reference persist type: space-separated list of attribute names gets and sets the value of the persist attribute.
persistence - Archive of obsolete content
« xul reference persistence type: integer gets and sets the value of the persistence attribute.
placeholder - Archive of obsolete content
« xul reference placeholder type: string gets and sets a string that appears in the textbox when it has no value.
popup - Archive of obsolete content
ArchiveMozillaXULPropertypopup
« xul reference popup new in thunderbird 14 requires seamonkey 2.11 type: popup element should be set to the popup element that should appear when the user clicks on the textbox.
popupOpen - Archive of obsolete content
set this property to open or close the popup.
position - Archive of obsolete content
« xul reference position type: string gets and sets the value of the position attribute.
priority - Archive of obsolete content
« xul reference priority type: string gets and sets the value of the priority attribute.
readOnly - Archive of obsolete content
« xul reference readonly type: boolean if set to true, then the user cannot modify the value of the element.
ref - Archive of obsolete content
ArchiveMozillaXULPropertyref
« xul reference ref type: uri of an rdf resource gets and sets the value of the ref attribute.
resultsPopup - Archive of obsolete content
« xul reference resultspopup type: popup element this property is set to the popup element that displays the results.
searchLabel - Archive of obsolete content
« xul reference searchlabel type: string gets and sets the value of the searchlabel attribute.
searchParam - Archive of obsolete content
« xul reference searchparam new in thunderbird 15 requires seamonkey 2.12 type: string gets and sets the value of the autocompletesearchparam attribute.
second - Archive of obsolete content
set this property to change the selected second.
selType - Archive of obsolete content
« xul reference seltype type: string gets and sets the value of the seltype attribute.
selectedItem - Archive of obsolete content
you can select an item by setting this value.
selectionEnd - Archive of obsolete content
« xul reference selectionend type: integer get or set the end of the selected portion of the field's text.
selectionStart - Archive of obsolete content
« xul reference selectionstart type: integer get or set the beginning of the selected portion of the field's text.
selstyle - Archive of obsolete content
« xul reference selstyle type: string if set to the value primary, only the label of the primary column will be highlighted when an item in the tree is selected.
showCommentColumn - Archive of obsolete content
« xul reference showcommentcolumn type: boolean gets and sets the value of the showcommentcolumn (or showcommentcolumn) attribute.
showImageColumn - Archive of obsolete content
« xul reference showimagecolumn type: boolean gets and sets the value of the showimagecolumn attribute.
showPopup - Archive of obsolete content
« xul reference showpopup type: boolean gets and sets the value of the showpopup attribute.
size - Archive of obsolete content
ArchiveMozillaXULPropertysize
« xul reference size type: integer gets and sets the value of the size attribute.
src - Archive of obsolete content
ArchiveMozillaXULPropertysrc
« xul reference src type: url gets and sets the value of the src attribute.
statusText - Archive of obsolete content
« xul reference statustext type: string gets and sets the value of the statustext attribute.
statusbar - Archive of obsolete content
« xul reference statusbar type: id of statusbar element gets and sets the value of the statusbar attribute.
style - Archive of obsolete content
ArchiveMozillaXULPropertystyle
« xul reference style type: css inline style gets and sets the value of the style attribute.
suppressOnSelect - Archive of obsolete content
« xul reference suppressonselect type: boolean gets and sets the value of the suppressonselect attribute.
tabIndex - Archive of obsolete content
« xul reference tabindex type: integer gets and sets the value of the tabindex attribute.
tabScrolling - Archive of obsolete content
« xul reference tabscrolling type: boolean gets and sets the value of the tabscrolling (or tabscrolling) attribute.
textValue - Archive of obsolete content
note: setting the value causes an input event to be generated without triggering autocompletion.
textbox.label - Archive of obsolete content
« xul reference label type: string sets the label attribute.
textbox.type - Archive of obsolete content
« xul reference type type: string set to the value autocomplete to have an autocomplete textbox.
textbox.value - Archive of obsolete content
the current value may be modified by setting this property.
timeout - Archive of obsolete content
« xul reference timeout type: integer gets and sets the value of the timeout attribute.
timepicker.value - Archive of obsolete content
set this property to change the time.
tooltip - Archive of obsolete content
« xul reference tooltip type: tooltip element id gets and sets the value of the tooltip attribute.
tooltipText - Archive of obsolete content
« xul reference tooltiptext type: string gets and sets the value of the tooltiptext attribute.
top - Archive of obsolete content
ArchiveMozillaXULPropertytop
« xul reference top type: integer gets and sets the value of the top attribute.
type - Archive of obsolete content
ArchiveMozillaXULPropertytype
« xul reference type type: string gets and sets the value of the type attribute.
userAction - Archive of obsolete content
« xul reference useraction type: string gets and sets the value of the useraction attribute.
visibleTabs - Archive of obsolete content
this lets you determine which tabs are visible in the current tab set.
width - Archive of obsolete content
ArchiveMozillaXULPropertywidth
« xul reference width type: integer gets and sets the value of the width attribute.
wrapAround - Archive of obsolete content
« xul reference wraparound type: boolean gets and sets the value of the wraparound attribute.
year - Archive of obsolete content
ArchiveMozillaXULPropertyyear
set this property to change the selected year.
chromeclass-toolbar - Archive of obsolete content
« xul reference home chromeclass-toolbar when this class is used, the toolbar will be hidden when a window is opened by setting the toolbar option to no in the window.open method.
Additional Navigation - Archive of obsolete content
one possibility is to just add another predicate for each photo with a literal value set to the category.
Additional Template Attributes - Archive of obsolete content
to use this technique, place a template attribute on the root element set to the id of a template.
Bindings - Archive of obsolete content
(?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above', ?description = 'view from the top of the tower looking east of the doges palace') thus, only one match exists, so only one set of content is generated.
Building Menus With Templates - Archive of obsolete content
this applies to menus on menubars, submenus, as well as menu-type buttons such as those with a type attribute set to menu.
Containment Properties - Archive of obsolete content
to do this, use the containment attribute on the root node, set to the predicate to iterate over.
RDF Modifications - Archive of obsolete content
in effect, this isn't any different than adding the same set of triples yourself using the assert method.
Using Recursive Templates - Archive of obsolete content
<vbox datasources="people.xml" ref="*" querytype="xml" flags="dont-recurse"> here, the flags attribute is set to dont-recurse.
Accesskey display rules - Archive of obsolete content
therefore, xul toolkit removes accesskey text before setting the label to the buttons.
Adding more elements - Archive of obsolete content
this first method would require that we set the style on the box itself.
Adding Style Sheets - Archive of obsolete content
box[orient="horizontal"] matches all box elements that have an orient attribute that is set to horizontal.
Groupboxes - Archive of obsolete content
« previousnext » this section describes a way to include elements into groups groupboxes the groupbox element is used to group related xul elements together, much like the html fieldset element is used to group html elements.
Manipulating Lists - Archive of obsolete content
for instance, the additemtoselection() function adds a new item to the set of selected items, without clearing the existing selection.
Scroll Bars - Archive of obsolete content
the user will set the value by adjusting the scroll bar.
Scrolling Menus - Archive of obsolete content
you can set a css max-height property on the arrowscrollbox to limit the size of the scrolling box and thus make the arrows appear all the time.
The Box Model - Archive of obsolete content
you can set this attribute to the value horizontal to create a horizontal box and vertical to create a vertical box.
The Chrome URL - Archive of obsolete content
similarly, if the user changes their theme, the 'skin' part of the chrome url translates to a different set of files, yet the xul and scripts don't need to change.
Toolbars - Archive of obsolete content
typically however, a set of toolbars would appear along the top of a window.
XPCOM Examples - Archive of obsolete content
here is an example which populates a menu list with the names of all of the cookies set from mozillazine.
Using Visual Studio as your XUL IDE - Archive of obsolete content
setting the correct editor as xul files are nothing but xml, you can use the normal xml-editor for writing xul.
XUL accessibility tool - Archive of obsolete content
it is designed to test (insofar as automated testing is possible) the guidelines and requirement for creating accessible xul as set forth in the xul accessibility guidelines, and to report on any problems found in tested documents.
XUL:Property:flexGroup - Archive of obsolete content
« xul reference flexgroup type: integer gets and sets the value of the flexgroup attribute ...
param - Archive of obsolete content
ArchiveMozillaXULparam
, getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
scrollbar - Archive of obsolete content
, getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata ...
splitter - Archive of obsolete content
, getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata style classes the following classes may be used to style the element.
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.8.0.1\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication.xpi the application will be installed to /applications/vendor/appicationname linux run the following command in a command prompt: /opt/xu...
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.8.0.4\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication.xpi the application will be installed to /applications/vendor/applicationname linux run the following command in a command prompt:...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.9.1\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication.xpi the application will be installed to /applications/vendor/applicationname linux run the following command in a command prompt: /opt/x...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.9.2\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication.xpi the application will be installed to /applications/vendor/applicationname linux run the following command in a command prompt: /opt/x...
XULRunner 1.9 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.9\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication.xpi the application will be installed to /applications/vendor/applicationname linux run the following command in a command prompt:...
XULRunner 2.0 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\2.0\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication.xpi the application will be installed to /applications/vendor/applicationname linux run the following command in a command prompt: /opt/x...
Building XULRunner - Archive of obsolete content
please read and follow the general build documentation for instructions on how to get sources and set up build prerequisites.
Custom app bundles for Mac OS X - Archive of obsolete content
in this xml file.) pkginfo (this is a simple text file and is created along with the info.plist file) macos/ (the macos folder will contain your xulrunner executable) xulrunner (this is the xulrunner stub) resources/ (this is where you place your xul application code and support files) application.ini (xulrunner-related application settings) example.icns (this is the icon which will be used by your application bundle) chrome/ content/ example.xul (this directory contains your application's chrome) example.manifest defaults/ preferences/ app-prefs.js (this provides some default...
XULRunner Hall of Fame - Archive of obsolete content
one example of this tight integration is that the form in a web site can collect payment and set up a login for a members only section.
Using Crash Reporting in a XULRunner Application - Archive of obsolete content
to enable crash reporting on the client, set the following items in application.ini: [crash reporter] enabled=true serverurl=https://your.server.url/submit note: because crash reports can contain private data including passwords, in production environments they should only be sent via https.
application/http-index-format specification - Archive of obsolete content
a '-' indicates that the particular permission is not set.
mozilla.dev.platform FAQ - Archive of obsolete content
in order to use xr successfully in <tt>--disable-libxul</tt> mode, you have to setup dyld_library_path to include <tt>/library/frameworks/xul.framework/versions/1.9a1</tt> - benjamin smedberg, fri, oct 20 2006 9:12 am q: when i try to build a completely standalone xul app on os x (10.4.8).
reftest opportunities files - Archive of obsolete content
mlparser/tests/html/ins001.html parser/htmlparser/tests/html/imgmap001.html parser/htmlparser/tests/html/html001.html parser/htmlparser/tests/html/home01.html parser/htmlparser/tests/html/head03.html parser/htmlparser/tests/html/head02.html parser/htmlparser/tests/html/head01.html parser/htmlparser/tests/html/form002.html parser/htmlparser/tests/html/form001.html parser/htmlparser/tests/html/fieldset003.html parser/htmlparser/tests/html/fieldset002.html parser/htmlparser/tests/html/fieldset001.html parser/htmlparser/tests/html/entity_list.html parser/htmlparser/tests/html/entity_attrlist.html parser/htmlparser/tests/html/entity001.html parser/htmlparser/tests/html/endswithcr.html parser/htmlparser/tests/html/doc002.html parser/htmlparser/tests/html/doc001.html parser/htmlparser/tests/html/del...
xbDesignMode.js - Archive of obsolete content
e or an iframe reference"; } if (this.miframeelement.contentdocument){ // gecko this.meditordocument = this.miframeelement.contentdocument; this.meditordocument.designmode = "on"; } else { // ie this.meditordocument = this.miframeelement.contentwindow.document; this.meditordocument.designmode = "on"; // ie needs to reget the document element after designmode was set this.meditordocument = this.miframeelement.contentwindow.document; } } xbdesignmode.prototype.execcommand = function (acommandname, aparam){ if (this.meditordocument) this.meditordocument.execcommand(acommandname, false, aparam); else throw "no meditordocument found"; } xbdesignmode.prototype.setcsscreation = function (ausecss){ if (this.meditordocument) this.meditordoc...
Mozilla.dev.apps.firefox-2006-10-06 - Archive of obsolete content
a wiki has been set up aswell as weekly meetings, and a face-to-face meeting will be scheduled at a later date.
2006-11-22 - Archive of obsolete content
to join, send a blank email with subscribe in the subject field to: nvda...@freelists.org (click here to view the original post and unmask the e-mail address) michael would like to thank stormdragon for setting this up.
2006-10-06 - Archive of obsolete content
a wiki has been set up aswell as weekly meetings, and a face-to-face meeting will be scheduled at a later date.
2006-11-03 - Archive of obsolete content
request to add option for removal of firefox profiles during setup or uninstall a user suggests an option to remove profiles during setup or uninstall.
2006-11-04 - Archive of obsolete content
to add option for removal of firefox profiles during setup or uninstall a user suggests an option to remove profiles during setup or uninstall.
2006-12-01 - Archive of obsolete content
rich results for searches a proposal to implement "rich results", a set of registered sites that would provide information as it relates to a user's search.
2006-11-10 - Archive of obsolete content
thunderbird doesn't seem to have an option to set the client domain name (elho/helo).
2006-10-06 - Archive of obsolete content
he also mentioned that he has filed bug 355606 in order to track the staging server setup.
2006-11-10 - Archive of obsolete content
he stated that he set is home variable to c:\mozilla, and is not sure what he is doing wrong.
2006-11-03 - Archive of obsolete content
robert sayre notes that he and dave liebreich have a nice, simple environment set up for browser-based js tests meetings no meetings this week ...
2006-10-27 - Archive of obsolete content
when the special homepage comes up after updating firefox, the "go to your homepage" button doesn't work when multipliable tabs are set as homepage.
2006-09-29 - Archive of obsolete content
discussions file: vs resource: vs chrome: from a security point of view boris zbarsky gives a summary the current setup for checkloaduri (which type of security principal can load what) and asks for comments about whether that is the desired behaviour.
2006-10-27 - Archive of obsolete content
it was determined that the offsetwidth property can be used to get this value.
2006-11-10 - Archive of obsolete content
applying site- and page-specific settings during layout discussion on the best possible solution for integrating firefox 3 with the ability to apply site- and page-specific user settings during layout.
2006-10-13 - Archive of obsolete content
fedora security blocking xpcom registration fedora core 5.0 security settings impeding xpcom registration.
2006-10-27 - Archive of obsolete content
summary: mozilla.dev.apps.calendar - october 20 - october 27, 2006 announcements calendar test day october 31st a test date has been set for october 31st.
NPAPI plugin developer guide - Archive of obsolete content
or mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shutdown initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless...
Browser-side plug-in API - Archive of obsolete content
npn_destroystream npn_forceredraw npn_getauthenticationinfo npn_geturl npn_geturlnotify npn_getvalue npn_getvalueforurl npn_invalidaterect npn_invalidateregion npn_memalloc npn_memflush npn_memfree npn_newstream npn_pluginthreadasynccall npn_poppopupsenabledstate npn_posturl npn_posturlnotify npn_pushpopupsenabledstate npn_reloadplugins npn_requestread npn_setvalue npn_setvalueforurl npn_status npn_useragent npn_version npn_write ...
NPAnyCallbackStruct - Archive of obsolete content
see also npp_print() npembedprint npsetwindowcallbackstruct npprintcallbackstruct ...
NPEmbedPrint - Archive of obsolete content
the npembedprint structure is used when the mode field of npprint is set to np_embed.
NPN_GetAuthenticationInfo - Archive of obsolete content
see also npn_setvalueforurl, npn_getvalueforurl ...
NPN_GetURL - Archive of obsolete content
_parent: load the link into the immediate <frameset> parent of the plug-in instance's document.
NPN_GetValueForURL - Archive of obsolete content
see also npn_setvalueforurl, npn_getauthenticationinfo ...
NPPVariable - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api see npn_setvalue.
NPP_GetValue - Archive of obsolete content
see also npp_setvalue, npn_getvalue, npn_setvalue ...
NPP_StreamAsFile - Archive of obsolete content
npp_streamasfile is called for streams whose mode is set to np_asfileonly or np_asfile only in a previous call to npp_newstream.
NPPrintCallbackStruct - Archive of obsolete content
see also npp_print, npembedprint, npsetwindowcallbackstruct, npanycallbackstruct ...
NPSavedData - Archive of obsolete content
syntax typedef struct _npsaveddata { int32 len; void* buf; } npsaveddata; fields the data structure has the following fields: len length in bytes of the buffer pointed to by buf; set by the plug-in.
NP_GetValue - Archive of obsolete content
see also npp_setvalue ...
NPAPI plug-in side API - Archive of obsolete content
npp_destroy npp_destroystream npp_getvalue np_getvalue npp_handleevent np_initialize npp_new npp_newstream npp_print npp_setvalue npp_setwindow np_shutdown npp_streamasfile npp_urlnotify npp_write npp_writeready ...
Shipping a plugin as a Toolkit bundle - Archive of obsolete content
plugin packages should only need to package a small set of files in the following structure in the xpi file: install.rdf plugins/ pluginlib.dll plugintypes.xpt the install.rdf file contains an install manifest that describes the plugin to the user.
The First Install Problem - Archive of obsolete content
the recommended <object> attribute to set is still either "type" or "data".) advantage: we now no longer have ambiguity in determining which plugin handles what mimetype, because now the plugin has been invoked using the classid attribute of the object tag, which is in compliance with the html 4.01 specification for use of the object tag.
Writing a plugin for Mac OS X - Archive of obsolete content
this is easy to miss in the sample project's build settings.
Plugins - Archive of obsolete content
flash usage is also set to be phased out in the future.
What is RSS - Archive of obsolete content
technically speaking, userland's rss 0.91 is a subset of netscape's rss 0.91.
NSPR Release Engineering Guide - Archive of obsolete content
the password to this account is restricted to a small set of designated release engineers.
SSL and TLS - Archive of obsolete content
clients and servers may support different cipher suites, or sets of ciphers.
Sunbird Theme Tutorial - Archive of obsolete content
making a theme a theme consists of: a unique identifier a file containing information about the theme a file that registers the theme with sunbird some files containing the theme itself set up your theme in sunbird's profile directory.
Common Firefox theme issues and solutions - Archive of obsolete content
ruleset ignored due to bad selector.
Theme changes in Firefox 2 - Archive of obsolete content
mozapps/extensions/about.css updated with a simplified set of style names, since several styles were identical.
Theme changes in Firefox 3 - Archive of obsolete content
also, the visibility of the indicator is now controlled by setting collapsed in tabbrowser.xml.
Firefox Developer Tools - Archive of obsolete content
settings ...
-moz-binding - Archive of obsolete content
syntax /* <url> value */ -moz-binding: url(http://www.example.org/xbl/htmlbindings.xml#checkbox); /* global values */ -moz-binding: inherited; -moz-binding: initial; -moz-binding: unset; values <url> the url for the xbl binding (including the fragment identifier).
-ms-accelerator - Archive of obsolete content
the -ms-accelerator css property is a microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut.
-ms-content-zoom-snap-points - Archive of obsolete content
in the first selector, the first snap-point is at 0%, and the interval is set to 100%.
-ms-flow-from - Archive of obsolete content
the -ms-flow-from css property is a microsoft extension that gets or sets a value identifying a region container in the document that accepts the content flow from the data source.
-ms-flow-into - Archive of obsolete content
the -ms-flow-into css property is a microsoft extension that gets or sets a value identifying an iframe container in the document that serves as the region's data source.
-ms-high-contrast-adjust - Archive of obsolete content
the -ms-high-contrast-adjust css property is a microsoft extension that gets or sets a value indicating whether to override any css properties that would have been set in high contrast mode.
-ms-scroll-snap-points-x - Archive of obsolete content
in the first selector, the first snap-point is at 0%, and the interval is set to 100%.
-ms-scroll-snap-points-y - Archive of obsolete content
in the first selector, the first snap-point is at 0%, and the interval is set to 100%.
-ms-scrollbar-3dlight-color - Archive of obsolete content
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples the following example shows how to create a style rule that sets the -ms-scrollbar-3dlight-color property for a <textarea> element.
-ms-scrollbar-base-color - Archive of obsolete content
note that scrollbar-base-color sets the scroll bar face color and highlight color to different shades of the same base color.
-ms-scrollbar-darkshadow-color - Archive of obsolete content
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples the following example shows how to create a style rule that sets the -ms-scrollbar-darkshadow-color property for a <textarea> element.
-ms-scrollbar-shadow-color - Archive of obsolete content
)where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> examples the following example shows how to create a style rule that sets the -ms-scrollbar-shadow-color property for a <textarea> element.
azimuth - Archive of obsolete content
ArchiveWebCSSazimuth
stereo output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage.
display-inside - Archive of obsolete content
/* keyword values */ display-inside: auto; display-inside: block; display-inside: table; display-inside: flex; display-inside: grid; display-inside: ruby; /* global values */ display-inside: inherit; display-inside: initial; display-inside: unset; value not found in db!
display-outside - Archive of obsolete content
able-footer-group; display-outside: table-row; display-outside: table-cell; display-outside: table-column-group; display-outside: table-column; display-outside: table-caption; display-outside: ruby-base; display-outside: ruby-text; display-outside: ruby-base-container; display-outside: ruby-text-container; /* global values */ display-outside: inherit; display-outside: initial; display-outside: unset; value not found in db!
Displaying notifications (deprecated) - Archive of obsolete content
setting up event listeners on the notification there are two events you can listen to on created notifications: onclick this event is fired when the user clicks (or taps) on the notification.
Processing XML with E4X - Archive of obsolete content
if you create an xmllist as a subset of an existing xml object and then modify the original xml object, the xmllist will not reflect those changes; you will need to re-create it to get the most recent updates: var languages = <languages> <lang>javascript</lang> <lang>python</lang> </languages>; var lang = languages.lang; alert(lang.length()); // alerts 2 languages.lang += <lang>ruby</lang>; alert(lang.length()); // st...
E4X - Archive of obsolete content
ArchiveWebE4X
workaround: var response = xmlhttprequest.responsetext; // bug 270553 response = response.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, ""); // bug 336551 var e4x = new xml(response); resources e4x tutorial processing xml with e4x on mdc e4x for templating see the list of e4x-related pages on mdc ecma-357 standard brendan's presentation e4x at faqts.com e4x quick reference at rephrase.net ...
Accessing XML children - Archive of obsolete content
operator or [] notation to set properties.
Descendants and Filters - Archive of obsolete content
to work with only a specific subset, place a conditional in parentheses after the operator.
The global XML object - Archive of obsolete content
xml elements will remember the settings of the xml object from the time of their creation.
Using JavaScript Generators in Firefox - Archive of obsolete content
function closegenerator() { settimeout(function() { generator.close(); }, 0); } // our main steps function databaseoperation() { mozindexeddb.open("mytestdatabase").onsuccess = grabevent; var event = yield; var db = event.target.result; if (db.version != "1.0") { db.setversion("1.0").onsuccess = grabevent; event = yield; var transaction = event.transaction; db.createobjectstore("stuff"); t...
ArrayBuffer.transfer() - Archive of obsolete content
fer) { arraybuffer.transfer = function(source, length) { if (!(source instanceof arraybuffer)) throw new typeerror('source must be an instance of arraybuffer'); if (length <= source.bytelength) return source.slice(0, length); var sourceview = new uint8array(source), destview = new uint8array(new arraybuffer(length)); destview.set(sourceview); return destview.buffer; }; } specifications specification status comment arraybuffer.prototype.transfer proposal draft stage 2 draft ...
Date.prototype.toLocaleFormat() - Archive of obsolete content
you should take care that the format string is localized properly according to the user's system settings.
Date.getVarDate() - Archive of obsolete content
the actual format of the returned value depends on regional settings.
Debug - Archive of obsolete content
debug.setnonusercodeexceptions determines whether any try-catch blocks in this scope are to be treated by the debugger as user-unhandled.
Enumerator.moveNext - Archive of obsolete content
if the enumerator is at the end of the collection or the collection is empty, the current item is set to undefined.
Enumerator - Archive of obsolete content
enumerator.movefirst resets the current item in the collection to the first item.
Error.description - Archive of obsolete content
the error.description property returns or sets the descriptive string associated with a specific error.
Error.number - Archive of obsolete content
the error.number property returns or sets the numeric value associated with a specific error.
@cc_on - Archive of obsolete content
it is strongly recommended that you use the @cc_on statement in a comment, so that browsers that do not support conditional compilation will accept your script as valid syntax: an @if or @set statement outside of a comment also activates conditional compilation.
Microsoft JavaScript extensions - Archive of obsolete content
objects activexobject debug enumerator vbarray functions getobject scriptengine scriptenginebuildversion scriptenginemajorversion scriptengineminorversion statements @cc-on @if @set other date.getvardate() error.description error.number error.stacktracelimit ...
New in JavaScript 1.1 - Archive of obsolete content
you can remove an object by setting its object reference to null.
New in JavaScript 1.2 - Archive of obsolete content
note that netscape navigator 3.0 and earlier ignored scripts with the language attribute set to "javascript1.2" and higher.
New in JavaScript 1.5 - Archive of obsolete content
javascript authors can now add getters and setters to their objects.
New in JavaScript 1.6 - Archive of obsolete content
array.prototype.indexof() array.prototype.lastindexof() array.prototype.every() array.prototype.filter() array.prototype.foreach() array.prototype.map() array.prototype.some() array generics string generics for each...in changed functionality in javascript 1.6 a bug in which arguments[n] cannot be set if n is greater than the number of formal or actual parameters has been fixed.
New in JavaScript 1.7 - Archive of obsolete content
in html or xul code, use: <script type="application/javascript;version=1.7"></script> when using the javascript shell, you need to set the version you wish to use using the -version 170 switch on the command line or using the version() function: version(170); the features that require the use of the new keywords "yield" and "let" require you to specify version 1.7 because existing code might use those keywords as variable or function names.
LiveConnect - Archive of obsolete content
note: liveconnect blocked under some conditions liveconnect calls from javascript to java api are blocked when the java control panel security slider is set to very high level, or when the slider is at the default high level and the jre has either expired or is below the security baseline.
ParallelArray - Archive of obsolete content
to ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports.
Writing JavaScript for XHTML - Archive of obsolete content
the regular xml dom provides sufficient methods via the element interface for getting/setting/removing attributes.
XForms Custom Controls Examples - Archive of obsolete content
output showing images <binding id="output-image" extends="chrome://xforms/content/xforms.xml#xformswidget-base"> <content> <html:div> <html:img anonid="content"/> </html:div> </content> <implementation implements="nsixformsuiwidget"> <method name="refresh"> <body> var img = document.getanonymouselementbyattribute(this, "anonid", "content"); img.setattribute("src", this.stringvalue); return true; </body> </method> </implementation> </binding> output showing xhtml <binding id="output-xhtml" extends="chrome://xforms/content/xforms-xhtml.xml#xformswidget-output"> <content> <children includes="label"/> <xhtml:div class="xf-value" anonid="content"></xhtml:div> <children/> </content> <implementation implements=...
Developing Mozilla XForms - Archive of obsolete content
to activate this logging output, set the nspr_log_modules environment variable: export nspr_log_modules=schemavalidation:5 this only works on a debug build as described above.
RFE to the Custom Controls - Archive of obsolete content
therefore the control set may need to be more extensive to address the wider spectrum of requirements that a xul application will have on its controls.
RFE to the Custom Controls Interfaces - Archive of obsolete content
in short, we have the following interfaces: nsixformsaccessors - serves to get/set the value of the instance data node that the xforms element is bound to as well as getting the various states of that node nsixformsdelegate - used to obtain the nsixformsaccessors interface nsixformsuiwidget - used by the xforms processor to update the value/state of an xforms element when its bound node's value/state is changed our current mechanism that allows authors to build custom controls assumes that the controls will be bound to instance nodes of simple content type.
RFE to the XForms API - Archive of obsolete content
ArchiveWebXFormsRFEXForms API
as an example, the nsixformsaccessors interface which allows a user to get/set the value of an instance node and get the state of an instance node, is exposed by the nsixformsdelegate interface using the accessors property.
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
therefore the control set may need to be more extensive to address the wider spectrum of requirements that a xul application will have on its controls.
XForms Alert Element - Archive of obsolete content
examples <xforms:model> <xforms:instance> <data xmlns=""> <x>10</x> </data> </xforms:instance> <xforms:bind id="x" nodeset="x" type="xsd:integer"/> </xforms:model> <style> @namespace xforms url("http://www.w3.org/2002/xforms"); xforms|input:invalid xforms|alert.inline { display: inline; font-style: italic; width: 40%; } } </style> <xforms:input bind="x"> <xforms:label>you can type only numbers (validation happens on blur): </xforms:label> <xforms:alert>wrong value!
XForms Input Element - Archive of obsolete content
xsd:short xsd:byte xsd:nonnegativeinteger xsd:unsignedlong xsd:unsignedint xsd:unsignedshort xsd:unsignedbyte xsd:positiveinteger analogous widget is <xul:textbox type="number"/> (will be available in fx 3.0) specific handling of attributes incremental - if "true", the bound instance node will be updated when the user clicks on the up or down spin buttons or directly edits the field and then sets focus elsewhere.
XForms Switch Module - Archive of obsolete content
binding a switch to a data node will also set a context that the expressions contained inside the case elements can build upon.
XForms Upload Element - Archive of obsolete content
the xforms author can set the filter by using the mediatype attribute directly on the upload element or by placing a mediatype element (see the spec) as a direct child of the upload element.
Using XForms and PHP - Archive of obsolete content
to do that, you need to use the header() php function: <?php header("content-type: application/xhtml+xml; charset=utf-8"); ...
XForms - Archive of obsolete content
this extension, while supporting a significant subset of the xforms 1.0 and 1.1 candidate recommendations, is not actively maintained any more since about 2010.
Archived open Web documentation - Archive of obsolete content
to ensure that your code executes in parallel, it is suggested that the functions should be limited to the parallelizable subset of js that firefox supports.
Describing microformats in JavaScript - Archive of obsolete content
for firefox 3, this should be set to 0.8.
Fixing Incorrectly Sized List Item Markers - Archive of obsolete content
in fact, the markers were set to be a uniform size that did not change to match the content of the list items, so in rare cases the marker might actually appear to be smaller.
Windows Media in Netscape - Archive of obsolete content
for example, the following uses dhtml behaviors to associate a set of behaviors with a span element, which is then interrogated for its version number (the script attempts to verify that the windows media player control is at version 9): <span style="behavior:url(#default#clientcaps)" id="cc"></span> <script language=javascript> var cv = cc.getcomponentversion( "{6bf52a52-394a-11d3-b153-00c04f79faa6}", "componentid" ); if (cv == null || cv == "") { top.l...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
// helper class to implement all necessary nsiclassinfo method stubs // and to set flags used by the security system class nsclassinfomixin : public nsiclassinfo { // these flags are used by the dom and security systems to signal that // javascript callers are allowed to call this object's scritable methods.
Archive of obsolete content
there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example).
Building up a basic demo with PlayCanvas - Game development
engine vs editor the engine itself can be used as a standard library by including its javascript file directly in your html, so you can start coding right away; in addition the playcanvas toolset comes with an online editor that you can use to drag and drop components onto the scene — a great way to create games and other apps requiring scenes if you're more of a designer than a coder.
3D games on the Web - Game development
see the building up a basic demo with babylon.js subpage for the basics of using babylon.js, including setting up a development environment, structuring the necessary html, and writing the javascript code.
Async scripts for asm.js - Game development
instead of using eval or innerhtml, both of which trigger synchronous compilation, you should use a blob with an object url: var blob = new blob([codestring]); var script = document.createelement('script'); var url = url.createobjecturl(blob); script.onload = script.onerror = function() { url.revokeobjecturl(url); }; script.src = url; document.body.appendchild(script); the setting of src rather than innerhtml is what makes this script async.
Techniques for game development - Game development
using webrtc peer-to-peer data channels in addition to providing support for audio and video communication, webrtc lets you set up peer-to-peer data channels to exchange text or binary data actively between your players.
Tools for game development - Game development
asm.js asm.js is a very limited subset of the javascript language, which can be greatly optimized and run in an ahead-of-time (aot) compiling engine for much faster performance than your typical javascript performance.
Bounce off the walls - Game development
remembering that the coordinate system starts from the top left, we can come up with something like this: if(y + dy < 0) { dy = -dy; } if the y value of the ball position is lower than zero, change the direction of the movement on the y axis by setting it equal to itself, reversed.
Game over - Game development
first, replace where you initially called setinterval() setinterval(draw, 10); with: var interval = setinterval(draw, 10); then replace the second if statement with the following: if(y + dy < ballradius) { dy = -dy; } else if(y + dy > canvas.height-ballradius) { alert("game over"); document.location.reload(); clearinterval(interval); // needed for chrome to end game } letting the paddle hit the ball the last t...
Move the ball - Game development
in any case, before we do all that we will first introduce phaser's physics engines, and do some setup work.
The score - Game development
this can be done using the settext() method — add the two new lines seen below to the ballhitbrick() function: function ballhitbrick(ball, brick) { brick.kill(); score += 10; scoretext.settext('points: '+score); } that's it for now — reload your index.html and check that the score updates on every brick hit.
Win the game - Game development
add the following new code into your ballhitbrick() function: function ballhitbrick(ball, brick) { brick.kill(); score += 10; scoretext.settext('points: '+score); var count_alive = 0; for (i = 0; i < bricks.children.length; i++) { if (bricks.children[i].alive == true) { count_alive++; } } if (count_alive == 0) { alert('you won the game, congratulations!'); location.reload(); } } we loop through the bricks in the group using bricks.children, checking for the aliveness of each with...
Touch Event Horizon - Game development
this article is for touch event horizon and a game related to it touch gestures and events link the example game github repository live demo setting up the canvas counting the taps touchstart, touchend collecting the bonus touchmove future developments summary this tutorial shows how to use touch events to create a game on a <canvas>.
Visual-js game engine - Game development
now you can use on-page-editor (nice for visual setup , checking positions and dimensions - not for logic ) .
Abstraction - MDN Web Docs Glossary: Definitions of Web-related terms
example class implementabstraction { // method to set values of internal members set(x, y) { this.a = x; this.b = y; } display() { console.log('a = ' + this.a); console.log('b = ' + this.b); } } const obj = new implementabstraction(); obj.set(10, 20); obj.display(); // a = 10 // b = 20 learn more general knowledge abstraction on wikipedia ...
Alignment subject - MDN Web Docs Glossary: Definitions of Web-related terms
for justify-self and align-self, the alignment subject is the margin box of the box the property is set on, using the writing mode of that box.
Alpha (alpha channel) - MDN Web Docs Glossary: Definitions of Web-related terms
below you see a small box of that color in the top-left corner and a box of the same color but with an alpha channel set at 0.5 (50% opacity).
Bézier curve - MDN Web Docs Glossary: Definitions of Web-related terms
the curve is defined by a set of control points with a minimum of two.
CSS - MDN Web Docs Glossary: Definitions of Web-related terms
a css rule is a set of properties associated with a selector.
CSS Object Model (CSSOM) - MDN Web Docs Glossary: Definitions of Web-related terms
cssom api the css object model is also a set of apis allowing the manipulation of css from javascript.
Selector (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
; border: 2px solid yellow; color: white; background-color: darkred; padding: 0.8em 0.8em 0.6em; } #customized { font: 16px lucida grande, arial, helvetica, sans-serif; } the selectors here are "p" (which applies the color green to the text inside any <p> element), "div.warning" (which makes any <div> element with the class "warning" look like a warning box), and "#customized", which sets the base font of the element with the id "customized" to 16-pixel tall lucida grande or one of a few fallback fonts.
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
parts of a script may also be set to execute when events occur.
Cookie - MDN Web Docs Glossary: Definitions of Web-related terms
cookies can be set and modified at the server level using the set-cookie http header, or with javascript using document.cookie.
Descriptor (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
each descriptor has: a name a value, which holds the component values an "!important" flag, which in its default state is unset ...
Effective connection type - MDN Web Docs Glossary: Definitions of Web-related terms
3g 270ms 700 kbps the network is suited for transfers of large assets such as high resolution images, audio, and sd video.
FTU - MDN Web Docs Glossary: Definitions of Web-related terms
you can use ftu to set many important options (e.g.
Falsy - MDN Web Docs Glossary: Definitions of Web-related terms
this slot only exists in document.all and cannot be set using javascript.
Flex Item - MDN Web Docs Glossary: Definitions of Web-related terms
the direct children of a flex container (elements with display: flex or display: inline-flex set on them) become flex items.
Forbidden response header name - MDN Web Docs Glossary: Definitions of Web-related terms
a forbidden response header name is an http header name (either `set-cookie` or `set-cookie2`) that cannot be modified programmatically.
Git - MDN Web Docs Glossary: Definitions of Web-related terms
what sets it apart from previous scm systems is the ability to do common operations (branching, committing, etc.) on your local development machine, without having to change the master repository or even having write access to it.
Guard - MDN Web Docs Glossary: Definitions of Web-related terms
guard is a feature of headers objects (as defined in the fetch spec, which affects whether methods such as set() and append() can change the header's contents.
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
a basic request with one header: get /example.http http/1.1 host: example.com redirects have mandatory headers (location): 302 found location: /newpage.html a typical set of headers: 304 not modified access-control-allow-origin: * age: 2318192 cache-control: public, max-age=315360000 connection: keep-alive date: mon, 18 jul 2016 16:06:00 gmt server: apache vary: accept-encoding via: 1.1 3dc30c7222755f86e824b93feb8b5b8c.cloudfront.net (cloudfront) x-amz-cf-id: tol0fem6ui4fgldrkjx0vao5hpkkgzulyn2twd2gawltr7vlnjtvzw== x-backend-server: developer6.webapp.scl3.mozilla...
Houdini - MDN Web Docs Glossary: Definitions of Web-related terms
houdini is a set of low level apis that give developers the power to extend css, providing the ability to hook into the styling and layout process of a browser’s rendering engine.
I18N - MDN Web Docs Glossary: Definitions of Web-related terms
(the w3c definition) among other things, i18n requires support for multiple character sets (usually via unicode) units of measure (currency, °c/°f, km/miles, etc.) time and date formats keyboard layouts text directions learn more general knowledge i18n on wikipedia technical reference i18n on w3c i18n on gala-global.org learn about it i18n material on i18nguy.com ...
Internationalization - MDN Web Docs Glossary: Definitions of Web-related terms
internationalization includes support for multiple character sets (usually via unicode), units of measure (currency, °c/°f, km/miles, etc.), date and time formats, keyboard layouts, and layout and text directions.
JSON - MDN Web Docs Glossary: Definitions of Web-related terms
although not a strict subset, json closely resembles a subset of javascript syntax.
Main Axis - MDN Web Docs Glossary: Definitions of Web-related terms
the main axis in flexbox is defined by the direction set by the flex-direction property.
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge using media queries technical reference media queries define a set of characteristics or parameters required to apply the css styles that are specified within the curly braces of the media query; for example: only applying certain css styles for devices below 768 pixels.
NaN - MDN Web Docs Glossary: Definitions of Web-related terms
fortunately, since the result will be nan and i know my divisor may turn out to be 0, i can set up testing conditions that prevent any such computations in the first place or notify me of where they happen.
OTA - MDN Web Docs Glossary: Definitions of Web-related terms
all device owners receiving a given set of updates are on the same "channel", and each device often can access several channels (e.g.
Packet - MDN Web Docs Glossary: Definitions of Web-related terms
it is usually of variable length, up to a maximum that is set by the network protocol and sometimes the equipment on the route.
Page prediction - MDN Web Docs Glossary: Definitions of Web-related terms
also, pre-loaded websites and embedded content can set and read their cookies as if they were visited even if they weren't.
Polyfill - MDN Web Docs Glossary: Definitions of Web-related terms
using a polyfill to handle browser-specific implementations is practically non-existent today because modern browsers mostly implement a broad set of apis according to standard semantics.
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
more information http headers using q-values in their syntax: accept, accept-charset, accept-language, accept-encoding, te.
Raster image - MDN Web Docs Glossary: Definitions of Web-related terms
raster image files usually contain one set of dimensions, but the ico and cur formats, used for favicons and css cursor images, can contain multiple sizes.
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
in addition, cors defines a subset of request headers as simple headers, request headers that are always considered authorized and are not explicitly listed in responses to preflight requests.
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
note that strictly speaking, the content-encoding and content-type headers are entity header: 200 ok access-control-allow-origin: * connection: keep-alive content-encoding: gzip content-type: text/html; charset=utf-8 date: mon, 18 jul 2016 16:06:00 gmt etag: "c561c68d0ba92bbeb8b0f612a9199f722e3a621a" keep-alive: timeout=5, max=997 last-modified: mon, 18 jul 2016 02:36:04 gmt server: apache set-cookie: mykey=myvalue; expires=mon, 17-jul-2017 16:06:00 gmt; max-age=31449600; path=/; secure transfer-encoding: chunked vary: cookie, accept-encoding x-backend-server: developer2.webapp.scl3.mozilla.com x-cache-...
SIMD - MDN Web Docs Glossary: Definitions of Web-related terms
see also sisd for a sequential architecture with no parallelism in either the instructions or the data sets.
SVG - MDN Web Docs Glossary: Definitions of Web-related terms
svg also provides a useful set of tools, such as clipping, masking, filters, and animations.
Shadow tree - MDN Web Docs Glossary: Definitions of Web-related terms
a shadow tree is a hidden set of standard dom nodes which is attached to a standard dom node that serves as a host.
Snap positions - MDN Web Docs Glossary: Definitions of Web-related terms
a scroll container may set snap positions — points that the scrollport will stop moving at after a scrolling operation is completed.
Specification - MDN Web Docs Glossary: Definitions of Web-related terms
in the context of describing the web, the term "specification" (often shortened to simply "spec") generally means a document describing a language, technology, or api which makes up the complete set of open web technologies.
Style origin - MDN Web Docs Glossary: Definitions of Web-related terms
the style origins are used to determine where to stop rolling back (or backtracking through) the cascade of styles that have been applied to an element when removing styles, such as when using the unset or revert keywords.
Stylesheet - MDN Web Docs Glossary: Definitions of Web-related terms
a stylesheet is a set of css rules used to control the layout and design of a webpage or document.
TCP handshake - MDN Web Docs Glossary: Definitions of Web-related terms
tcp uses a three-way handshake (aka tcp-handshake, three message handshake, and/or syn-syn-ack) to set up a tcp/ip connection over an ip based network.
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
to implement tcp slow start, the congestion window (cwnd) sets an upper limit on the amount of data a source can transmit over the network before receiving an acknowledgment (ack).
TLD - MDN Web Docs Glossary: Definitions of Web-related terms
internationalized country code top-level domains (idn cctld) cctlds in non-latin character sets (e.g., arabic or chinese).
Transmission Control Protocol (TCP) - MDN Web Docs Glossary: Definitions of Web-related terms
tcp handshake the tcp three-way handshake, also called the tcp-handshake, three message handshake, and/or syn-syn-ack, is the method used by tcp to set up a tcp/ip connection over an ip-based network.
WCAG - MDN Web Docs Glossary: Definitions of Web-related terms
they outline a set of guidelines for making content accessible primarily for people with disabilities but also for limited-resource devices such as mobile phones.
WebDAV - MDN Web Docs Glossary: Definitions of Web-related terms
author or creation date) link pages of any media type to related pages create sets of documents and retrieve hierarchical list copy and move webpages lock a document from being edited by more than one person at a time learn more general knowledge webdav on wikipedia technical reference rfc 2518 rfc 3253 rfc 3744 ...
WebRTC - MDN Web Docs Glossary: Definitions of Web-related terms
rtcdatachannel provides a method to set up a peer-to-peer data pathway between browsers.
Web standards - MDN Web Docs Glossary: Definitions of Web-related terms
this non-exhaustive list gives you an idea of which standards websites and network systems must conform to: ietf (internet engineering task force): internet standards (std), which among other things govern set-up and use of uris, http, and mime w3c: specifications for markup language (e.g., html), style definitions (i.e., css), dom, accessibility iana (internet assigned numbers authority): name and number registries ecma intl.: scripting standards, most prominently for javascript iso (international organization for standardization): standards governing a diverse array of aspects, including characte...
Whitespace - MDN Web Docs Glossary: Definitions of Web-related terms
whitespace is a set of characters which is used to show horizontal or vertical spaces between other characters.
Cacheable - MDN Web Docs Glossary: Definitions of Web-related terms
a response to a post or patch request can also be cached if freshness is indicated and the content-location header is set, but this is rarely implemented.
Character - MDN Web Docs Glossary: Definitions of Web-related terms
utf-8 is the most common character set and includes the graphemes of the most popular human languages.
Character encoding - MDN Web Docs Glossary: Definitions of Web-related terms
for example, in html we normally declare a character encoding of utf-8, using the following line: <meta charset="utf-8"> this ensures that you can use characters from just about any human language in your html document, and they will display reliably.
Event - MDN Web Docs Glossary: Definitions of Web-related terms
events are assets generated by dom elements, which can be manipulated by a javascript code.
Glyph - MDN Web Docs Glossary: Definitions of Web-related terms
the fonts used by a website contain different sets of glyphs, which represent the characters of the font.
Protocol - MDN Web Docs Glossary: Definitions of Web-related terms
the set of rules that defines a format is called a protocol.
Strict mode - MDN Web Docs Glossary: Definitions of Web-related terms
strict mode isn't just a subset: it intentionally has different semantics from normal code.
Test your skills: CSS and JavaScript accessibility - Learn web development
we'd like you to assume that the existing ruleset with the a selector is supplied by some cms, and that you can't change it — instead, you need to create new rules to make the links look and behave like links, and for the user to be able to tell where they are in the list.
CSS and JavaScript accessibility best practices - Learn web development
the code features two functions that show and hide the zoomed-in image; these are run by the following lines that set them as event handlers: imgthumb.onmouseover = showimg; imgthumb.onmouseout = hideimg; imgthumb.onfocus = showimg; imgthumb.onblur = hideimg; the first two lines run the functions when the mouse pointer hovers over and stops hovering over the thumbnail, respectively.
A cool-looking box - Learn web development
the other two should be inset box shadows — a semi-transparent white shadow near the top left and a semi-transparent black shadow near the bottom right — to add to the nice raised 3d look of the box.
Test your skills: The Cascade - Learn web development
task one in this task, you need to use one of the special values we looked at in the controlling inheritance section to write a declaration in a new rule that will reset the background color back to white, without using an actual color value.
Test your skills: sizing - Learn web development
the value of the box-sizing property is set to border-box, which means that the total width includes any padding and border.
What is CSS? - Learn web development
we then have a set of curly braces { }.
CSS first steps - Learn web development
looking at it, consuming the content.) a basic work environment set up as detailed in installing basic software, and an understanding of how to create and manage files, as detailed in dealing with files.
Using CSS generated content - Learn web development
html a text where i need to <span class="ref">something</span> css .ref::before { font-weight: bold; color: navy; content: "reference "; } output the character set of a stylesheet is utf-8 by default, but it can also be specified in the link, in the stylesheet itself, or in other ways.
create fancy boxes - Learn web development
it's possible to set several backgrounds on a single box.
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.
How do you host your website on Google App Engine? - Learn web development
run the following in the command line to select your project: gcloud config set project gaesamplesite then run the following command to go to your app's directory: cd sample-app you are now ready to deploy your application, i.e.
What is the difference between webpage, website, web server, and search engine? - Learn web development
however, there are a few basic terms you need to understand at the outset, since you'll hear these expressions all the time as you read on.
What are hyperlinks? - Learn web development
next steps now you'll want to set up some webpages with links.
What is a URL? - Learn web development
a protocol is a set method for exchanging or transferring data around a computer network.
Example 5 - Learn web development
ueryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select, index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[index].setattribute('aria-selected', 'true'); nativewidget.selectedindex = index; value.innerhtml = optionlist[index].innerhtml; highlightoption(select, optionlist[index]); }; function getindex(select) { var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; // ------------- // // event binding ...
Test your skills: Form structure - Learn web development
add a suitable set of structural elements around the label/field pairs to separate them out.
Test your skills: Other controls - Learn web development
other controls 3 in our final task of this set, we start with much the same list of food choices.
Test your skills: Styling basics - Learn web development
but your css should aim to fulfill the following requirements: add some kind of lightweight "reset" to make fonts, padding, margin, and sizing more consistent to begin with.
Example - Learn web development
margin: 0 auto; width: 400px; /* to see the limits of the form */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div + div { margin-top: 1em; } label { /* to make sure that all label have the same size and are properly align */ display: inline-block; width: 90px; text-align: right; } input, textarea { /* to make sure that all text field have the same font settings by default, textarea are set with a monospace font */ font: 1em sans-serif; /* to give the same size to all text field */ width: 300px; -moz-box-sizing: border-box; box-sizing: border-box; /* to harmonize the look & feel of text field border */ border: 1px solid #999; } input:focus, textarea:focus { /* to give a little highligh on active elements */ border-col...
How the Web works - Learn web development
assets: this is a collective name for all the other stuff that makes up a website, such as images, music, video, word documents, and pdfs.
What will your website look like? - Learn web development
choosing your assets at this point, it's good to start putting together the content that will eventually appear on your webpage.
Add a hitmap on top of an image - Learn web development
here we go over how to set up an image map, and some downsides to consider first.
Define terms with HTML - Learn web development
</p> the html spec does indeed set aside the title attribute for expanding the abbreviation.
Use JavaScript within a webpage - Learn web development
don't set nor even guess time limits.
Marking up a letter - Learn web development
the head of the document the character set of the document should be set as utf-8 using the appropriate meta tag.
Structuring a page of content - Learn web development
starting point to get this assessment started, you should go and grab the zip file containing all the starting assets.
Introduction to HTML - Learn web development
you should have a basic work environment set up (as detailed in installing basic software), and understand how to create and manage files (as detailed in dealing with files).
Test your skills: Multimedia and embedding - Learn web development
you must explicitly set the type as subtitles, and the subtitle language to english.
HTML table advanced features and accessibility - Learn web development
your finished table should look something like the following: hidden example <!doctype html> <html> <head> <meta charset="utf-8"> <title>my spending record</title> <style> html { font-family: sans-serif; } table { border-collapse: collapse; border: 4px solid rgb(200,200,200); letter-spacing: 1px; font-size: 0.8rem; } td, th { border: 2px solid rgb(190,190,190); padding: 10px 20px; } ...
Assessment: Structuring planet data - Learn web development
project brief you are working at a school; currently your students are studying the planets of our solar system, and you want to provide them with an easy-to-follow set of data to look up facts and figures about the planets.
General asynchronous programming concepts - Learn web development
features like promises allow you to set an operation running (e.g.
Functions — reusable blocks of code - Learn web development
javascript is set up like this for various reasons — but mainly because of security and organization.
Test your skills: Functions - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
Test your skills: Loops - Learn web development
dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the page — all via javascript.
Client-side web APIs - Learn web development
this is usually done by using the document object model (dom), a set of apis for controlling html and styling information that makes heavy use of the document object.
Handling text — strings in JavaScript - Learn web development
the following will work if you previously defined the variable string — try it now: let badstring = string; badstring; badstring is now set to have the same value as string.
Object prototypes - Learn web development
note that this set of tests relies on some of the knowledge taught in the next article, so you might want to read that first before you try them.
Test your skills: Object-oriented JavaScript - Learn web development
also set up the constructor so that the name property of square object instances is automatically set to square, and the sides property is automatically set to 4.
CSS performance optimization - Learn web development
will-change property the css will-change property tells browsers which properties of an element are expected to change enabling browsers to set up optimizations before the element is actually changed, improving performance by doing potentially expensive work before it is required.
Measuring performance - Learn web development
for example, the firefox network monitor returns detailed information on all the assets downloaded form the network, along with a time graph that shows how long each one took to download.
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
next, add the following action underneath the existing add(text) action: @action clearcompleted() { this.todos = this.incomplete; } this is rather nice for clearing the todos — we just need to set the todos array to equal the list of incomplete todos.
Ember interactivity: Events, classes and state - Learn web development
along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep track of the data state of our app.
Ember app structure and componentization - Learn web development
planning out the layout of the todomvc app in the last article we set up a new ember project, then added and configured our css styles.
Dynamic behavior in Svelte: working with variables and props - Learn web development
reactivity in svelte is implemented in a very lightweight and performant way, without using listeners, setters, getters, or any other complex mechanism.
Vue resources - Learn web development
in this new api, a single setup() function is used on the component.
Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites.
omni.ja (formerly omni.jar)
firefox and thunderbird achieve performance improvements by moving many of their internal parts from being standalone files or sets of jar files into just one jar file called omni.ja; this reduces the amount of i/o needed to load the application.
Accessibility Features in Firefox
these smart keywords can be setup via the context menu for the search field on the desired website.
CSUN Firefox Materials
these smart keywords can be setup via the context menu for the search field on the desired website.
Links and Resources
wai - web accessibility initiative web content accessibility guidelines (wcag) 1.0 the first set of official guidelines from the w3c web accessibility initiative (wai).
Software accessibility: Where are we today?
each end user has a unique set problems, and in the open source world, providing highly customized solutions can be a business in itself.
ZoomText
my email address is aaronleventhal@moonset.net.
Accessibility and Mozilla
here is a rundown of problems and the planned solutions:mozilla's section 508 compliancemozilla’s uaag evaluation reportthe uaag document contains a very rich set of accessibility guidelines, that broadly define how accessibility should be implemented by any user agent, i.e.
Adding a new word to the en-US dictionary
the script only works if you have the environment variable editor set to the executable of an editor program; if you don't have it set, you can do editor=vim sh edit-dictionary to edit using vim (or you can substitute some other editor), or you can just do sh edit-dictionary if you have an editor already specified.
Adding phishing protection data providers
installing a new data provider to install a data provider for phishing protection, it's necessary to set a series of preferences to provide details about the provider.
What to do and what not to do in Bugzilla
in general you can resolve a bug as wfm if: three or more people with a similar/the same setup can't reproduce the bug and the bug is only seen by the bug reporter.
Building SpiderMonkey with UBSan
cks other than: alignment, which hits known bugs in spidermonkey, and is more implementation-defined (slow on x86 / crash on arm) than undefined behavior float-cast-overflow, which hits known bugs in spidermonkey, and isn't exploited by today's compilers float-divide-by-zero, which jesse doesn't think is actually undefined behavior (aside from the question of whether cpu overflow flags are set) vptr, a check that requires rtti, which is disabled by default in spidermonkey 4.
Creating a spell check dictionary add-on
if you set em:minversion to a lower value, gecko 10-17 will not be able to update your dictionary add-on once the restartless dictionary is installed (bug 782118), and gecko 10-16 may warn the user that your dictionary is not compatible, when users try to update to a newer version of firefox/thunderbird (bug 782115).
Capturing a minidump
(you'll want the 32-bit version of windbg only if you are using a 32-bit version of firefox) then install it, the standard settings in the installation process are fine.
Debugging Internet Explorer
to run internet explorer in a single process add a dword registry value to hkey_current_user\software\microsoft\internet explorer\main called tabprocgrowth and set it to 0.
Debugging
replay debugging firefox with vmware workstation how to setup record and replay debugging on firefox, to help debug intermittent mochitest failures.
Makefile - variables
default=$(dist)/bin xpi_name if set final_target=$(dist)/xpi-stage/$(xpi_name) dist_subdir if set final_target will be $(dist)/bin/$(dist_subdir) [ metro build ] l10n.mk and localization variable description en_us_binary_url server url from which wget will ftp binaries.
Linux Prerequisites
doc moved in-tree https://firefox-source-docs.mozilla.org/setup/linux_build.html ...
Building Firefox for macOS
moved in-tree: https://firefox-source-docs.mozilla.org/setup/macos_build.html ...
Linux build preparation
documentation moved in-tree: https://firefox-source-docs.mozilla.org/setup/linux_build.html ...
Building Firefox for Windows
documentation moved in-tree: https://firefox-source-docs.mozilla.org/setup/windows_build.html ...
pymake
unlike gmake on windows, pymake is capable of doing parallel builds, so you can set a moz_make_flags=-jn in your .mozconfig without risk of deadlocks.
Interface Compatibility
binary interfaces traditionally, mozilla has maintained a set of xpcom interfaces and functions with the @status frozen marking.
Listening to events on all tabs
this interface does not define the set of possible status codes.
Frame script environment
if you use a capturing event listener on the contentframemessagemanager, you should verify that its event.target is set to the contentframemessagemanager global object in order to avoid handling unload events from content.
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.
Frame script environment
if you use a capturing event listener on the contentframemessagemanager, you should verify that its event.target is set to the contentframemessagemanager global object to avoid handling unload events from content.
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.
Performance
and since frame scripts get evaluated for each tab this means new function objects get instantiated, new constants get computed, block scopes must be set up etc.
Blocked: Custom cookie permission
a request to access cookies or storage was blocked because there's a custom user-defined permission set.
Firefox UI considerations for web developers
rich icons the high resolution icons—also known as rich icons—are specified by setting the rel attribute to one of: apple-touch-icon apple-touch-icon-precomposed fluid-icon the size of each icon is taken from the size attribute specified on the <link>, if it's provided.
HTMLIFrameElement.clearMatch()
searchtoggle.addeventlistener('touchend',function() { if(search.getattribute('class') === 'search') { search.setattribute('class', 'search shifted'); } else if(search.getattribute('class') === 'search shifted') { search.setattribute('class', 'search'); if(searchactive) { browser.clearmatch(); searchactive = false; prev.disabled = true; next.disabled = true; searchbar.value = ''; } } }); specification not part of any specification.
HTMLIFrameElement.download()
options optional an options object allowing optional settings to be specified for the download.
HTMLIFrameElement.executeScript()
examples var request1 = browser.executescript( var a = 3; a + 3 , {url: 'http://example.com/index.html'}); request1.onsuccess = function() { console.log(request1.result); // 6 } var request2 = browser.executescript( new promise((resolve, reject) => { settimeout(function() { resolve(6); }, 1000}) ) , {origin: 'http://example.com'}); request2.onsuccess = function() { console.log(request2.result); // 6 } if the script value is a not a promise, it is simply returned as the request value.
mozbrowseractivitydone
if the activity has a returnvalue set to true, then the activity is consumed when postresult or posterror is invoked on the activity by the receiving app.
mozbrowsererror
possible values are: fatal(crash) unknownprotocolfound filenotfound dnsnotfound connectionfailure netinterrupt nettimeout cspblocked phishingblocked malwareblocked unwantedblocked offline malformeduri redirectloop unknownsockettype netreset notcached isprinting deniedportaccess proxyresolvefailure proxyconnectfailure contentencodingfailure remotexul unsafecontenttype corruptedcontenterror certerror other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsererror", function( event ) { console.log("an error occurred:" + event.detail); }); related events mozbrow...
mozbrowserloadend
the mozbrowserloadend event is fired when the browser <iframe> has finished loading all its assets, or has failed to load.
mozbrowsershowmodalprompt
this should be set by the embedder.
mozbrowservisibilitychange
the mozbrowservisibilitychange event is fired when the visibility state of the current browser iframe <iframe> changes, for example due to a call to setvisible().
ChromeWorker
setsubstitution('my-cool-addon', fileuri); var worker = new worker('resource://my-cool-addon/worker.js'); more references: you can use chromeworker from javascript code modules.
::-moz-tree-progressmeter
activated when the type attribute is set to progressmeter.
overflow-clip-box-block
/* keyword values */ overflow-clip-box-block: padding-box; overflow-clip-box-block: content-box; /* global values */ overflow-clip-box-block: inherited; overflow-clip-box-block: initial; overflow-clip-box-block: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
overflow-clip-box-inline
/* keyword values */ overflow-clip-box-inline: padding-box; overflow-clip-box-inline: content-box; /* global values */ overflow-clip-box-inline: inherited; overflow-clip-box-inline: initial; overflow-clip-box-inline: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
overflow-clip-box
/* keyword values */ overflow-clip-box: padding-box; overflow-clip-box: content-box; /* two values */ overflow-clip-box: padding-box content-box; overflow-clip-box: content-box content-box; /* global values */ overflow-clip-box: inherit; overflow-clip-box: initial; overflow-clip-box: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box.
Chrome-only CSS reference
MozillaGeckoChromeCSS
r is presently hovering over text in a tree cell.::-moz-tree-columnactivated by the properties attribute.::-moz-tree-drop-feedbackactivated by the properties attribute.::-moz-tree-imageactivated by the properties attribute.::-moz-tree-indentationactivated by the properties attribute.::-moz-tree-lineactivated by the properties attribute.::-moz-tree-progressmeteractivated when the type attribute is set to progressmeter.
MozBeforePaint
the timestamp property of this event will be set to the time when the animation frame is sampled; this is relevant when trying to synchronize mozrequestanimationframe animations with smil animations or css transitions.
Roll your own browser: An embedding how-to
(mozilla blurb) bradsoft's topstyle css builder: implements an internal browser using mozilla activex embedding control.obsolete since gecko 7.0 nxzilla: a set of libraries that allow mozilla to be used with a nanox server.
Gecko SDK
the gecko sdk, also known as the xulrunner sdk, is a set of xpidl files, headers and tools to develop xpcom components which can then in turn e.g.
Script security
for example, expanded principals are used in the add-on sdk to give content scripts cross-domain privileges for a predefined set of domains, and to protect content scripts from access by untrusted web content, without having to give content scripts system privileges.
Gecko
character sets supported by gecko a list of the character sets supported by gecko.
Hacking with Bonsai
the build team will then pull the 8:00 am tree, and build it on a subset of the platforms, linux, win32 & macppc.
How Mozilla determines MIME Types
however, starting in mozilla 1.7alpha, mozilla does do content sniffing, like this: when the content-type sent by the server is one of (case-sensitively) text/plain text/plain; charset=iso-8859-1 text/plain; charset=iso-8859-1 and the server did not send a content-encoding header, mozilla will sniff the first block of data it gets and check for non-text bytes.
How test harnesses work
python runner the python runner: sets up the testing environment sets up environment variables (mozrunner, currently) creates a profile (mozprofile via mozrunner) sets appropriate test preferences inserts a shim extension in the profile (for non-marionette tests) gathers the tests (manifestdestiny) potentially sets up an http server for test data (mozhttpd) invokes the binary (mozrunner) it is the job of the shim extension to shut down th...
How to get a stacktrace for a bug report
if you want breakpad to leave the .dump and .extra files on your computer so that you can examine them locally, then set the moz_crashreporter_no_delete_dump environment variable to 1.
Implementing Download Resuming
you may want to use nsisimplestreamlistener to simplify this task; to get progress notifications, you can implement nsiprogresseventsink and set an interface requester as the notificationcallbacks of the channel that gives out such an event sink (this needs to be done before calling asyncopen).
Integrated Authentication
if you wish to use non-fully-qualified entries of the form mydomain.com in the above preferences for ntlm and spnego authentication, you will also need to set the preferences network.automatic-ntlm-auth.allow-non-fqdn and network.negotiate-auth.allow-non-fqdn (respectively) to true.
AddonInstall
this is guaranteed to be correct after downloading is complete but may be set earlier.
AddonManager
starting in firefox 8, you can also set the value of the preference extensions.autodisabledscopes to prevent firefox from automatically installing add-ons from the specified scopes.
Code Samples
gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { addon.uninstall(); }); disable an add-on components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { if (addon.isactive) addon.userdisabled = addon.isactive; }); listening for add-on uninstall this example sets a variable beinguninstalled that you can check when you get a profile-before-change message to do cleanup for your add-on on uninstall.
API-provided widgets
if you're in an add-on, you should not set this property, and should instead include the shortcut as part of the tooltiptext you pass in yourself.
DownloadError
becausetargetfailed read only boolean indicates an error occurred while writing to the local target.
DownloadList
a filter function may be specified to remove only a subset of those downloads.
Interfacing with the Add-on Repository
ke this when your extension starts up: var prefsservice = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); var prefbranch = prefsservice.getbranch("extensions."); var recurl = ""; try { recurl = prefbranch.getcharpref("getaddons.recommended.url"); } catch(e) { recurl = ""; } if (recurl == "") { prefbranch.setcharpref("getaddons.recommended.url", "https://services.addons.mozilla.org/%locale%/%app%/api/%api_version%/list/recommended/all/%max_results%/%os%/%version%?src=firefox"); prefsservice.savepreffile(null); } this fetches the value of the extensions.getaddons.recommended.url preference, and, if the preference doesn't exist or has no value, sets the value of the preference to...
OS.File.Error
} catch (ex) { if (ex instanceof os.file.error && ex.becausenosuchfile) { // the file does not exist } } global object os.file.error methods overview the following functions are utility functions that may be used to construct instances of os.file.error, setting the platform-specific error number.
OS.File.Info
is any write/set of inode information (such as owner, group, link count, mode, etc).
OSFile.jsm
this api is intended to replace, in time, most xpcom-based manipulation of files (nsifile, subsets of nsiioservice, etc.) by javascript code.
Examples
settimeout(function () { deferred.resolve('rawr my success value'); }, atimeout); } catch (ex) { // generally, functions returning promises propagate exceptions through // the returned promise, though they may also choose to fail early.
Promise.jsm
introduction for an introduction to promises, you may start from the add-on sdk documentation, keeping in mind that only the core subset is implemented in this module.
Localization and Plurals
downloads.xul: <stringbundleset> <stringbundle id="strings" src="chrome://downloads.properties"/> </stringbundleset> downloads.properties: # localization note (downloadstitlefiles): semi-colon list of plural forms.
Localization content best practices
for example, if you're adding a new menu item in settings on android, don't use the same string for the menu item and the following screen header.
Patching a Localization
prerequisites if you are to the point that you are patching existing localizations, we assume that you have the basic set of tools listed on the l10n prerequisites wiki page.
Localization prerequisites
to work on localization, you need a subset of the mozilla build prerequisites.
Localization technical reviews
more intl.properties checkpoints, cont we also check the plural rule for the locale, that the general.useragent.locale is set to the locale code, that accept-lang shows the locale code(s) (like ab, ab-cd,...) and is followed by en and en-us, and finally that intl.menuitems.insertseparatorbeforeaccesskeys = true, where "true" should be left untranslated.
Creating localizable web applications
you can achieve this by setting a cookie when the user changes the locale with the language dropdown, or by looking for locale code in the url.
Web Localizability
how to set up the infrastructure for localization.
What every Mozilla translator should know
when you create a bug, if you want the person in charge of the l10n to follow up your bug you should cc: l10n@mozilla.com if you choose to make changes to your localization, you should make the changes local to your disk, push them to your hg repository on merucial, test the changes on a nightly/tinderbox build, fix any errors if some are found and test again, and send the new changeset id as your "opt-in" revisions to the l10-drivers.
Writing localizable code
an example of a well used composite string is firefox's setting for visited pages: the translator can (implicitly) position the text field as he sees fit.
gettext
# #, fuzzy msgid "" msgstr "" "project-id-version: package version\n" "report-msgid-bugs-to: \n" "pot-creation-date: 2009-09-28 16:18+0200\n" "po-revision-date: year-mo-da ho:mi+zone\n" "last-translator: full name <email@address>\n" "language-team: language <ll@li.org>\n" "mime-version: 1.0\n" "content-type: text/plain; charset=charset\n" "content-transfer-encoding: 8bit\n" "plural-forms: nplurals=integer; plural=expression;\n" #.
MathML Torture Test
re pagella math; } .texgyreschola math { font-family: tex gyre schola math; } .texgyretermes math { font-family: tex gyre termes math; } .xits math { font-family: xits math; } javascript content function updatemathfont() { var mathfont = document.getelementbyid("mathfont").value; if (mathfont == "default") { document.body.removeattribute("class"); } else { document.body.setattribute("class", mathfont); } } function load() { document.getelementbyid("mathfont").
MathML Screenshots
screen captures of mtable, showing typesetting mathematical constructs in 2d.
MathML Demo: <mfrac> - fractions
and this is an example where the bevelled attribute is set inside the radical y 2 - t 2 1 ( 1 + | y 2 - t 2 | 2 ) and this shows a combination with a background image at a desired opacity mathml background image html content <div class="background"></div> <math display="block"> <mrow> <msub> <mi>z</mi> <mi>&alpha;</mi> </msub> <mrow> <mo>(</mo> <mi>f</mi> <mo>)</mo> </mrow> <mo>=</mo> <mfra...
Mozilla projects on GitHub
to learn more about setting up a github account, visit the github website.
Activity Monitor, Battery Status Menu and top
task_power_info::task_platform_idle_wakeups obtained from the task_info function.) in mac os 10.10 it appears to have been changed to measure interrupt-level wakeups (a superset of idle wakeups), which are less interesting.
Leak Gauge
getting a log file to get a log file, run the browser with the following environment variables set.
Scroll-linked effects
<body style="height: 5000px"> <script> function snap(destination) { if (math.abs(destination - window.scrolly) < 3) { scrollto(window.scrollx, destination); } else if (math.abs(destination - window.scrolly) < 200) { scrollto(window.scrollx, window.scrolly + ((destination - window.scrolly) / 2)); settimeout(snap, 20, destination); } } var timeoutid = null; addeventlistener("scroll", function() { if (timeoutid) cleartimeout(timeoutid); timeoutid = settimeout(snap, 200, parseint(document.getelementbyid('snaptarget').style.top)); }, true); </script> <div id="snaptarget" class="snaptarget" style="position: relative; top: 200px; width: 100%; height: 200px;...
about:memory
26.77 mb (100.0%) -- window-objects ├──14.59 mb (54.52%) -- layout │ ├───6.22 mb (23.24%) ── style-sets │ ├───4.00 mb (14.95%) ── pres-shell │ ├───1.79 mb (06.68%) ── frames │ ├───0.89 mb (03.33%) ── style-contexts │ ├───0.62 mb (02.33%) ── rule-nodes │ ├───0.56 mb (02.10%) ── pres-contexts │ ├───0.47 mb (01.75%) ── line-boxes │ └───0.04 mb (00.14%) ── text-runs ├───6.53 mb (24.39%) ─...
powermetrics
the second column counts "package idle exit" wakeups, which wake up the entire package as opposed to just a single core; such wakeups are particularly expensive, and this count is a subset of the first column's count.
Performance
measuring add-on startup performance a guide for add-on developers on how to set up a performance testing environment.
accessibility.tabfocus
note: on mac os x, if this preference is not set, the full keyboard access setting in system preferences > keyboard is honored.
browser.dom.window.dump.file
browser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is specified in this preference if browser.dom.window.dump.enabled is set to true.
browser.download.lastDir.savePerSite
if set to true, the data is stored as content preference.
mail.tabs.drawInTitlebar
the old behavior can be restored by setting the preference mail.tabs.drawintitlebar to false.
nglayout.debug.disable xul fastload
never set nglayout.debug.disable_xul_fastload to true in a production environment; it exists solely to aid in debugging.
Preferences system
you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate.
Productization guide
hence there is a need to customize the set of default web services on a per-locale basis in order to ensure a good user experience across all locales.
A guide to searching crash reports
only a subset of crash reports have the "moz crash reason" field -- those that crashed due to hitting a moz_crash call -- so all crashes that lack that field are omitted from this tab.
Crash reporting
finally, a set of mozilla employees have access to directly query the underlying data in either sql summary or using mapreduce on the storage cluster.
Debugging out-of-memory problems
out-of-memory exceptions from js setting memory.dump_reports_on_oom in about:config to true will cause the browser to automatically write about:memory dumps to a temp file printed to the browser console (note: not web console) when an oom crash is encountered.
Emscripten
emscripten generates fast code — its default output format is asm.js , a highly optimizable subset of javascript that can execute at close to native speed in many cases.
L20n HTML Bindings
a safe subset of html elements (e.g.
Localization Use Cases
ish without sounding like a robot: <crashbanneros2[brandshortname::_gender] { masculine: "{{ brandshortname }} uległ awarii", feminine: "{{ brandshortname }} uległa awarii", neutral: "{{ brandshortname }} uległo awarii" }> this will give us, depending on the current branding, the following messages: firefox os uległ awarii boot2gecko uległo awarii isolation let's look at how the settings app formats sizes.
MailNews automated testing
these tests are run against almost every changeset that gets committed to the thunderbird and seamonkey code bases.
McCoy
once you have a password set you can change it from the keys menu and you will have to enter it each time you run mccoy.
Midas editor module security preferences
only change these settings as needed to try the demo above and to test your own add-on or firefox-internal code, and be sure to restore the default settings when you're done!
About NSPR
linking support for linking (shared library loading and unloading) is part of nspr's feature set.
Creating a Cookie Log
change to your firefox directory (usually c:\program files\mozilla firefox) type "set nspr_log_file=c:\temp\cookie-log.txt", enter type "set nspr_log_modules=cookie:4" and press enter run firefox by typing "firefox.exe" and pressing enter.
Atomic Operations
these functions operate on 32-bit integers: pr_atomicincrement pr_atomicdecrement pr_atomicset pr_atomicadd these functions implement a simple stack data structure: pr_createstack pr_stackpush pr_stackpop pr_destroystack ...
Interval Timing
conceptually, they are based on free-running counters that increment at a fixed rate without possibility of outside influence (as might be observed if one was using a time-of-day clock that gets reset due to some administrative action).
Linked Lists
the api is a set of macros for initializing a circular (doubly linked) list, inserting and removing elements from the list.
PRErrorCode
you can also set your own errors using pr_seterror.
PRExplodedTime
when an nspr function returns a prexplodedtime object or sets a prexplodedtime object as output, all of the prexplodedtime members are set, including the nonessential members.
PRSockOption
the option field of prsocketoptiondata should be set to an enumerator of type prsockoption.
PRSocketOptionData
type for structure used with pr_getsocketoption and pr_setsocketoption to specify options for file descriptors that represent sockets.
PRThreadPrivateDTOR
syntax #include <prthread.h> typedef void (pr_callback *prthreadprivatedtor)(void *priv); description until the data associated with an index is actually set with a call to pr_setthreadprivate, the value of the data is null.
PR_DELETE
description this macro returns allocated memory to the heap from the specified location and sets _ptr to null.
PR_EXTERN
the macro includes the proper specifications to declare the target extern and set up other required linkages.
PR_GetErrorTextLength
syntax #include <prerror.h> print32 pr_geterrortextlength(void) returns if a zero is returned, no error text is currently set.
PR_GetInheritedFileMap
syntax #include <prshma.h> nspr_api( prfilemap *) pr_getinheritedfilemap( const char *shmname ); parameter the function has the following parameter: shmname the name provided to pr_processattrsetinheritablefilemap.
PR_GetOSError
returns the current thread's last set os-specific error code.
PR_GetSpecialFD
otherwise, pr_getspecialfd returns null and sets the error to pr_invalid_argument_error.
PR_GetThreadPrivate
returns null if the data has not been set.
PR ImportTCPSocket
for example, on posix systems, nspr will put the native file descriptor (an int) in non-blocking mode by calling fcntl to set the o_nonblock file status flag on the native file descriptor, and then nspr will call socket functions such as recv, send, and poll on the native file descriptor.
PR_Initialize
the thread may adjust its own priority by using pr_setthreadpriority.
PR_InitializeNetAddr
description pr_initializenetaddr allows the assignment of special network address values and the port number, while also setting the state that indicates the version of the address being used.
PR_NEWZAP
description this macro allocates an instance of the specified type from the heap and sets the content of that memory to zero.
PR_Now
you cannot assume that the values returned by pr_now() are monotonically increasing because the system clock of the computer may be reset.
PR_ReadDir
on windows platforms and the mac os, this value identifies files with the "hidden" attribute set.
PR_WaitForPollableEvent
blocks the calling thread until the pollable event is set, and then atomically unsetting the event before returning.
PR_Writev
if it is, the function will fail and the error will be set to pr_buffer_overflow_error.
Process Initialization
pr_init pr_initialize pr_initialized pr_cleanup pr_disableclockinterrupts pr_blockclockinterrupts pr_unblockclockinterrupts pr_setconcurrency pr_processexit pr_abort module initialization initialization can be tricky in a threaded environment, especially initialization that must happen exactly once.
Process Management and Interprocess Communication
process management types and constants the types defined for process management are: prprocess prprocessattr process management functions the process manipulation function fall into these categories: setting the attributes of a new process creating and managing processes setting the attributes of a new process the functions that create and manipulate attribute sets of new processes are: pr_newprocessattr pr_resetprocessattr pr_destroyprocessattr pr_processattrsetstdioredirect pr_processattrsetcurrentdirectory pr_processattrsetinheritablefd creating and managing processes the f...
NSPR release process
set the nspr version number.
CERT_FindCertByIssuerAndSN
example certissuerandsn issuersn; issuersn.derissuer.data = caname->data; issuersn.derissuer.len = caname->len; issuersn.serialnumber.data = authoritykeyid->authcertserialnumber.data; issuersn.serialnumber.len = authoritykeyid->authcertserialnumber.len; issuercert = cert_findcertbyissuerandsn(cert->dbhandle, &issuersn); if ( issuercert == null ) { port_seterror (sec_error_unknown_issuer); } see also occurrences of cert_findcertbyissuerandsn in the current nss source code (generated by lxr).
Deprecated SSL functions
function name/documentation source code replacement in nss 3.2 ssl_enable mxr ssl_optionset ssl_enablecipher mxr ssl_cipherprefsetdefault ssl_enabledefault mxr ssl_optionsetdefault ssl_redohandshake mxr ssl_rehandshake ssl_setpolicy mxr ssl_cipherpolicyset ...
Getting Started With NSS
a new set of samples is currently under development and review, see create new nss samples.
HTTP delegation
sec_httprequest_setpostdatafcn).
HTTP delegation
sec_httprequest_setpostdatafcn).
NSS Key Log Format
key logging is enabled by setting the environment variable sslkeylogfile to point to a file.
NSS 3.14.2 release notes
the release is available for download from https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_2_rtm/src/ for the primary nss documentation pages please visit /docs/nss new in nss 3.14.2 nss will now make use of the intel aes-ni and avx instruction sets for hardware-accelerated aes-gcm on 64-bit linux systems.
NSS 3.15.1 release notes
bug 875601 - secmod_closeuserdb/secmod_openuserdb fails to reset the token delay, leading to spurious failures.
NSS 3.15.2 release notes
it is no longer necessary to call nss_setdomesticpolicy because all cipher suites are now allowed by default.
NSS 3.17.3 release notes
t: d1:cb:ca:5d:b2:d5:2a:7f:69:3b:67:4d:e5:f0:5a:1d:0c:95:7d:f0 cn = globalsign ecc root ca - r4 sha1 fingerprint: 69:69:56:2e:40:80:f4:24:a1:e7:19:9f:14:ba:f3:ee:58:ab:6a:bb cn = globalsign ecc root ca - r5 sha1 fingerprint: 1f:24:c6:30:cd:a4:18:ef:20:69:ff:ad:4f:dd:5f:46:3a:1b:69:aa the version number of the updated root ca list has been set to 2.2 bugs fixed in nss 3.17.3 this bugzilla query returns all the bugs fixed in nss 3.17.3: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.17.3 compatibility nss 3.17.3 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.17 release notes
nss 3.17 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_17_rtm/src/ new in nss 3.17 new functionality when using ecdhe, the tls server code may be configured to generate a fresh ephemeral ecdh key for each handshake, by setting the ssl_reuse_server_ecdhe_key socket option to pr_false.
NSS 3.18.1 release notes
cn=mcsholding test, o=mcsholding, c=eg sha1 fingerprint: e1:f3:59:1e:76:98:65:c4:e4:47:ac:c3:7e:af:c9:e2:bf:e4:c5:76 the version number of the updated root ca list has been set to 2.4 bugs fixed in nss 3.18.1 this bugzilla query returns all the bugs fixed in nss 3.18.1: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.18.1 compatibility nss 3.18.1 shared libraries are backward compatible with all older nss 3.18 shared libraries.
NSS 3.19.3 release notes
:00:3d:27:30:13:72:43:a9:12:11:c6:75:fb cn = tÜrktrust elektronik sertifika hizmet sağlayıcısı h6 sha1 fingerprint: 8a:5c:8c:ee:a5:03:e6:05:56:ba:d8:1b:d4:f6:c9:b0:ed:e5:2f:e0 cn = certinomis - root ca sha1 fingerprint: 9d:70:bb:01:a5:a4:a0:18:11:2e:f7:1c:01:b9:32:c5:34:e7:88:a8 the version number of the updated root ca list has been set to 2.5 bugs fixed in nss 3.19.3 this bugzilla query returns all the bugs fixed in nss 3.19.3: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.19.3 compatibility nss 3.19.3 shared libraries are backward compatible with all older nss 3.19 shared libraries.
NSS 3.23 release notes
new functions in ssl.h ssl_setdowngradecheckversion - set maximum version for new serverrandom anti-downgrade mechanism.
NSS 3.28.1 release notes
sha-256 fingerprint: fe:86:3d:08:22:fe:7a:23:53:fa:48:4d:59:24:e8:75:65:6d:3d:c9:fb:58:77:1f:6f:61:6f:9d:57:1b:c5:92 cn = symantec class 2 public primary certification authority - g6 sha-256 fingerprint: cb:62:7d:18:b5:8a:d5:6d:de:33:1a:30:45:6b:c6:5c:60:1a:4e:9b:18:de:dc:ea:08:e7:da:aa:07:81:5f:f0 the version number of the updated root ca list has been set to 2.11 a misleading assertion/alert has been removed, when nss tries to flush data to the peer but the connection was already reset.
NSS 3.28.3 release notes
nss no longer reads the attribute, and will always set it to ecpoint_undefined.
NSS 3.28.5 release notes
: email cn = tubitak kamu sm ssl kok sertifikasi - surum 1 sha-256 fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16 trust flags: websites technically constrained to: gov.tr, k12.tr, pol.tr, mil.tr, tsk.tr, kep.tr, bel.tr, edu.tr, org.tr the version number of the updated root ca list has been set to 2.14.
NSS 3.29.1 release notes
nss no longer reads the attribute, and will always set it to ecpoint_undefined.
NSS 3.30.2 release notes
: email cn = tubitak kamu sm ssl kok sertifikasi - surum 1 sha-256 fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16 trust flags: websites technically constrained to: gov.tr, k12.tr, pol.tr, mil.tr, tsk.tr, kep.tr, bel.tr, edu.tr, org.tr the version number of the updated root ca list has been set to 2.14 (the version numbers 2.12 and 2.13 for the root ca list have been skipped.) bugs fixed in nss 3.30.2 bug 1350859 - march 2017 batch of root ca changes bug 1349705 - implemented domain name constraints for ca: tubitak kamu sm ssl kok sertifikasi - surum 1 compatibility nss 3.30.2 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.34 release notes
when using certutil, to set an inacceptable password in fips mode, a correct explanation of acceptable passwords will be printed.
NSS 3.39 release notes
support for these keys is disabled by default but can be enabled using ssl_signatureschemeprefset().
NSS 3.41 release notes
ingerprint: b7c36231706e81078c367cb896198f1e3208dd926949dd8f5709a410f75b6292 bugs fixed in nss 3.41 bug 1412829, reject empty supported_signature_algorithms in certificate request in tls 1.2 bug 1485864 - cache side-channel variant of the bleichenbacher attack (cve-2018-12404) bug 1481271 - resend the same ticket in clienthello after helloretryrequest bug 1493769 - set session_id for external resumption tokens bug 1507179 - reject ccs after handshake is complete in tls 1.3 this bugzilla query returns all the bugs fixed in nss 3.41: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.41 compatibility nss 3.41 shared libraries are backward compatible with all older ns...
NSS 3.43 release notes
the following ca certificates were removed: none bugs fixed in nss 3.43 bug 1528669 and bug 1529308 - improve gyp build system handling bug 1529950 and bug 1521174 - improve nss s/mime tests for thunderbird bug 1530134 - if docker isn't installed, try running a local clang-format as a fallback bug 1531267 - enable fips mode automatically if the system fips mode flag is set bug 1528262 - add a -j option to the strsclnt command to specify sigschemes bug 1513909 - add manual for nss-policy-check bug 1531074 - fix a deref after a null check in seckey_setpublicvalue bug 1517714 - properly handle esni with hrr bug 1529813 - expose hkdf-expand-label with mechanism bug 1535122 - align tls 1.3 hkdf trace levels bug 1530102 - use getentropy on compatible versions of f...
NSS 3.44.3 release notes
bugs fixed in nss 3.44.3 bug 1579060 - don't set the constructed bit for issueruniqueid and subjectuniqueid in mozilla::pkix cve-2019-11745 - encryptupdate should use maxout, not block size this bugzilla query returns all the bugs fixed in nss 3.44: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.44 compatibility nss 3.44.3 shared libraries are backwa...
NSS 3.47 release notes
bugs fixed in nss 3.47 bug 1459141 - make softoken cbc padding removal constant time bug 1589120 - more cbc padding tests bug 1465613 - add ability to distrust certificates issued after a certain date for a specified root cert bug 1588557 - bad debug statement in tls13con.c bug 1579060 - mozilla::pkix tag definitions for issueruniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk11load and stanpcertdb bug 1576307 - check mechanism param and param length befor...
NSS 3.49 release notes
bugs fixed in nss 3.49 bug 1513586 - set downgrade sentinel for client tls versions lower than 1.2.
NSS 3.50 release notes
nss 3.49.1 sped up pbkdf2 operations, though pbkdf1 operations are also relevant for older nss databases (also included in nss 3.49.2) bug 1608895 - gyp builds on taskcluster broken by setuptools v45.0.0 (for lacking python3) bug 1574643 - upgrade hacl* verified implementations of chacha20, poly1305, and 64-bit curve25519 bug 1608327 - two problems with neon-specific code in freebl bug 1575843 - detect aarch64 cpu features on freebsd bug 1607099 - remove the buildbot configuration bug 1585429 - add more hkdf test vectors bug 1573911 - add more rsa test vectors bug 1605314 - ...
NSS 3.54 release notes
bug 1644774 - ssl gtests to use clearservercache when resetting self-encrypt keys.
NSS 3.56 release notes
bug 1653975 - fix 3.53 regression by setting "all" as the default makefile target.
NSS Sample Code sample6
* in a real app, this function should obtain the password using secure means * such as prompting an operator, or retrieving it over a secure communication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; /* initialize nss */ pk11_setpasswordfunc(passwdcb); /* the nss db must be initialized read-write since we'll be creating * keys in it.
nss tech note4
item phonenum; secitem rfc822name; secitem id; secitem maxusers; }; typedef struct _mycertextdata mycertextdata; /* template used for decoding the extension */ const sec_asn1template mycertexttemplate[] = { { sec_asn1_sequence, 0, null, sizeof( mycertextdata ) }, { sec_asn1_integer, offsetof(mycertextdata, version) }, { sec_asn1_octet_string, offsetof( mycertextdata, streetaddress ) }, { sec_asn1_octet_string, offsetof( mycertextdata, phonenum ) }, { sec_asn1_octet_string, offsetof( mycertextdata, rfc822name ) }, { sec_asn1_octet_string, offsetof( mycertextdata, id ) }, { sec_asn1_integer, offsetof(mycertextd...
nss tech note6
for example, on 32-bit solaris sparc for nss 3.11, say shlibsign -v -i libsoftokn3.so shlibsign -v -i libfreebl_32int64_3.so shlibsign -v -i libfreebl_32fpu_3.soshlibsign -v -i libfreebl_32int_3.so (you need to set ld_library_path appropriately and specify the correct pathnames of the libraries.) option 1 is simpler and highly preferred.
nss tech note7
struct myrsapublickey { secitem m_modulus; secitem m_exponent; } inpubkey; secitem derpubkey; seckeypublickey *pubkey; const sec_asn1template myrsapublickeytemplate[] = { { sec_asn1_sequence, 0, null, sizeof(myrsapublickey) }, { sec_asn1_integer, offsetof(myrsapublickey,m_modulus), }, { sec_asn1_integer, offsetof(myrsapublickey,m_exponent), }, { 0, } }; prarenapool *arena; /* * point inpubkey.m_modulus and m_exponent at the data, and * then set their types to unsigned integers.
Notes on TLS - SSL 3.0 Intolerant Servers
you can also avoid such a problem by editing an existing profile -- check the preference option setting at: edit | preferences | privacy and security | ssl | enable tls, and turn it off if it is on for these earlier browsers.
Overview of NSS
nss comes with an extensive and growing set of documentation, including introductory material, api references, man pages for command-line tools, and sample code.
PKCS 7 functions
and later sec_pkcs7getsignercommonname mxr 3.4 and later sec_pkcs7getsigneremailaddress mxr 3.4 and later sec_pkcs7getsigningtime mxr 3.4 and later sec_pkcs7includecertchain mxr 3.2 and later sec_pkcs7iscontentempty mxr 3.2 and later sec_pkcs7setcontent mxr 3.4 and later sec_pkcs7verifydetachedsignature mxr 3.4 and later sec_pkcs7verifysignature mxr 3.2 and later secmime_decryptionallowed mxr 3.4 and later ...
FC_DecryptDigestUpdate
after calling both fc_decryptinit and fc_digestinit to set up the operations this function may be called multiple times.
FC_DecryptVerifyUpdate
after calling both fc_decryptinit and fc_verifyinit to set up the operations this function may be called multiple times.
FC_DigestEncryptUpdate
after calling both fc_digestinit and fc_encryptinit to set up the operations this function may be called multiple times.
FC_DigestFinal
if pdigest is null the length of the digest is returned and fc_digestfinal may be called again with pdigest set to retrieve the digest.
FC_FindObjects
description fc_findobjects returns the next set of object handles matching the criteria set up by the previous call to fc_findobjectsinit and sets the object count variable to their number or to zero if there are none.
FC_FindObjectsInit
description fc_findobjectsinit sets the attribute list for an object search.
FC_GetOperationState
return value examples see also fc_setoperationstate, nsc_getoperationstate ...
FC_GetSessionInfo
ckf_serial_session (0x00000004): this flag is provided for backward compatibility and is always set to true.
FC_SignEncryptUpdate
after calling both fc_signinit and fc_encryptinit to set up the operations this function may be called multiple times.
FC_SignFinal
if psignature is null the length of the signature is returned and fc_signfinal may be called again with psignature set to retrieve the signature.
FC_UnwrapKey
if pwrappedkey is null the length of the wrapped key is returned in puswrappedkeylen and fc_unwrapkey may be called again with pwrappedkey set to retrieve the wrapped key.
FC_WrapKey
if pwrappedkey is null the length of the wrapped key is returned in puswrappedkeylen and fc_wrapkey may be called again with pwrappedkey set to retrieve the wrapped key.
NSS Key Functions
when you call cert_destroycertificate or seckey_destroyprivatekey, the function decrements the reference count and, if the reference count reaches zero as a result, both frees the memory and sets all the bits to zero.
troubleshoot.html
if the build fails early on the gmakein coreconf try updating your cvs tree with -p: cd mozilla cvs update -p building a 32-bit version on a 64-bit may fail with: /usr/include/features.h:324:26: fatal error: bits/predefs.h: no such file or directory in this case remember to set use_64=1 testing nss the ssl stress test opens 2,048 tcp connections in quick succession.
sslkey.html
when you call cert_destroycertificate or seckey_destroyprivatekey, the function decrements the reference count and, if the reference count reaches zero as a result, both frees the memory and sets all the bits to zero.
ssltyp.html
when you call seckey_destroyprivatekey, the function both frees the memory and sets all the bits to zero.
NSS tools : signtool
--verbosity value sets the quantity of information netscape signing tool generates in operation.
Necko Interfaces Overview
nsiioservice central necko service manages protocol handlers thin layer over protocol handlers provides interface for creating uri objects from uri strings maps uri scheme to appropriate nsiprotocolhandler impl nsiuri (nsiurl, nsifileurl, nsistandardurl) represents an uri, with getters and setters for various uri parts (eg.
Pork
the core of pork is a c++ parser that provides exact character positions for the start and end of every ast node, as well as the set of macro expansions that contain any location.
Rhino documentation
examples a set of examples showing how to control the javascript engine and build javascript host objects.
Rhino overview
setting this property to true requires that any calls that compile or evaluate javascript must supply a security domain object of any object type that will be used to identify javascript code.
Future directions
it will take some experimentation to build the right set of parallel facilities.
SpiderMonkey Internals: Thread Safety
the program must group jsapi calls into "requests": js_setcontextthread(cx); js_beginrequest(cx); /* ...
INT_FITS_IN_JSVAL
*/ } else { js_reporterror(cx, "integer out of range: %d", item); } see also int_to_jsval changeset - 52750:05bd86e3559a ...
JS::GetFirstArgumentAsTypeHint
if args.get(0) is one of the strings "string", "number", or "default", set *result to jstype_string, jstype_number, or jstype_void accordingly and return true.
JSFunctionSpec
if the function does not wrap a native js call, set this value to null.
JSGetObjectOps
description jsobjectops is used by js_newobject's internals to discover the set of high-level object operations to use for new objects of the given class.
JSObject
each property has a name, a getter, a setter, and property attributes.
JSObjectPrincipalsFinder
jsobjectprincipalsfinder is the type of a security callback that can be configured using js_setobjectprincipalsfinderjsapi 1.8 and earlier or js_setruntimesecuritycallbacksadded in spidermonkey 1.8.1.
JSPrincipalsTranscoder
jsprincipalstranscoder is the type of a security callback that can be configured using js_setprincipalstranscoderjsapi 1.8 and earlier or js_setruntimesecuritycallbacksadded in spidermonkey 1.8.1.
JSProperty
it is used internally in jsobjectops.lookupproperty, getattributes, setattributes, and dropproperty.
JSPropertyDescriptor
setter the set syntax binds an object property to a function to be called when there is an attempt to set that property.
JSResolveOp
the callback must set *resolvedp to true and return true if the property is resolved, or set *resolvedp to false and return true if the object has no lazy property with the given id; or return false to indicate any other error.
JSRuntime
sample code to set up and tear down a jsruntime and a jscontext is at jsapi user guide.
JSSecurityCallbacks.contentSecurityPolicyAllows
(it is also the type of the callback set by js_setcheckobjectaccesscallback.) syntax typedef jsbool (*jscspevalchecker)(jscontext *cx); name type description cx jscontext * the js context in which the property access attempt is occurring.
JS_AliasElement
see also js_defineelement js_deleteelement js_getarraylength js_getelement js_isarrayobject js_lookupelement js_newarrayobject js_setarraylength js_setelement bug 576034 ...
JS_AliasProperty
see also js_defineproperty js_definepropertywithtinyid js_deleteproperty js_getproperty js_lookupproperty js_setproperty bug 576034 ...
JS_CheckForInterrupt
see also mxr id search for js_checkforinterrupt js_setinterruptcallback js_getinterruptcallback js_requestinterruptcallback bug 1058695 ...
JS_ClearDateCaches
see also mxr id search for js_cleardatecaches js_newdateobject js_newdateobjectmsec js_objectisdate bug 285615 replaced by js::resettimezone ...
JS_ClearNewbornRoots
see js_enterlocalrootscope for a better way to manage newborns in cases where native hooks (functions, getters, setters, etc.) create many gc-things, potentially without connecting them to predefined local roots such as *rval or argv[i] in an active jsnative function.
JS_ClearPendingException
see also mxr id search for js_clearpendingexception js_getpendingexception js_isexceptionpending js_reportpendingexception js_setpendingexception ...
JS_ClearRegExpStatics
see also mxr id search for js_clearregexpstatics js_newregexpobject js_newucregexpobject js_setregexpinput regexp ...
JS_ClearScope
see also js_deleteproperty js_deleteelement js_clearnonglobalobject js_setallnonreservedslotstoundefined bug 749371 ...
JS_CompileFunction
see also mxr id search for js_compilefunction mxr id search for js_compileucfunction jsfun_bound_method jsfun_global_parent js_callfunction js_callfunctionname js_callfunctionvalue js_decompilefunction js_decompilefunctionbody js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_setbranchcallback js_valuetofunction bug 1089026 ...
JS_CompileScript
if the jsoption_compile_n_go option is set in cx, the resulting script must be executed in this scope, and at most once.
JS_ContextIterator
description js_contextiterator steps through the set of contexts associated with the runtime rt.
JS_ConvertValue
typically users of this function set vp to point to v, so that if conversion is successful, v now contains the converted value.
JS_DecompileFunction
see also mxr id search for js_decompilefunction js_decompilescript js_callfunction js_callfunctionname js_callfunctionvalue js_compilefunction js_decompilefunctionbody js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_setbranchcallback js_valuetofunction ...
JS_DecompileFunctionBody
see also mxr id search for js_decompilefunctionbody js_decompilescript js_callfunction js_callfunctionname js_callfunctionvalue js_compilefunction js_decompilefunction js_definefunction js_definefunctions js_getfunctionobject js_newfunction js_setbranchcallback js_valuetofunction ...
JS_DefineObject
name is the property name to assign to obj to hold the new object, and flags contains the property attributes to set for the newly created property.
JS_DeleteElement
to truncate an array, use js_setarraylength.
JS_DestroyContext
if js_setcontextcallback has been called, this calls the callback.
JS_EnterLocalRootScope
description scoped local root management allows native functions, getter/setters, etc.
JS_ForwardGetPropertyTo
on success, these functions set *vp to the current value of the property, or undefined if obj has no such property, and return true.
JS_GC
use js_setgccallback to add hooks that are called during garbage collection.
JS_GetArrayLength
see also mxr id search for js_getarraylength js_getelement js_setarraylength ...
JS_GetContextThread
see js_setcontextthread.
JS_GetFunctionId
unction f() {} // f var x = function() {}; // x var a = { b: function() {} }; // a.b a.c = function() {}; // a.c a.d = (function() { // a.d< -- the '<' loosely means "contributor to" return function() {}; // a.d })(); var foo = function() { // foo var bar = function() {}; // foo/bar }; settimeout(function() {}, 100); // no name, js_getfunctiondisplayid returns null see also mxr id search for js_getfunctionid mxr id search for js_getfunctiondisplayid bug 433529 - added js_getfunctiondisplayid ...
JS_GetImplementationVersion
see also mxr id search for js_getimplementationversion js_getversion js_setversionforcompartment ...
JS_GetInstancePrivate
see also mxr id search for js_getinstanceprivate jsclass_has_private jsval_to_private js_getprivate js_initclass js_instanceof js_reporterror js_setprivate bug 959787 -- added args parameter ...
JS_GetOwnPropertyDescriptor
on success, if no property is found, desc->obj is set to null.
JS_GetPendingException
see also mxr id search for js_getpendingexception js_isexceptionpending js_clearpendingexception js_reportpendingexception js_setpendingexception ...
JS_GetPrivate
getters, setters, and methods of custom classes should use js_getinstanceprivate instead to avoid this danger.
JS_GetPropertyDefault
on success, these functions set *vp to the current value of the property, or def if obj has no such property, and return true.
JS_GetPropertyDescriptor
on success, if no property is found, desc->obj is set to null.
JS_GetScopeChain
note that cx's current global object, as set by js_setglobalobject, is not guaranteed to be on the scope chain.
JS_HasArrayLength
see also js_defineelement js_deleteelement js_getarraylength js_getelement js_isarrayobject js_lookupelement js_newarrayobject js_setarraylength js_setelement bug 657298 ...
JS_HasInstance
when providing a prototype as obj, the prototype's jsclass must have its hasinstance method set.
JS_IsArrayObject
on success, returns true and sets isarray indicating whether obj is an array object or a wrapper around one.
JS_IsAssigning
syntax jsbool js_isassigning(jscontext *cx); name type description description js_isassigning returns true if a script is executing and its current bytecode is a set (assignment) operation, even if there are native (no script) stack frames between the script and the caller to js_isassigning.
JS_IsConstructing
js_isconstructing returns js_true if the native was defined with jsfun_constructor (js_initclass automatically sets that flag when defining a constructor) and it was called as a constructor, either from javascript, using the new keyword, or from c/c++ using a jsapi function such as js_constructobject.
JS_IsConstructing_PossiblyWithGivenThisObject
vp const jsval * maybethis jsobject ** description in the case of a constructor called from js_constructobject and js_initclass where the class has the jsclass_construct_prototype flag set, spidermonkey passes the constructor a non-standard this object.
JS_IsExceptionPending
*/ if (pending) { js_setpendingexception(cx, exception); } see also mxr id search for js_isexceptionpending js_setpendingexception js_getpendingexception js_clearpendingexception js_reportpendingexception ...
JS_LookupProperty
objects may pretend that the property does not exist when this flag is set.
JS_MapGCRoots
perform some action for each object in a jsruntime's gc root set.
JS_NewArrayObject
the new array has the specified length, but it doesn't have any elements.) it is often better to call js_newarrayobject(cx, 0, null), store the returned object in a gc root, and then populate its elements with js_setelement or js_defineelement.
JS_NewCompartmentAndGlobalObject
clasp->flags must have the jsclass_global_flags bits set.
JS_NewContext
see also mxr id search for js_newcontext js_destroycontext js_contextiterator js_setcontextcallback ...
JS_NewExternalString
if you use this as a pointer, you should clean it up in the external string finalizer that was previously set up using js_addexternalstringfinalizer.
JS_NewObject
added in spidermonkey 1.8.1 clasp->flags must not have the jsclass_global_flags bits set (use js_newglobalobject instead).
JS_NewObjectForConstructor
if the constructor does not have a prototype property, this function will return null and set an exception on cx.
JS_RemoveRootRT
unregisters a pointer to a gc thing so that it is no longer a member of the garbage collector's root set.
JS_ReportError
if the caller is in a jsapi callback, js_reporterror also creates a new javascript error object and sets it to be the pending exception on cx.
JS_ReportOutOfMemory
see js_reporterror and js_seterrorreporter for more information about error handling in the jsapi.
JS_RestoreExceptionState
if any exception was pending when js_saveexceptionstate was called, the same exception will be set to pend for the current context.
JS_SaveFrameChain
description these two functions are used to set aside cx's call stack while that stack is inactive.
JS_SealObject
description js_sealobject prevents all write access to the object, either to add a new property, delete an existing property, or set the value or attributes of an existing property.
JS_StringToVersion
jsversion_1_3 obsolete since jsapi 24 "1.4" jsversion_1_4 obsolete since jsapi 24 "ecmav3" jsversion_ecma_3 "1.5" jsversion_1_5 obsolete since jsapi 24 "1.6" jsversion_1_6 "1.7" jsversion_1_7 "1.8" jsversion_1_8 other jsversion_unknown see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_versiontostring bug 824312 ...
JS_THREADSAFE
for such cases, use js_clearcontextthread and js_setcontextthread to transfer the context safely from one thread to another.
JS_ValueToNumber
if the string is not a numeric string, *dp is set to nan.
JS_VersionToString
1.4" obsolete since jsapi 24 jsversion_ecma_3 "ecmav3" jsversion_1_5 "1.5" obsolete since jsapi 24 jsversion_1_6 "1.6" jsversion_1_7 "1.7" jsversion_1_8 "1.8" jsversion_ecma_5 "ecmav5" jsversion_default "default" other null see also mxr id search for js_stringtoversion jsversion js_getversion js_setversionforcompartment js_stringtoversion bug 824312 ...
JS_updateMallocCounter
see also mxr id search for js_updatemalloccounter changeset 88cfae411a2a js_newruntime js_getgcparameter bug 517665 ...
SpiderMonkey 1.8.8
h uintn, intn unsigned (also known as unsigned int), int n/a jsdouble double n/a jsuintn, jsintn unsigned (also known as unsigned int), int n/a jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide definitions for these types.
SpiderMonkey 31
js_seticumemoryfunctions is a new function which can be used to set the allocation and deallocation functions used by the icu internationalization library.
SpiderMonkey 38
(bug 1037869) js_getstringcharsz (bug 1037869) js_getstringcharszandlength (bug 1037869) js_gettypename (bug 1037718) js_isabouttobefinalized (bug 650161) js_lookupelement (bug 1094176) js_lookupproperty (bug 1094176) js_lookuppropertybyid (bug 1094176) js_lookupucproperty (bug 1094176) js_newpropertyiterator (bug 1081660) js_nextproperty (bug 1081660) js_resolvestub (bug 1103152) js_setfinalizecallback (bug 996785) js_setfunctioncallback (bug 1103269) jschar (bug 1063962) api changes jschar, a typedef for the standard c++ type char16_t, has been removed.
SavedFrame
source metadata generated from file: js/src/doc/savedframe/savedframe.md watermark: sha256:3475238d6704c659cb3e411b9c601d6ee836762dea14203f1f00ecf2c3b32452 changeset: 251fccc1f62b ...
Split object
again, spidermonkey enforces a slightly stronger rule: outer objects may never appear in a scope chain at all, except when put there by an explicit c-level jsapi call (to js_setparent or equivalent).
SpiderMonkey: The Mozilla JavaScript runtime
setting up cdt to work on spidermonkey how to configure eclipse to work on the spidermonkey code.
TPS Formdata Lists
a formdata asset list is an array of objects, each with the following properties: fieldname: required.
TPS History Lists
there are two types of history asset lists, one used for adding/modiyfing/verifying history, and the other for deleting history.
TPS Password Lists
a password asset list is an array of objects, each representing a stored password.
TPS Tab Lists
a tabs asset list is an array of objects with the following keys: uri: the uri of the tab, required.
compare-locales
ab-cd browser chrome/browser browser.dtd +backforwardmenu.tooltip +fullzoomenlargecmd.commandkey3 +fullzoomreducecmd.commandkey2 +fullzoomresetcmd.commandkey2 +organizebookmarks.label -showallbookmarkscmd2.label migration/migration.dtd -importfromfile.accesskey -importfromfile.label +importfromhtmlfile.accesskey +importfromhtmlfile.label you can assume changed strings when you see entities removed and added with a similar name.
Using RAII classes in Mozilla
we have a set of macros that will cause a class to assert when it is instantiated at a temporary.
Signing Mozilla apps for Mac OS X
--deep for v2 signing, sign all nested executables with the same settings.
Implementation Details
in addition, state_defunct is set on objects that should be released by the assistive technology.
XForms Accessibility
you can try the following link to test xforms accessibility: visual xforms elements in xhtml document at bugzilla.mozilla.org visual xforms elements in xul document at bugzilla.mozilla.org you can see xforms sample tests at mozilla xforms project there are set of tests at beaufour.dk w3c's xforms test at w3.org keyboard navigation issues navigation sequence though xforms spec declares navindex attribute to define the navigation sequence (see 1.0 specs or 1.1 specs) but rich schwerdtfeger (distinguished engineer, swg accessibility architect/strategist chair, ibm accessibility architecture review board) gave some clarification about navindex.
Feed content access API
loading the feed and sending it to the parser is done using code similar to this: fetch: function(feedurl) { var httprequest = null; function inforeceived() { var data = httprequest.responsetext; var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); var uri = ioservice.newuri(feedurl, null, null); if (data.length) { var parser = components.classes["@mozilla.org/feed-processor;1"] .createinstance(components.inter...
The Places database
extensions might also set favicons for pages that have never been visited.
Preferences API
interfaces the preferences api is exposed as a set of xpcom components and interfaces: nsiprefservice, nsiprefbranch.
STEEL
it is a fuel-like set of interfaces to facilitate thunderbird extension development.
Toolkit API
the mozilla toolkit is a set of programming interfaces (apis) built on top of gecko which provide advanced services to xul applications.
Fun With XBL and XPConnect
completelistener"> <![cdata[ ({ onautocompleteresult: function(aitem, aoriginalstring, amatch) { if ( aitem ) { anonymouscontent[0].value = amatch; } } }) ]]> </property> as long as the js for the value of autocompletelistener evaluates to an object (and wrapping the expression with a set of parens like i did, does this), then the value of autocompletelistener is an object that implements my interface.
XPCOM array guide
MozillaTechXPCOMGuideArrays
enumerators enumerators are very simple, structure-free objects for visiting each member of a set of objects.
Resources
this material may be distributed only subject to the terms and conditions set forth in the open publication license, v1.02 or later.
XPCOM guide
MozillaTechXPCOMGuide
this article details those changes, and provides suggestions for how to update your code.xpcom hashtable guidea hashtable is a data construct that stores a set of items.
Interfacing with the XPCOM cycle collector
in the unlink method (or destructor) you need to set the object pointer to null: ns_impl_cycle_collection_unlink_begin(nsfoo) ...
Components.Exception
x var exception = [ new ] components.exception([ message [, result [, stack [, data ] ] ] ]); parameters message a string which can be displayed in the error console when your exception is thrown or in other developer-facing locations, defaulting to 'exception' result the nsresult value of the exception, which defaults to components.results.ns_error_failure stack an xpcom stack to be set on the exception (defaulting to the current stack chain) data any additional data you might want to store, defaulting to null example throw components.exception("i am throwing an exception from a javascript xpcom component."); ...
Components.utils.exportFunction
exportfunction() is made available as a global in sandboxes which have the wantexporthelpers option set in the sandbox() constructor.
Components object
utils.setgczeal() sets the gc zeal level for the context.
Using components
frame :: scratchpad/4 :: cdump :: line 8 manager=[xpconnect wrapped nsicomponentmanager] id=[object nsxpccomponents_id] exception=[object nsxpccomponents_exception] reporterror=function reporterror() { [native code] } cancreatewrapper=function cancreatewrapper() { [native code] } cancallmethod=function cancallmethod() { [native code] } cangetproperty=function cangetproperty() { [native code] } cansetproperty=function cansetproperty() { [native code] } ...
nsIRegistry
js> rs.setstringutf8(530, "directory", "/home/lion/somewhere/else") js> rs.getstringutf8(530, "directory") /home/lion/somewhere/else yes!
HOWTO
resource://app/ uri let ios = cc["@mozilla.org/network/io-service;1"] .getservice(ci.nsiioservice); let reshandler = ios.getprotocolhandler("resource") .queryinterface(ci.nsiresprotocolhandler); let mozdir = cc["@mozilla.org/file/directory_service;1"] .getservice(ci.nsiproperties) .get("curprocd", ci.nsilocalfile); let mozdiruri = ios.newfileuri(mozdir); reshandler.setsubstitution("app", mozdiruri); // register chrome://* uris let cr = cc["@mozilla.org/chrome/chrome-registry;1"] .getservice(ci.nsichromeregistry); cr.checkfornewchrome(); } bug 546628 would make this unnecessary.
Profiling XPCShell
to use it, you need to enable it in your mozconfig: ac_add_options --enable-xpctools now you can profile an entire script by setting the environment variable <tt>mozilla_js_profiler_output</tt> to a filename where you want the output file.
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
Assign
« xpcom api reference summary the assign family of functions sets the value of a string's internal buffer.
Replace
« xpcom api reference summary the replace family of functions sets the value of a string's internal buffer.
nsAutoRef
no copy constructor nor copy assignment operators are available, so the handle to the resource will be held until released on destruction of the nsautoref or until explicitly reset() or transferred through provided methods.
nsEmbedCString
remarks the default constructor sets the string's internal buffer to point to a static empty (zero-length) buffer.
nsEmbedString
remarks the default constructor sets the string's internal buffer to point to a static empty (zero-length) buffer.
XPCOM glue classes
eferences from c++ code.nscountedrefnscountedref<t> is a template class implementing an object that takes a strong reference to a reference-counted resource that must be released, typically on destruction of the object.</t>nscstringclass declarationnscstring externalclass declarationnscstringcontainer (external)class declaration nscstringencodingthe nscstringencoding enumeration describes the set of character encodings understood by the ns_cstringtoutf16 and ns_utf16tocstring functions.nsdependentcstringclass declarationnsdependentcstring externalclass declarationnsdependentcsubstringclass declarationnsdependentcsubstring externalclass declarationnsdependentstringclass declarationnsdependentstring externalclass declarationnsdependentsubstringclass declarationnsdependentsubstring externalc...
IAccessible2
nrelations actual number of relations in the returned array (not more than maxrelations) return value s_false if there are no relations, nrelations() is set to 0.
IAccessibleAction
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) every accessible object that can be manipulated via the native gui beyond the methods available either in the msaa iaccessible interface or in the set of iaccessible2 interfaces (other than this iaccessibleaction interface) should support the iaccessibleaction interface in order to provide assistive technology access to all the actions that can be performed by the object.
amIInstallTrigger
return value install() starts a new installation of a set of add-ons.
imgIEncoder
xoffset=# -- default: "0" yoffset=# -- default: "0" where to draw the frame, relative to the canvas.
mozIAsyncHistory
updateplaces() adds a set of visits for one or more moziplaceinfo objects, and updates each moziplaceinfo's title or guid.
mozIColorAnalyzer
void findrepresentativecolor( in nsiuri imageuri, in mozirepresentativecolorcallback callback ); parameters imageuri a uri pointing to the image - ideally a data: uri, but any scheme that will load when setting the src attribute of a dom img element should work.
mozIRegistry
i think a simple clsid "alias" mechanism (equivalent to com's "component categories" in some respects), along with the ability to "set" services (versus the service manager insisting on creating the services itself) would suffice.
mozIStorageVacuumParticipant
the vacuum manager will try to restore wal mode, but this will only work reliably if the participant properly resets statements.
ExtendSelection
see also nsiaccessible.setselected() nsiaccessible.takeselection() ...
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.
TakeSelection
see also nsiaccessible.setselected() nsiaccessible.extendselection() ...
nsIAccessibleCaretMoveEvent
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description caretoffset long return caret offset.
nsIAccessibleHyperText
getlinkindex() the link index at the given offset (character index).
nsIAccessibleRelation
accessible/public/nsiaccessiblerelation.idlscriptable this interface gives access to an accessibles set of relations.
nsIAccessibleTextChangeEvent
start long returns offset of changed text in accessible.
nsIApplicationCacheNamespace
1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) application caches can store a set of namespace entries that affect loads from the application cache.
nsIApplicationCacheService
netwerk/base/public/nsiapplicationcacheservice.idlscriptable this interface manages the set of application cache groups that manage offline resources for web applications.
nsIAsyncInputStream
closewithstatus() this method closes the stream and sets its internal status.
nsIAsyncOutputStream
closewithstatus() this method closes the stream and sets its internal status.
nsIAuthModule
confidential if set to true, it will encrypt the data, otherwise data will just be integrity protected (checksummed).
nsIAutoCompleteInput
void onsearchbegin(); void onsearchcomplete(); boolean ontextentered(); boolean ontextreverted(); void selecttextrange(in long startindex, in long endindex); attributes attribute type description completedefaultindex boolean if a search result has its defaultindex set, this will optionally try to complete the text in the textbox to the entire text of the result at the default index as the user types.
nsICacheListener
inherits from: nsisupports last changed in gecko 14 (firefox 14 / thunderbird 14 / seamonkey 2.11) method overview void oncacheentryavailable(in nsicacheentrydescriptor descriptor, in nscacheaccessmode accessgranted, in nsresult status); void oncacheentrydoomed(in nsresult status); methods oncacheentryavailable() this method is called when the requested access (or appropriate subset) is acquired.
nsICommandController
ase-command-controller;1"] .createinstance(components.interfaces.nsicommandcontroller); method overview void docommandwithparams(in string command, in nsicommandparams acommandparams); void getcommandstatewithparams( in string command, in nsicommandparams acommandparams); methods docommandwithparams() executes the specified command with a set of parameters contained in an nsicommandparams object.
nsICommandLine
in most cases, this will be null (xremote will sometimes set this attribute).
nsIDNSRecord
rewind() this function resets the internal address iterator to the first address in the record.
nsIDNSService
resolve_disable_ipv6 (1 << 5) if this flag is set, only ipv4 addresses will be returned by asyncresolve() and resolve().
nsIDOMOfflineResourceList
mozitem returns the uri of the item at the specific offset into the list of cached resources.
nsIDOMStorageManager
usage is checked against the domain of the page that set the key (the owner domain), not the domain of the storage object.
nsIDOMWindow2
it represents a single window object that may contain child windows if the document in the window contains an html frameset document, or if the document contains <iframe> elements.
nsIDOMXULLabeledControlElement
inherits from: nsidomxulcontrolelement last changed in gecko 1.7 attributes attribute type description accesskey domstring this should be set to a character that is used as a shortcut key.
nsIDeviceMotion
native code only!addwindowlistener sets the nsiaccelerometer as the source for mozorientation events on the specified dom window.
nsIDownload
once the download is complete, this value is set to null.
nsIDownloadProgressListener
in such a situation no further event handlers are called and the stop flag is set; if there are more pending downloads in such a situation not yet started they never start.
nsIDragDropHandler
hookupto() attaches drag handlers to a specified receiver, setting up callbacks to let built-in behaviors be overridden.
nsIEffectiveTLDService
cookie setting and domain highlighting, but you should check whether it's the right answer for your application.
nsIException
message string a custom message set by the thrower.
nsIFaviconDataCallback
the caller will receive the most information we can gather on the icon, but it's not guaranteed that all of them will be set.
nsIFeedProgressListener
bozo the bozo bit will be set if the error was due to a fatal error.
nsIFeedResult
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void registerextensionprefix(in astring anamespace, in astring aprefix); attributes attribute type description bozo boolean the feed processor sets the bozo bit when a feed triggers a fatal error during xml parsing.
nsIFormHistory2
toolkit/components/satchel/public/nsiformhistory.idlscriptable a service which holds a set of name/value pairs.
nsIFrameLoaderOwner
this may only be possible in a very limited set of circumstances, or never, depending on the object implementing this interface.
nsIFrameMessageManager
set to oo if you want to receive messages during the short period after a frame has been removed from the dom and before its frame script has finished unloading.
nsIFrameScriptLoader
if present and set to true, this flag switches off that behavior, meaning that the script's scope is shared with any other frame scripts in the same frame that have also set the flag.
nsIIDNService
isascii on return, this is set to true if the result is ascii or ace encoded; otherwise it's false.
nsIIdleService
example example 1 var idleservice = components.classes["@mozilla.org/widget/idleservice;1"] .getservice(components.interfaces.nsiidleservice) settimeout(function() { alert(idleservice.idletime) }, 1000) // if you don't use the mouse or the keyboard after running this snippet, // you'll see a number around 1000 alerted.
nsIInputStream
static ns_method appendsegment(nsiinputstream* astream, void* aclosure, const char* afromsegment, uint32_t atooffset, uint32_t acount, uint32_t* awritecount) { // afromsegment now contains acount bytes of data.
nsIJSID
the name of the jsid, if it was set.
nsIJumpListBuilder
addlisttobuild() adds a list and if required, a set of items for the list.
Using nsILoginManager
the hostname, username and password attributes are mandatory, while the other fields are set based on whether the login is for a web page form or an http/ftp authentication site login.
nsILoginManagerPrompter
note: because the caller does not know the username of the login to be changed, anewlogin.username and anewlogin.usernamefield will be set (using the user's selection) before modifylogin() is called.
nsIMemoryReporter
when a reporter from a child process is copied into the main process, the copy's process field is set appropriately.
nsIMessageSender
for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
nsIModule
registerself() when the nsimodule is discovered, this method will be called so that any setup registration can be preformed.
nsIMsgAccountManagerExtension
an account manager extension with a "name" attribute of "devmo" and the "chromepackagename" attribute set to "extension@example.org" means, that the account manager expects to find a xul file in "chrome://extension@example.org/content/am-devmo.xul" and a property file in "chrome://extension@example.org/locale/am-devmo.properties" containing a property named "prefpanel-devmo".
nsIMsgFilter
throws an exception if the action is not label attribute nsmsglabelvalue label; junkscore attribute long junkscore; strvalue attribute autf8string strvalue; customid // action id if type is custom attribute acstring customid; customaction // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; methods addterm() void nsimsgfilter::addterm ( in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in acstring arbitraryheader ) getterm() void nsimsgfilter::getterm ( ...
nsIMsgFilterList
st::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsioutputstream nsimsgfilterlist::logstream logurl readonly attribute acstring nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned long filterindex ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filterindex, in nsimsgfilter filter ) removefilter() void nsimsgfilterlist::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilterlist::removefilterat (in unsigned long filterindex) movefilterat() void nsimsgfilterlist::movefilterat ( in unsigned long fil...
nsIMsgRuleAction
throws an exception if the action is not label attribute nsmsglabelvalue label; // junkscore throws an exception if the action type is not junkscore attribute long junkscore; attribute autf8string strvalue; // action id if type is custom attribute acstring customid; // custom action associated with customid // (which must be set prior to reading this attribute) readonly attribute nsimsgfiltercustomaction customaction; }; ...
nsIMsgSearchCustomTerm
ors(in nsmsgsearchscopevalue scope, out unsigned long length, [retval, array, size_is(length)] out nsmsgsearchopvalue operators); match /** * apply the custom search term to a message * * @param msghdr header database reference representing the message * @param searchvalue user-set value to use in the search * @param searchop search operator (contains, ishigherthan, etc.) * * @return true if the term matches the message, else false */ boolean match(in nsimsgdbhdr msghdr, in autf8string searchvalue, in nsmsgsearchopvalue searchop); ...
nsIMsgSearchNotify
void onsearchdone(in nsresult status); /* * until we can encode searches with a uri, this will be an * out-of-bound way to connect a set of search terms to a datasource */ /* * called when a new search begins */ void onnewsearch(); }; ...
nsIMsgSearchValue
ibute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjunkstatus junkstatus; /* * junkpercent is set by the message filter plugin, and is approximately * proportional to the probability that a message is junk.
nsINavHistoryResult
sortingannotation autf8string the annotation to use in sort_by_annotation_* sorting modes; you must set this value before setting the sortingmode attribute.
nsINavHistoryResultObserver
this is called when the annotation is changed, set, or unset.
nsIParentalControlsService
requesturioverrides() requests that a set of uris be allowed through the parental control filters.
nsIPermission
last changed in gecko 2 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports attributes attribute type description capability pruint32 the permission to set: allow, deny, or unknown (which is the default).
nsIPrefBranch2
these cycles generally occur because an object both registers itself as an observer (causing the branch to hold a reference to the observer) and holds a reference to the branch object for the purpose of getting/setting preference values.
nsIPrivateBrowsingService
you may also turn private browsing mode on and off by setting the value of this attribute.
nsIProcess2
void runasync( [array, size_is(count)] in string args, in unsigned long count, in nsiobserver observer, optional in boolean holdweak optional ); parameters args an array of arguments to pass into the process, using the native character set.
nsIProtocolProxyFilter
auri the uri for which these proxy settings apply.
nsIProxyInfo
constant value description transparent_proxy_resolves_host 1 << 0 this flag is set if the proxy is to perform name resolution itself.
nsIScreen
rotation unsigned long the screen's current rotation; you may set this to any of the values listed in screen rotation constants.
nsIScriptError
if you want to log an error at chrome level you should set a category from the first section (leaving it empty might log it as content error).
nsIScriptableInputStream
var scriptableinputstream = cc("@mozilla.org/scriptableinputstream;1", "nsiscriptableinputstream", "init"); var blah = { data: '', onstartrequest: function (arequest, acontext) { this.data = ''; }, ondataavailable: function(request, context, inputstream, offset, count) { var scriptstream = new scriptableinputstream(inputstream); this.data += scriptstream.read(count); scriptstream.close(); } }; see also nsscriptableinputstream nsiinputstream ...
nsIScriptableUnescapeHTML
isxml set this to true if the fragment is an xml string; otherwise set it to false.
nsISpeculativeConnect
netwerk/base/public/nsispeculativeconnect.idlscriptable lets non-networking code provide hints to the networking layer that an http connection attempt to a particular site is likely to happen soon; this lets the networking layer begin setting up tcp and, if appropriate, ssl handshakes to save time when the connection is actually opened later.
nsISupports proxies
most of the time you will want to set this flag.
nsISyncMessageSender
for example, we will throw ns_error_not_initialized if we try to send a message to a cross-process frame but the other process has not yet been set up.
nsITaskbarTabPreview
if a preview is not registered, the api call to set its sibling (via the move() method) will fail silently.
nsITextInputProcessorCallback
ancelcomposition(); break; case "notify-focus": this._hasfocus = true; break; case "notify-blur": this._hasfocus = false; break; case "notify-detached": this._hasfocus = false; this._hasrightstocompose = false; break; } return true; } catch (e) { return false; } }, setcomposition: function simpleime_setcomposition(atext, aclauses, acaret) { if (!this._tip) { this._tip = components.classes["@mozilla.org/text-input-processor;1"].
nsIToolkitProfileService
(not the profile currently in use.) not sure what happens if you change this setting but someone said: you can change profiles by setting this attribute's value.
nsITransactionManager
); void dotransaction(in nsitransaction atransaction); void endbatch(); nsitransactionlist getredolist(); nsitransactionlist getundolist(); nsitransaction peekredostack(); nsitransaction peekundostack(); void redotransaction(); void removelistener(in nsitransactionlistener alistener); void undotransaction(); attributes attribute type description maxtransactioncount long sets the maximum number of transaction items the transaction manager will maintain at any time.
nsITreeBoxObject
it is dynamically settable, either using a view attribute on the tree tag or by setting this attribute to a new value.
nsIURIFixupInfo
potentially adding a prefix and/or suffix; set by the browser.fixup.alternate.prefix and .suffix prefs, their defaults "www." and ".com", respectively.
nsIURLFormatter
the set of known variables is predefined.
nsIUTF8StringEnumerator
xpcom/ds/nsistringenumerator.idlscriptable an object can implement this interface to allow a client to iterate over a set of strings provided by the object.
nsIUpdate
this overrides the default setting to download the update in the background.
nsIWebNavigationInfo
you may specify null to check for compatibility with nsiwebnavigation objects that are in their default state; otherwise, the result is determined based on the configuration of the specified object (that is, how it is configured by using nsiwebbrowsersetup).
nsIWebProgress
they limit the set of events that are delivered to an nsiwebprogresslistener instance.
nsIWebProgressListener2
progress totals are reset to zero when all requests in awebprogress complete (corresponding to onstatechange being called with astateflags including the state_stop and state_is_window flags).
nsIWorkerScope
if a listener has been established by setting the value of the onclose attribute, it gets called.
nsIXPCException
message - a custom message set by the thrower (defaults to 'exception') result - the nsresult associated with this exception (defaults to components.results.ns_error_failure) stack - the stack chain (defaults to the current stack) data - additional data object of your choice (defaults to null) inner - an inner exception that triggered this, if available ...
nsIXULRuntime
if a component encounters startup errors that might prevent the app from showing proper ui, it should set this flag to true.
nsIXULWindow
false to center it relative to arelative itself (arelative must be set in this case.) aalert true to move the window to an alert position, generally centered horizontally and 1/3 down from the top.
nsMsgPriorityValue
defined in comm-central/ mailnews/ base/ public/ mailnewstypes2.idl typedef long nsmsgpriorityvalue; [scriptable, uuid(94c0d8d8-2045-11d3-8a8f-0060b0fc04d2)] interface nsmsgpriority { const nsmsgpriorityvalue notset = 0; const nsmsgpriorityvalue none = 1; const nsmsgpriorityvalue lowest = 2; const nsmsgpriorityvalue low = 3; const nsmsgpriorityvalue normal = 4; const nsmsgpriorityvalue high = 5; const nsmsgpriorityvalue highest = 6; // the default for a priority picker const nsmsgpriorityvalue default = 4; }; ...
NS_IF_RELEASE
this macro also sets the pointer to null.
NS_RELEASE
this macro also sets the pointer to null.
XPCOM primitive
also, certain apis, such as nsitransferable.settransferdata(), require primitives.
XPCOM Interface Reference by grouping
bviewcommandupdater nsimsgfolder nsimsgidentity nsimsgmessageservice nsimsgsendlater nsimsgthread nsimsgwindow nsimsgwindowcommands user history nsibrowserhistory nsibrowsersearchservice nsimicrosummary nsimicrosummarygenerator nsimicrosummaryobserver nsimicrosummaryservice nsimicrosummaryset ...
NS_CStringCopy
example /* attribute acstring value; */ ns_imethodimp mycomponent::getvalue(nsacstring& avalue) { return ns_cstringcopy(avalue, mvalue); } ns_imethodimp mycomponent::setvalue(const nsacstring& avalue) { return ns_cstringcopy(mvalue, avalue); } history this function was frozen in mozilla 1.7.
NS_StringCopy
example code /* attribute acstring value; */ ns_imethodimp mycomponent::getvalue(nsastring& avalue) { return ns_stringcopy(avalue, mvalue); } ns_imethodimp mycomponent::setvalue(const nsastring& avalue) { return ns_stringcopy(mvalue, avalue); } history this function was frozen for mozilla 1.7.
nsIMsgSearchValue
ibute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjunkstatus junkstatus; /* * junkpercent is set by the message filter plugin, and is approximately * proportional to the probability that a message is junk.
The Thread Manager
nsithreadpool a thread pool provides a limited set of worker threads.
Frequently Asked Questions
comparing an nscomptr to a raw xpcom interface pointer declaring an nscomptr to a forward-declared class not linking to xpcom not including nscomptr.h different settings of nscap_feature_debug_ptr_types runtime errors ns_assertion "queryinterface needed" may be caused by a class that derives from a given interface, when you forgetting to also specify the interface name in the ns_impl_isupports / ns_impl_threadsafe_isupports macro.
Using nsIPasswordManager
alert(pass.user); // the username alert(pass.password); // the password break; } } catch (ex) { // do something if decrypting the password failed--probably a continue } } note that the user will be prompted for their master password if they have chosen to set one to secure their passwords.
Using nsISimpleEnumerator
e(components.interfaces.nsipropertyelement); s += property.key + ' = ' + property.value + ';\n'; } alert(s); example using javascript 1.7 features // creates a generator iterating over enum's values function generatorfromsimpleenumerator(enum, interface) { while (enum.hasmoreelements()) { yield enum.getnext().queryinterface(interface); } } var b = document.getelementbyid("stringbundleset").firstchild var props = generatorfromenumerator(b.strings, components.interfaces.nsipropertyelement); var s = ""; for (let property in props) { s += property.key + ' = ' + property.value + ';\n'; } alert(s); links code based on using_nsipasswordmanager nsisimpleenumerator xul:property:strings ...
Using the Gecko SDK
the frozen gecko api consists of a set of component interfaces (c++ vtables) and <tt>extern "c"</tt> symbols exported from the xpcom library and the nspr libraries.
Working with out parameters
implementation when implementing a method which has out parameters in javascript, you have to set a new property called value to the out parameter which will hold the required value.
XPCOM ownership guidelines
it's easier to write `getter's and `setter's; and you don't need to put anything in your destructor.
xptcall FAQ
given the correct set of parameters, this function can call any method on any xpcom interface.
XPIDL Syntax
MozillaTechXPIDLSyntax
status of this document this is a partial reverse-engineering of the libidl source code's parser, limited mostly to the subset of functionality that is supported by the mozilla xpidl binary.
Xray vision
any of them, even setters and getters, could have been redefined by untrusted code.
Mozilla technologies
toolkit apithe mozilla toolkit is a set of programming interfaces (apis) built on top of gecko which provide advanced services to xul applications.
Cached compose window FAQ
seth spitzer (sspitzer@mozilla.org) what is the "cached" compose window?
MailNews Filters
mailnews filters consist of a set of search terms, and a set of filter actions.
Mail client architecture overview
js (menus, events) libmime mail datasources mail javascript folder/message management msgdb imap/nntp/pop3 necko (networking) sections in grey refer to modules outside of mail/news the base module the base module provides a generic interface to a set of protocol-independant messaging services.
Spam filtering
seth spitzer the mozilla implement is based on paul graham's a plan for spam.
FAQ
the old contents of this faq page were duplicated in the setting up extension development environment article and the building a thunderbird extension article.
Access StringBundle from Overlay
the most efficient way to append these strings is by attaching them to an existing stringbundleset as such: <stringbundleset id="stringbundleset"> <stringbundle src="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) alternat...
Create Custom Column
the customdbheaders preference article provides information on a preference setting that exposes custom header data for use in a custom column within thunderbird's main view.
Filter Incoming Mail
by example, setting it to lower case subject = subject.tolocalelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function init() { var notificationservice = components.classes["@mozilla.org/messenger/msgno...
Styling the Folder Pane
for example, if the inbox flag is set, this will be "inbox".
Using JS in Mozilla code
js standard library features feature standard can be used in code new proxy(target, handler) es2015 yes, but getprototypeof and setprototypeof handlers are not yet implemented.
Using popup notifications
tion-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.
Zombie compartments
� │ │ ├──1.03 mb (00.21%) ── style-sheets [2] │ │ │ ├──0.60 mb (00.12%) ++ dom │ │ │ └──0.01 mb (00.00%) ── property-tables [2] │ │ ├───8.86 mb (01.78%) -- cached/window(https://www.google.de/?gws_rd=ssl) │ │ │ ├──4.23 mb (00.85%) -- layout │ │ │ │ ├──3.80 mb (00.76%) ── style-sets │ │ │ │ ├──0.29 mb (00.06%) ── pres-shell │ │ │ │ ├──0.05 mb (00.01%) ── rule-nodes │ │ │ │ ├──0.04 mb (00.01%) ── style-contexts │ │ │ │ ├──0.03 mb (00.01%) -- frames │ │ │ │ │ ├──0.02 mb (00.00%) ── sundries │ │ │ │ │ └──0.01 mb (00.00%) ── nsblockfr...
Standard OS Libraries
you just need to supply the path to appropriate files and set up the proper types of values/arguments in the js-ctypes code.
Type conversion
implicit convert in js-ctypes, data could be converted implicitly when passing to or returning from a functiontype call, or setting pointer content, an array element or a struct field.
Using js-ctypes
after that, we simply set up our parameters by using makestr() to generate the two str255 strings we need, then call stdalert(), which produces the following alert window: the last thing we do is call carbon.close() to close the library when we're done using it.
ArrayType
cdata addressofelement( idx ); parameters idx a numeric value indicating the offset into the array of the element just to return a pointer.
CData
ode); var char16_val = fromcharcode.join(''); console.info('char16_val:', char16_val); 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(); } } ...
Library
the syntax for this is seen in firefox codebase here: //github.com/realityripple/uxp/blob/master/js/src/ctypes/library.cpp?offset=0#271 this shows that we can also supply only two arguments to the declare function.
StructType
structtype cdata properties every struct object has a getter and a setter for each member field of the structure.
Structures - Plugins
npsetwindowcallbackstruct contains information about the plug-in's unix window environment.
Plugin Roadmap for Firefox - Plugins
users will have the choice to remember the flash setting per-site.
Preferences System
you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate.
3D view - Firefox Developer Tools
function keyboard mouse zoom in/out + / - scroll wheel up/down rotate left/right a / d mouse left/right rotate up/down w / s mouse up/down pan left/right ← / → mouse left/right pan up/down ↑ / ↓ mouse up/down reset zoom level 0 resets the zoom level to the default focus on selected node f makes sure the currently selected node is visible reset view r resets zoom, rotation, and panning to the default hide current node x makes the currently selected node invisible; this can be helpful if you need to get at a node that's obscured use cases for the 3d...
Color vision simulation - Firefox Developer Tools
in the firefox configuration editor, make sure the gfx.webrender.all option is set to true.
DOM Inspector FAQ - Firefox Developer Tools
you should notice the set pseudo-classes menu item, which will allow you to set the content state for the aforementioned pseudo-classes.
Application - Firefox Developer Tools
if you can’t see it there, you can enable it by going to the "three dot" menu and selecting settings (also accessible by pressing f1), then checking the application checkbox under default developer tools.
Ignore a source - Firefox Developer Tools
when “pause on exceptions” is enabled in the debugger settings, the debugger won’t pause when an exception is thrown in the ignored source; instead it waits until (and if) the stack unwinds to a frame in a source that isn’t ignored.
How to - Firefox Developer Tools
access debugging in add-onsbreaking on exceptionsdebug eval sourcesdisable breakpointsexamine, modify, and watch variableshighlight and inspect dom nodesignore a sourceopen the debuggerpretty-print a minified filesearchset a breakpointset a conditional breakpointset watch expressionsstep through codeuse a source mapuse watchpoints ...
Debugger keyboard shortcuts - Firefox Developer Tools
command windows macos linux increase font size ctrl + + cmd + + ctrl + + decrease font size ctrl + - cmd + - ctrl + - reset font size ctrl + 0 cmd + 0 ctrl + 0 ...
Basic operations - Firefox Developer Tools
to enable it, open the developer tool settings, and check the "memory" box under "default firefox developer tools": from firefox 50 onwards, the memory tool is enabled by default.
Tree map view - Firefox Developer Tools
a treemap displays "hierarchical (tree-structured) data as a set of nested rectangles".
Network monitor toolbar - Firefox Developer Tools
a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request list by type: by the content type of the response xhr requests websocket upgrades and messages (labeled ws) other requests a checkbox that allows you to disable caching.
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
flex container options the flex container section of the layout view looks like this: there are two settings you can change in the flex container section: you can control the color of the overlay by clicking on the small circle next to the selector.
Open the Inspector - Firefox Developer Tools
the inspector will appear at the bottom of the browser window: you can also set the pane to appear at the left side of the browser window: to the right side of the browser window: or in a separate window: to start finding your way around the inspector, see the ui tour.
Animation inspector example: CSS transitions - Firefox Developer Tools
s 150ms; } .icon#selected { filter: grayscale(0%); transform: scale(1.5); } .icon#selected+span { opacity: 1; width: 300px; } javascript content function toggleselection(e) { if (e.button != 0) { return; } if (e.target.classlist.contains("icon")) { var wasselected = (e.target.getattribute("id") == "selected"); clearselection(); if (!wasselected) { e.target.setattribute("id", "selected"); } } } function clearselection() { var selected = document.getelementbyid("selected"); if (selected) { selected.removeattribute("id"); } } document.addeventlistener("click", toggleselection); ...
Page inspector keyboard shortcuts - Firefox Developer Tools
command windows macos linux increase font size ctrl + + cmd + + ctrl + + decrease font size ctrl + - cmd + - ctrl + - reset font size ctrl + 0 cmd + 0 ctrl + 0 ...
Page Inspector - Firefox Developer Tools
l inspect and select colors reposition elements in the page edit fonts visualize transforms use the inspector api select an element examine and edit css examine event listeners work with animations edit css filters edit css shapes view background images use the inspector from the web console examine css grid layouts examine css flexbox layouts reference keyboard shortcuts settings ...
Call Tree - Firefox Developer Tools
if you want to see the details, check "show gecko platform data" in the settings.
Animating CSS properties - Firefox Developer Tools
there's also a video version of this walkthrough: animating using margin leaving the "use margin" option set, start the animation, open the performance tool, and make a recording.
Intensive JavaScript - Firefox Developer Tools
leaving the radio button set to "use blocking call in main thread", make a recording: press the "start animations" button start recording a performance profile press "do pointless computations!" two or three times stop recording the profile exactly what you see will vary from one machine to another, but it will be something like this: the top half of this is the waterfall overview.
Performance - Firefox Developer Tools
this view only appears if you checked "record allocations" in the performance tool settings.
Shader Editor - Firefox Developer Tools
to enable it, open the toolbox settings and check "shader editor" in the "default firefox developer tools" item.
View Source - Firefox Developer Tools
because of this, doctypes that have an internal subset are not highlighted correctly, and entity references to custom entities are also not highlighted correctly.
Web Audio Editor - Firefox Developer Tools
to enable it, open the developer tool settings and check "web audio".
Web console keyboard shortcuts - Firefox Developer Tools
command windows macos linux increase font size ctrl + + cmd + + ctrl + + decrease font size ctrl + - cmd + - ctrl + - reset font size ctrl + 0 cmd + 0 ctrl + 0 ...
Rich output - Firefox Developer Tools
when the web console prints objects, it includes a richer set of information than just the object's name.
Web Console UI Tour - Firefox Developer Tools
settings ("gear" menu): new in firefox 71, you can click the gear icon to access the new settings menu, where you can toggle the following features on and off: persist logs: when enabled, the console doesn't clear on page reload, or new page load.
Web Console remoting - Firefox Developer Tools
actor preferences to allow the web console to configure logging options while it is running, we have added the setpreferences packet: { "to": "conn0.console9", "type": "setpreferences", "preferences": { "networkmonitor.saverequestandresponsebodies": false } } reply: { "updated": [ "networkmonitor.saverequestandresponsebodies" ], "from": "conn0.console10" } for convenience you can use webconsoleclient.setpreferences(prefs, onresponse).
Web Console - Firefox Developer Tools
the toolbox appear at the bottom, left, or right of the browser window (depending on your docking settings), with the web console activated (it's just called console in the devtools toolbar).
ANGLE_instanced_arrays - Web APIs
ext.drawelementsinstancedangle() behaves identically to gl.drawelements() except that multiple instances of the set of elements are executed and the instance advances between each set.
AbsoluteOrientationSensor - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
AbsoluteOrientationSensor - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
AbstractWorker.onerror - Web APIs
}; example the following code snippet shows creation of a worker object using the worker() constructor and setting up of an onerror handler on the resulting object: var myworker = new worker('worker.js'); myworker.onerror = function() { console.log('there is an error with your worker!'); } specifications specification status comment html living standardthe definition of 'abstractworker.onerror' in that specification.
Accelerometer.Accelerometer() - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Accelerometer.x - Web APIs
WebAPIAccelerometerx
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Accelerometer.y - Web APIs
WebAPIAccelerometery
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Accelerometer.z - Web APIs
WebAPIAccelerometerz
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Accelerometer - Web APIs
if a feature policy blocks the use of a feature, it is because your code is inconsistent with the policies set on your server.
AddressErrors.addressLine - Web APIs
syntax var addresslineerror = addresserrors.addressline; value if an error occurred during validation of the address due to one of the strings in the addressline array having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AddressErrors.country - Web APIs
syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AesCbcParams - Web APIs
this should be set to aes-cbc.
AesGcmParams - Web APIs
this should be set to aes-gcm.
AesKeyGenParams - Web APIs
this should be set to aes-cbc, aes-ctr, aes-gcm, or aes-kw, depending on the algorithm you want to use.
AmbientLightSensor.AmbientLightSensor() - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
AmbientLightSensor.illuminance - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
AmbientLightSensor - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
AnalyserNode.getFloatFrequencyData() - Web APIs
le = new audio(); audioele.src = 'my-audio.mp3';//insert file name here audioele.autoplay = true; audioele.preload = 'auto'; const audiosourcenode = audioctx.createmediaelementsource(audioele); //create analyser node const analysernode = audioctx.createanalyser(); analysernode.fftsize = 256; const bufferlength = analysernode.frequencybincount; const dataarray = new float32array(bufferlength); //set up audio node network audiosourcenode.connect(analysernode); analysernode.connect(audioctx.destination); //create 2d canvas const canvas = document.createelement('canvas'); canvas.style.position = 'absolute'; canvas.style.top = 0; canvas.style.left = 0; canvas.width = window.innerwidth; canvas.height = window.innerheight; document.body.appendchild(canvas); const canvasctx = canvas.getcontext('2d...
AnalyserNode.maxDecibels - Web APIs
note: if a value less than or equal to analysernode.mindecibels is set, an indexsizeerror exception is thrown.
AnalyserNode.minDecibels - Web APIs
note: if a value greater than analysernode.maxdecibels is set, an index_size_err exception is thrown.
Animation() - Web APIs
the default value is document.timeline, but this can be set to null as well.
Animation.cancel() - Web APIs
WebAPIAnimationcancel
when an animation is cancelled, its starttime and currenttime are set to null.
Animation.effect - Web APIs
WebAPIAnimationeffect
the animation.effect property of the web animations api gets and sets the target effect of an animation.
Animation.id - Web APIs
WebAPIAnimationid
the animation.id property of the web animations api returns or sets a string used to identify the animation.
Animation.pause() - Web APIs
WebAPIAnimationpause
slowly getting eaten up var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // doesn't actually need to be eaten until a click event, so pause it initially: nommingcake.pause(); additionally, when resetting : // an all-purpose function to pause the animations on alice, the cupcake, and the bottle that reads "drink me." var stopplayingalice = function() { alicechange.pause(); nommingcake.pause(); drinking.pause(); }; // when the user releases the cupcake or the bottle, pause the animations.
Animation.persist() - Web APIs
WebAPIAnimationpersist
the event handler sets up an animation that animates the <div> element to the position of the mouse pointer.
Animation.replaceState - Web APIs
the event handler sets up an animation that animates the <div> element to the position of the mouse pointer.
Animation.reverse() - Web APIs
WebAPIAnimationreverse
it is done by setting alicechange's animation.playbackrate to -1 like so: var shrinkalice = function() { // play alice's animation in reverse alicechange.playbackrate = -1; alicechange.play(); // play the bottle's animation drinking.play() } but it could also have been done by calling reverse() on alicechange like so: var shrinkalice = function() { // play alice's animation in reverse alicechange...
AnimationPlaybackEvent.currentTime - Web APIs
reduced time precision to offer protection against timing attacks and fingerprinting, the precision of playbackevent.currenttime might get rounded depending on browser settings.
AnimationTimeline.currentTime - Web APIs
reduced time precision to offer protection against timing attacks and fingerprinting, the precision of animationtimeline.currenttime might get rounded depending on browser settings.
Attr.namespaceURI - Web APIs
WebAPIAttrnamespaceURI
you can create an attribute with the specified namespaceuri using the dom level 2 method element.setattributens.
AudioBuffer.copyFromChannel() - Web APIs
startinchannel optional an optional offset into the source channel's buffer from which to begin copying samples.
AudioBuffer.copyToChannel() - Web APIs
startinchannel optional an optional offset to copy the data to.
AudioBuffer.getChannelData() - Web APIs
// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); } specification specification status comment web audio apithe definition of 'getchanneldata' in that specification.
AudioContext.createMediaElementSource() - Web APIs
pt.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node var gainnode = audioctx.creategain(); // create variables to store mouse pointer y coordinate // and height of screen var cury; var height = window.innerheight; // get new mouse pointer coordinates when mouse is moved // then set new gain value document.onmousemove = updatepage; function updatepage(e) { cury = (window.event) ?
AudioContext.createMediaStreamDestination() - Web APIs
examples in the following simple example, we create a mediastreamaudiodestinationnode, an oscillatornode and a mediarecorder (the example will therefore only work in firefox and chrome at this time.) the mediarecorder is set up to record information from the mediastreamdestinationnode.
AudioContext.createMediaStreamSource() - Web APIs
quadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling c...
AudioContext.getOutputTimestamp() - Web APIs
play.addeventlistener('click', () => { if(!audioctx) { audioctx = new window.audiocontext(); } getdata(); source.start(0); play.setattribute('disabled', 'disabled'); raf = requestanimationframe(outputtimestamps); }); stop.addeventlistener('click', () => { source.stop(0); play.removeattribute('disabled'); cancelanimationframe(raf); }); // function to output timestamps function outputtimestamps() { let ts = audioctx.getoutputtimestamp() console.log('context time: ' + ts.contexttime + ' | performance time: ' + ts...
AudioContextLatencyCategory - Web APIs
the audiocontextlatencycategory type is an enumerated set of strings which are used to select one of a number of default values for acceptable maximum latency of an audio context.
AudioDestinationNode - Web APIs
example there is no complex set up for using an audiodestinationnode — by default, this simply represents the output of the user's system (e.g.
AudioNode - Web APIs
WebAPIAudioNode
ls: -60, smoothingtimeconstant: 0.5, }); // factory method const analysernode = audioctx.createanalyser(); analysernode.fftsize = 2048; analysernode.maxdecibels = -25; analysernode.mindecibels = -60; analysernode.smoothingtimeconstant = 0.5; you are free to use either constructors or factory methods, or mix both, however there are advantages to using the constructors: all parameters can be set during construction time and don't need to be set individually.
AudioParam.cancelScheduledValues() - Web APIs
examples var gainnode = audioctx.creategain(); gainnode.gain.setvaluecurveattime(wavearray, audioctx.currenttime, 2); //'gain' is the audioparam gainnode.gain.cancelscheduledvalues(audioctx.currenttime); specifications specification status comment web audio apithe definition of 'cancelscheduledvalues' in that specification.
AudioParamDescriptor - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) now we can change the gain on the node like this: const gainparam = whitenoisenode.parameters.get('customgain') gainparam.setvalueattime(0, audiocontext.currenttime) gainparam.linearramptovalueattime(0.5, audiocontext.currenttime + 0.5) specifications specification status comment web audio apithe definition of 'audioparamdescriptor' in that specification.
AudioParamMap - Web APIs
the web audio api interface audioparammap represents a set of multiple audio parameters, each described as a mapping of a domstring identifying the parameter to the audioparam object representing its value.
AudioScheduledSourceNode: ended event - Web APIs
examples in this simple example, an event listener for the ended event is set up to enable a "start" button in the user interface when the node stops playing: node.addeventlistener('ended', () => { document.getelementbyid("startbutton").disabled = false; }) you can also set up the event handler using the audioscheduledsourcenode.onended property: node.onended = function() { document.getelementbyid("startbutton").disabled = false; } for an example of the ended event...
AudioTrack - Web APIs
setting this value to false mutes the track's audio.
AudioTrackList.onaddtrack - Web APIs
syntax audiotracklist.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which audio track has been added to the media.
AudioTrackList.onchange - Web APIs
syntax audiotracklist.onchange = eventhandler; value set onchange to a function that should be called whenever tracks are enabled or disabled on the media element.
AudioTrackList.onremovetrack - Web APIs
syntax audiotracklist.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as input a trackevent object which indicates in its track property which audio track has been removed from the media element.
AudioWorkletGlobalScope - Web APIs
you can put these two lines in process method console.log(currentframe) console.log(currenttime) } // the process method is required - simply output silence, // which the outputs are already filled with process (inputs, outputs, parameters) { return true } } // the sample rate is not going to change ever, // because it's a read-only property of a baseaudiocontext // and is set only during its instantiation console.log(samplerate) // you can declare any variables and use them in your processors // for example it may be an arraybuffer with a wavetable const usefulvariable = 42 console.log(usefulvariable) registerprocessor('test-processor', testprocessor) next, in our main scripts file we'll load the processor, create an instance of audioworkletnode — passing the na...
AudioWorkletNode.parameters - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) now we can change the gain on the node like this: const gainparam = whitenoisenode.parameters.get('customgain') gainparam.setvalueattime(0, audiocontext.currenttime) gainparam.linearramptovalueattime(0.5, audiocontext.currenttime + 0.5) specifications specification status comment web audio apithe definition of 'parameters' in that specification.
AudioWorkletNode.port - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
AudioWorkletProcessor() - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('test-processor.js') const testnode = new audioworkletnode(audiocontext, 'test-processor', { processoroptions: { someusefulvariable: new map([[1, 'one'], [2, 'two']]) } }) the console output will be as follows: > 1 // audioworkletnode options.numberofinputs set to default > map(2) {1 => "one", 2 => "two"} // a cloned map under someusefulvariable specifications specification status comment web audio apithe definition of 'audioworkletprocessor()' in that specification.
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) now we can change the gain on the node like this: const gainparam = whitenoisenode.parameters.get('customgain') gainparam.setvalueattime(0, audiocontext.currenttime) gainparam.linearramptovalueattime(0.5, audiocontext.currenttime + 0.5) specifications specification status comment web audio apithe definition of 'parameterdescriptors' in that specification.
AudioWorkletProcessor.port - Web APIs
const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
BaseAudioContext.createBufferSource() - Web APIs
// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); } specifications specification status comment web audio apithe definition of 'createbuffersource()' in that specification.
BaseAudioContext.createChannelMerger() - Web APIs
var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac.createbuffersource(); source.buffer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
BaseAudioContext.createChannelSplitter() - Web APIs
var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac.createbuffersource(); source.buffer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
BaseAudioContext.createConvolver() - Web APIs
// grab audio track via xhr for convolver node var soundsource, concerthallbuffer; ajaxrequest = new xmlhttprequest(); ajaxrequest.open('get', 'concert-crowd.ogg', true); ajaxrequest.responsetype = 'arraybuffer'; ajaxrequest.onload = function() { var audiodata = ajaxrequest.response; audioctx.decodeaudiodata(audiodata, function(buffer) { concerthallbuffer = buffer; soundsource = audioctx.createbuffersource(); soundsource.buffer = concerthallbuffer; }, function(e){"error with decoding audio data" + e.err}); } ajaxrequest.send(); ...
BaseAudioContext.createGain() - Web APIs
gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gain.setvalueattime(1, audioctx.currenttime); mute.id = ""; mute.innerhtml = "mute"; } } specifications specification status comment web audio apithe definition of 'creategain()' in that specification.
BaseAudioContext.createOscillator() - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'createoscillator' in that specification.
BaseAudioContext.createStereoPanner() - Web APIs
-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.oninput = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and the pannode to the destination, so we can play the // music and adjust the panning using the controls source.connect(pannode); pannode.connect(audioctx.destination); specifications specification status comment we...
BaseAudioContext.currentTime - Web APIs
console.log(audioctx.currenttime); reduced time precision to offer protection against timing attacks and fingerprinting, the precision of audioctx.currenttime might get rounded depending on browser settings.
BaseAudioContext - Web APIs
in this case, the arraybuffer is usually loaded from an xmlhttprequest's response attribute after setting the responsetype to arraybuffer.
BatteryManager - Web APIs
void seteventhandler(domstring type, eventhandler handler) eventhandler geteventhandler(domstring type) specifications specification status comment battery status api candidate recommendation initial definition ...
Using the Beacon API - Web APIs
this code snippet is for the global context: function worker_send(url, data) { // create the worker object var myworker = new worker("worker-using.js"); // send the worker the url and data to beacon myworker.postmessage([url, data]); // set up a message handler to receive the success/fail message from the worker myworker.onmessage = function(event) { var msg = event.data; // log worker's send status console.log("worker reply: sendbeacon() status = " + msg); }; } this code snippet is for the worker (worker-using.js): onmessage = function(event) { var msg = event.data; // split the url and data from the message ...
Beacon API - Web APIs
one such technique is to delay the unload to submit data by creating an image element and setting its src attribute within the unload handler.
BeforeInstallPromptEvent.prompt() - Web APIs
example var istoosoon = true; window.addeventlistener("beforeinstallprompt", function(e) { if (istoosoon) { e.preventdefault(); // prevents prompt display // prompt later instead: settimeout(function() { istoosoon = false; e.prompt(); // throws if called more than once or default not prevented }, 10000); } // the event was re-dispatched in response to our request // ...
BiquadFilterNode() - Web APIs
it allows all frequencies through, except for a set of frequencies.
BiquadFilterNode.Q - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(...
BiquadFilterNode.detune - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(...
BiquadFilterNode.frequency - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(...
BiquadFilterNode.gain - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(...
BiquadFilterNode.type - Web APIs
var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioctx.createanalyser(); var distortion = audioctx.createwaveshaper(); var gainnode = audioctx.creategain(); var biquadfilter = audioctx.createbiquadfilter(); var convolver = audioctx.createconvolver(); // connect the nodes together source = audioctx.createmediastreamsource(stream); source.connect(analyser); analyser.connect(...
Blob.type - Web APIs
WebAPIBlobtype
example this example asks the user to select a number of files, then checks each file to make sure it's one of a given set of image file types.
Blob - Web APIs
WebAPIBlob
to create a blob that contains a subset of another blob's data, use the slice() method.
BlobBuilder - Web APIs
this also resets the blobbuilder so that the next call to append() is starting a new, empty blob.
Bluetooth.requestDevice() - Web APIs
parameters options optional an object that sets options for the device request.
Bluetooth - Web APIs
WebAPIBluetooth
if this option is set, that is the value returned by this method.
BluetoothRemoteGATTCharacteristic.writeValue() - Web APIs
the bluetoothremotegattcharacteristic.writevalue() method sets the value property to the bytes contained in an arraybuffer and returns a promise.
BluetoothRemoteGATTCharacteristic - Web APIs
bluetoothremotegattcharacteristic.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise.
Body.blob() - Web APIs
WebAPIBodyblob
when the fetch is successful, we read a blob out of the response using blob(), put it into an object url using url.createobjecturl, and then set that url as the source of an <img> element to display the image.
Body.bodyUsed - Web APIs
WebAPIBodybodyUsed
when the fetch is successful, we read a blob out of the response using blob(), put it into an object url using url.createobjecturl, and then set that url as the source of an <img> element to display the image.
Body.text() - Web APIs
WebAPIBodytext
when the fetch is successful, we read a usvstring (text) object out of the response using text(), then set the innerhtml of the <article> element equal to the text object.
Body - Web APIs
WebAPIBody
this provides these objects with an associated body (a stream), a used flag (initially unset), and a mime type (initially the empty byte sequence).
ByteString - Web APIs
bytestring is a utf-8 string that corresponds to the set of all possible sequences of bytes.
CSS numeric factory functions - Web APIs
number); css.khz(number); // <resolution> css.dpi(number); css.dpcm(number); css.dppx(number); // <flex> css.fr(number); examples we use the css.vmax() numeric factory function to create a cssunitvalue: let height = css.vmax(50); console.log( height ); // cssunitvalue {value: 50, unit: "vmax"} console.log( height.value ) // 50 console.log( height.unit ) // vmax in this example, we set the margin on our element using the css.px() factory function: myelement.attributestylemap.set('margin', css.px(40)); let currentmargin = myelement.attributestylemap.get('margin'); console.log(currentmargin.value, currentmargin.unit); // 40, 'px' specification specification status comment css object model (cssom)the definition of 'numeric factory functions' in that spec...
CSS.supports() - Web APIs
WebAPICSSsupports
syntax css.supports(propertyname, value); css.supports(supportcondition); parameters there are two distinct sets of parameters.
CSSKeyframeRule - Web APIs
the csskeyframerule interface describes an object representing a set of style for a given keyframe.
CSSKeyframesRule - Web APIs
the csskeyframesrule interface describes an object representing a complete set of keyframes for a css animation.
CSSPositionValue.CSSPositionValue() - Web APIs
let somediv = document.getelementbyid('container'); let position = new csspositionvalue(css.px(5), css.px(10)); somediv.attributestylemap.set('object-position', position); console.log(position.x.value, position.y.value); // 5 10 ...
CSSPositionValue.x - Web APIs
let somediv = document.getelementbyid('container'); let position = new csspositionvalue(css.px(5), css.px(10)); somediv.attributestylemap.set('object-position', position); console.log(position.x.value, position.y.value); ...
CSSPositionValue.y - Web APIs
let replaceel = document.getelementbyid('container'); let position = new csspositionvalue(css.px(5), css.px(10)); somediv.attributestylemap.set('object-position', position); console.log(position.x.value, position.y.value); ...
CSSPositionValue - Web APIs
let replacedel = document.getelementbyid( 'image' ); let position = new csspositionvalue( css.px(35), css.px(40) ); replacedel.attributestylemap.set( 'object-position', position ); console.log( position.x.value, position.y.value ); console.log( replacedel.computedstylemap().get('object-position') ); we set the object-position property, then check the values returned.
CSSStyleDeclaration.getPropertyPriority() - Web APIs
the cssstyledeclaration.getpropertypriority() method interface returns a domstring that provides all explicitly set priorities on the css property.
CSSStyleDeclaration.getPropertyValue() - Web APIs
if not set, returns the empty string.
CSSStyleSheet.insertRule() - Web APIs
what the inserted rule must contain depends on its type: for rule-sets, both a selector and a style declaration.
Using the CSS Typed Object Model - Web APIs
csskeywordvalue is a class that defines keywords like inherit, initial, unset, and other strings you don't quote, such as auto and grid.
Cache.add() - Web APIs
WebAPICacheadd
this consists of calling cachestorage.open to create a new cache, then using cache.add to add an asset to it.
Cache.addAll() - Web APIs
WebAPICacheaddAll
this consists of calling cachestorage.open to create a new cache, then using addall() to add a series of assets to it.
CacheStorage.open() - Web APIs
WebAPICacheStorageopen
this consists of calling cachestorage.open() to create a new cache, then using cache.addall() to add a series of assets to it.
CacheStorage - Web APIs
this consists of calling cachestorage.open to create a new cache, then using cache.addall to add a series of assets to it.
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.createLinearGradient() - Web APIs
javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); // create a linear gradient // the start gradient point is at x=20, y=0 // the end gradient point is at x=220, y=0 var gradient = ctx.createlineargradient(20,0, 220,0); // add three color stops gradient.addcolorstop(0, 'green'); gradient.addcolorstop(.5, 'cyan'); gradient.addcolorstop(1, 'green'); // set the fill style and draw a rectangle ctx.fillstyle = gradient; ctx.fillrect(20, 20, 200, 100); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.createlineargradient' in that specification.
CanvasRenderingContext2D.createRadialGradient() - Web APIs
t.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); // create a radial gradient // the inner circle is at x=110, y=90, with radius=30 // the outer circle is at x=100, y=100, with radius=70 var gradient = ctx.createradialgradient(110,90,30, 100,100,70); // add three color stops gradient.addcolorstop(0, 'pink'); gradient.addcolorstop(.9, 'white'); gradient.addcolorstop(1, 'green'); // set the fill style and draw a rectangle ctx.fillstyle = gradient; ctx.fillrect(20, 20, 160, 160); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.createradialgradient' in that specification.
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
2'); document.addeventlistener('focus', redraw, true); document.addeventlistener('blur', redraw, true); canvas.addeventlistener('click', handleclick, false); redraw(); function redraw() { ctx.clearrect(0, 0, canvas.width, canvas.height); drawbutton(button1, 20, 20); drawbutton(button2, 20, 80); } function handleclick(e) { // calculate click coordinates const x = e.clientx - canvas.offsetleft; const y = e.clienty - canvas.offsettop; // focus button1, if appropriate drawbutton(button1, 20, 20); if (ctx.ispointinpath(x, y)) { button1.focus(); } // focus button2, if appropriate drawbutton(button2, 20, 80); if (ctx.ispointinpath(x, y)) { button2.focus(); } } function drawbutton(el, x, y) { const active = document.activeelement === el; const width = 150...
CanvasRenderingContext2D.drawWindow() - Web APIs
top-level browsed documents are usually not transparent because the user's background-color preference is applied, but iframes are transparent if the page doesn't set a background.
CanvasRenderingContext2D.ellipse() - Web APIs
html <canvas id="canvas" width="200" height="200"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // draw the ellipse ctx.beginpath(); ctx.ellipse(100, 100, 50, 75, math.pi / 4, 0, 2 * math.pi); ctx.stroke(); // draw the ellipse's line of reflection ctx.beginpath(); ctx.setlinedash([5, 5]); ctx.moveto(0, 200); ctx.lineto(200, 0); ctx.stroke(); result various elliptical arcs this example creates three elliptical paths with varying properties.
CanvasRenderingContext2D.fillRect() - Web APIs
to achieve this, the dimensions of the rectangle are set to equal the <canvas> element's width and height attributes.
CanvasRenderingContext2D.globalCompositeOperation - Web APIs
the canvasrenderingcontext2d.globalcompositeoperation property of the canvas 2d api sets the type of compositing operation to apply when drawing new shapes.
CanvasRenderingContext2D.isPointInPath() - Web APIs
vas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create circle const circle = new path2d(); circle.arc(150, 75, 50, 0, 2 * math.pi); ctx.fillstyle = 'red'; ctx.fill(circle); // listen for mouse moves canvas.addeventlistener('mousemove', function(event) { // check whether point is inside circle if (ctx.ispointinpath(circle, event.offsetx, event.offsety)) { ctx.fillstyle = 'green'; } else { ctx.fillstyle = 'red'; } // draw circle ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.fill(circle); }); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.ispointinpath' in that specification.
CanvasRenderingContext2D.isPointInStroke() - Web APIs
nvas.getcontext('2d'); // create ellipse const ellipse = new path2d(); ellipse.ellipse(150, 75, 40, 60, math.pi * .25, 0, 2 * math.pi); ctx.linewidth = 25; ctx.strokestyle = 'red'; ctx.fill(ellipse); ctx.stroke(ellipse); // listen for mouse moves canvas.addeventlistener('mousemove', function(event) { // check whether point is inside ellipse's stroke if (ctx.ispointinstroke(ellipse, event.offsetx, event.offsety)) { ctx.strokestyle = 'green'; } else { ctx.strokestyle = 'red'; } // draw ellipse ctx.clearrect(0, 0, canvas.width, canvas.height); ctx.fill(ellipse); ctx.stroke(ellipse); }); result specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.ispointinstroke' in that specification...
CanvasRenderingContext2D.lineCap - Web APIs
the second is set to use the "round" option.
CanvasRenderingContext2D.lineJoin - Web APIs
this setting is affected by the miterlimit property.
CanvasRenderingContext2D.lineWidth - Web APIs
the canvasrenderingcontext2d.linewidth property of the canvas 2d api sets the thickness of lines.
CanvasRenderingContext2D.putImageData() - Web APIs
ect(0, 0, 100, 100); // create an imagedata object from it var imagedata = ctx.getimagedata(0, 0, 100, 100); // use the putimagedata function that illustrates how putimagedata works putimagedata(ctx, imagedata, 150, 0, 50, 50, 25, 25); result data loss due to browser optimization due to the lossy nature of converting to and from premultiplied alpha color values, pixels that have just been set using putimagedata() might be returned to an equivalent getimagedata() as different values.
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.rotate() - Web APIs
nvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // point of transform origin ctx.arc(0, 0, 5, 0, 2 * math.pi); ctx.fillstyle = 'blue'; ctx.fill(); // non-rotated rectangle ctx.fillstyle = 'gray'; ctx.fillrect(100, 0, 80, 20); // rotated rectangle ctx.rotate(45 * math.pi / 180); ctx.fillstyle = 'red'; ctx.fillrect(100, 0, 80, 20); // reset transformation matrix to the identity matrix ctx.settransform(1, 0, 0, 1, 0, 0); result the center of rotation is blue.
CanvasRenderingContext2D.save() - Web APIs
the current values of the following attributes: strokestyle, fillstyle, globalalpha, linewidth, linecap, linejoin, miterlimit, linedashoffset, shadowoffsetx, shadowoffsety, shadowblur, shadowcolor, globalcompositeoperation, font, textalign, textbaseline, direction, imagesmoothingenabled.
CanvasRenderingContext2D.transform() - Web APIs
note: see also the settransform() method, which resets the current transform to the identity matrix and then invokes transform().
CanvasRenderingContext2D.translate() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // moved square ctx.translate(110, 30); ctx.fillstyle = 'red'; ctx.fillrect(0, 0, 80, 80); // reset current transformation matrix to the identity matrix ctx.settransform(1, 0, 0, 1, 0, 0); // unmoved square ctx.fillstyle = 'gray'; ctx.fillrect(0, 0, 80, 80); result the moved square is red, and the unmoved square is gray.
A basic ray-caster - Web APIs
the basic idea is to use setinterval() at some arbitrary delay that corresponds to a desired frame rate.
Advanced animations - Web APIs
the following code will set us up.
Finale - Web APIs
WebAPICanvas APITutorialFinale
svg scalable vector graphics let you describe images as sets of vectors (lines) and shapes in order to allow them to scale smoothly regardless of the size at which they're drawn.
Canvas API - Web APIs
p5.js has a full set of canvas drawing functionality for artists, designers, educators, and beginners.
ChannelMergerNode - Web APIs
var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac.createbuffersource(); source.buffer = data; var splitter = ac.createchannelsplitter(2); source.connect(splitter); var merger = ac.createchannelmerger(2); // reduce the volume of the left channel only var gainnode = ac.creategain(); gainnode.gain.setvalueattime(0.5, ac.currenttime); splitter.connect(gainnode, 0); // connect the splitter back to the second input of the merger: we // effectively swap the channels, here, reversing the stereo image.
Channel Messaging API - Web APIs
you can also see a multimessaging demo (run this live), which shows a slightly more complex setup that can send multiple messages between main page and iframe.
Clients.claim() - Web APIs
WebAPIClientsclaim
the claim() method of the clients interface allows an active service worker to set itself as the controller for all clients within its scope.
Clients - Web APIs
WebAPIClients
clients.claim() allows an active service worker to set itself as the controller for all clients within its scope.
Clipboard.write() - Web APIs
WebAPIClipboardwrite
function setclipboard(text) { let data = [new clipboarditem({ "text/plain": text })]; navigator.clipboard.write(data).then(function() { /* success */ }, function() { /* failure */ }); } the code begins by creating a new clipboarditem object into which the text will be placed for sending to the clipboard.
ClipboardEvent.clipboardData - Web APIs
the clipboardevent.clipboarddata property holds a datatransfer object, which can be used: to specify what data should be put into the clipboard from the cut and copy event handlers, typically with a setdata(format, data) call; to obtain the data to be pasted from the paste event handler, typically with a getdata(format) call.
ClipboardItem.getType() - Web APIs
then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object.
ClipboardItem - Web APIs
then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object.
Console.profileEnd() - Web APIs
to work around this, call it in a settimeout with at least 5ms delay.
Console.table() - Web APIs
WebAPIConsoletable
you can use the optional columns parameter to select a subset of columns to display: // an array of objects, logging only firstname function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var john = new person("john", "smith"); var jane = new person("jane", "doe"); var emily = new person("emily", "jones"); console.table([john, jane, emily], ["firstname"]); sorting columns you can sort the table by a particu...
ContentIndex.getAll() - Web APIs
for offline reading.' readinglistelem.append(message); } else { // if entries are present, display in a list of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url); listelem.append(listitem); } readinglistelem.append(listelem); } } specifications specification status comment unknownthe definition of 'getall' in that specification.
ContentIndex - Web APIs
for offline reading.' readinglistelem.append(message); } else { // if entries are present, display in a list of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url); listelem.append(listitem); } readinglistelem.append(listelem); } } unregistering indexed content below is an asynchronous function, that removes an item from the content index.
Content Index API - Web APIs
for offline reading.' readinglistelem.append(message); } else { // if entries are present, display in a list of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); const anchorelem = document.createelement('a'); anchorelem.innertext = entry.title; anchorelem.setattribute('href', entry.url); listelem.append(listitem); } readinglistelem.append(listelem); } } unregistering indexed content below is an asynchronous function, that removes an item from the content index.
ConvolverNode - Web APIs
convolvernode.normalize a boolean that controls whether the impulse response from the buffer will be scaled by an equal-power normalization when the buffer attribute is set, or not.
CrashReportBody - Web APIs
examples crash reports are generally only retrievable via endpoints set up using the report-to header.
CredentialsContainer.get() - Web APIs
from the resulting set of credentials, it then selects the best one.
CredentialsContainer.preventSilentAccess() - Web APIs
the preventsilentaccess() method of the credentialscontainer interface sets a flag that specifies whether automatic log in is allowed for future visits to the current origin, then returns an empty promise.
CredentialsContainer.store() - Web APIs
the store() method of the credentialscontainer stores a set of credentials for the user inside a credential instance, returning this in a promise.
CustomElementRegistry - Web APIs
+/g).length; } var count = 'words: ' + countwords(wcparent); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create text node and add word count to it var text = document.createelement('span'); text.textcontent = count; // append it to the shadow root shadow.appendchild(text); // update count when element content changes setinterval(function() { var count = 'words: ' + countwords(wcparent); text.textcontent = count; }, 200) } } // define the new element customelements.define('word-count', wordcount, { extends: 'p' }); note: the customelementregistry is available through the window.customelements property.
CustomEvent.initCustomEvent() - Web APIs
this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent().
CustomEvent - Web APIs
setting its value to true before returning from an event handler prevents propagation of the event.
DOMConfiguration - Web APIs
pre-defined parameters: "canonical-form", "cdata-sections", "check-character-normalization", "comments", "datatype-normalization", "element-content-whitespace", "entities", "error-handler", "infoset", "namespaces", "namespace-declarations", "normalize-characters","schema-location", "schema-type", "split-cdata-sections", "validate", "validate-if-schema", "well-formed" properties domconfiguration.parameternames read only is a domstringlist methods domconfiguration.cansetparameter() returns a boolean domconfiguration.getparameter() returns a domuserdata domconfiguration.setparameter() sets a parameter specification http://www.w3.org/tr/dom-level-3-cor...mconfiguration...
DOMException - Web APIs
some apis define their own sets of names, so this is not necessarily a complete list.
DOMHighResTimeStamp - Web APIs
reduced time precision to offer protection against timing attacks and fingerprinting, the precision of time stamps might get rounded depending on browser settings.
DOMImplementation.createDocument() - Web APIs
example var doc = document.implementation.createdocument ('http://www.w3.org/1999/xhtml', 'html', null); var body = document.createelementns('http://www.w3.org/1999/xhtml', 'body'); body.setattribute('id', 'abc'); doc.documentelement.appendchild(body); alert(doc.getelementbyid('abc')); // [object htmlbodyelement] specifications specification status comment domthe definition of 'domimplementation.createdocument' in that specification.
DOMImplementation.hasFeature() - Web APIs
the latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
DOMMatrixReadOnly.flipX() - Web APIs
const flipped = document.getelementbyid('flipped'); const matrix = new dommatrixreadonly(); const flippedmatrix = matrix.flipx(); flipped.setattribute('transform', flippedmatrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.flipx()' in that specification.
DOMMatrixReadOnly.scale() - Web APIs
dmatrix = matrix.scale(0.5); let scaledmatrixwithorigin = matrix.scale(0.5, 25, 25); // if the browser has interpreted these parameters as scalex, scaley, scalez, the resulting matrix is 3d const browserexpectssixparamscale = !scaledmatrixwithorigin.is2d; if (browserexpectssixparamscale) { scaledmatrixwithorigin = matrix.scale(0.5, 0.5, 1, 25, 25, 0); } document.queryselector('#transformed').setattribute('transform', scaledmatrix.tostring()); document.queryselector('#transformedorigin').setattribute('transform', scaledmatrixwithorigin.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.scale()' in that specification.
DOMMatrixReadOnly.translate() - Web APIs
const matrix = new dommatrixreadonly().translate(25, 25); document.queryselector('#transformed').setattribute('transform', matrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the definition of 'dommatrixreadonly.translate()' in that specification.
DOMParser - Web APIs
WebAPIDOMParser
in the case of an html document, you can also replace portions of the dom with new dom trees built from html by setting the value of the element.innerhtml and outerhtml properties.
DOMPoint.DOMPoint() - Web APIs
WebAPIDOMPointDOMPoint
examples this example creates a dompoint representing the top-left corner of the current window, then creates a second point based on the first, which is then offset by 100 pixels both vertically and horizontally.
DOMPoint - Web APIs
WebAPIDOMPoint
in the following snippet, the pose of the xr device (such as a vr headset or phone with ar capabilities) can be retrieved by calling using xrframe.getviewerpose() during an xrsession animation frame, then accessing the resulting xrpose's transform property, which contains two dompointreadonly attributes: position as a vector and orientation as a quaternion.
DOMPointReadOnly.toJSON() - Web APIs
return value a new dompointinit object whose properties are set to the values in the dompoint or dompointreadonly on which the method was called.
DOMStringMap - Web APIs
the domstringmap interface is used for the htmlelement.dataset attribute, to represent data for custom attributes added to elements.
DOMTokenList.add() - Web APIs
WebAPIDOMTokenListadd
return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.contains() - Web APIs
examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.entries() - Web APIs
examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.forEach() - Web APIs
example in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.item() - Web APIs
WebAPIDOMTokenListitem
examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.keys() - Web APIs
WebAPIDOMTokenListkeys
examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.length - Web APIs
examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist, then write the length of the list to the <span>'s node.textcontent.
DOMTokenList.remove() - Web APIs
return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.replace() - Web APIs
examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DOMTokenList.values() - Web APIs
examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DataTransferItem.webkitGetAsEntry() - Web APIs
first, the list is emptied by setting listing.innerhtml to be empty.
DataTransferItemList.DataTransferItem() - Web APIs
drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; // clear any remaining drag data datalist.clear(); } html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and ...
DataTransferItemList.add() - Web APIs
drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } result result link specifications specification status comment html liv...
DataTransferItemList.clear() - Web APIs
drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } result result link specifications specification status comment html livin...
DataTransferItemList.length - Web APIs
drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; // clear any remaining drag data datalist.clear(); } html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and ...
DataTransferItemList.remove() - Web APIs
drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } html <h1>example uses of <code>datatransferitemlist</code> methods and property</h1> <div> <p id="s...
DeprecationReportBody - Web APIs
observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
DirectoryEntrySync - Web APIs
[ todo: explain why ] getfile() depending on how you've set the options parameter, the method either creates a file or looks up an existing file.
DisplayMediaStreamConstraints.audio - Web APIs
if a mediatrackconstraints object is given, and an audio source is available, an audio track matching the settings given in the constraints object is included in the mediastream returned by getdisplaymedia().
Document: DOMContentLoaded event - Web APIs
display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.tex...
Document.alinkColor - Web APIs
returns or sets the color of an active link in the document body.
Document.bgColor - Web APIs
WebAPIDocumentbgColor
the deprecated bgcolor property gets or sets the background color of the current document.
Document.createAttribute() - Web APIs
example var node = document.getelementbyid("div1"); var a = document.createattribute("my_attrib"); a.value = "newval"; node.setattributenode(a); console.log(node.getattribute("my_attrib")); // "newval" specifications specification status comment domthe definition of 'document.createattribute()' in that specification.
Document.createRange() - Web APIs
example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); notes once a range is created, you need to set its boundary points before you can make use of most of its methods.
Document.createTreeWalker() - Web APIs
example the following example goes through all nodes in the body, reduces the set of nodes to elements, simply passes through as acceptable each node (it could reduce the set in the acceptnode() method instead), and then makes use of tree walker iterator that is created to advance through the nodes (now all elements) and push them into an array.
Document.designMode - Web APIs
syntax var mode = document.designmode; document.designmode = value; value a string indicating whether designmode is (or should be) set to on or off.
Document.doctype - Web APIs
WebAPIDocumentdoctype
example var doctypeobj = document.doctype; console.log( "doctypeobj.name: " + doctypeobj.name + "\n" + "doctypeobj.internalsubset: " + doctypeobj.internalsubset + "\n" + "doctypeobj.publicid: " + doctypeobj.publicid + "\n" + "doctypeobj.systemid: " + doctypeobj.systemid ); notes the property returns null if there is no dtd associated with the current document.
Document.documentURIObject - Web APIs
privileged code must be careful not to try getting or setting this property on a non-wrapped content object (e.g., on a wrappedjsobject of an xpcnativewrapper).
Document: dragover event - Web APIs
bubbles yes cancelable yes default action reset the current drag operation to "none".
Document.execCommand() - Web APIs
note that internet explorer uses this to set the text background color.
Document.featurePolicy - Web APIs
syntax var policy = iframeelement.featurepolicy value a featurepolicy object that can be used to inspect the feature policy settings applied to the document.
Document.fgColor - Web APIs
WebAPIDocumentfgColor
fgcolor gets/sets the foreground color, or text color, of the current document.
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.getElementById() - Web APIs
example <!doctype html> <html> <head> <meta charset="utf-8"> <title>document</title> </head> <body> <div id="parent-id"> <p>hello word1</p> <p id="test1">hello word2</p> <p>hello word3</p> <p>hello word4</p> </div> <script> var parentdom = document.getelementbyid('parent-id'); var test1 = parentdom.getelementbyid('test1'); //throw error //uncaught typeerror: parentdom.
Document.getElementsByTagName() - Web APIs
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>getelementsbytagname example</title> <script> function getallparaelems() { var allparas = document.getelementsbytagname('p'); var num = allparas.length; alert('there are ' + num + ' paragraph in this document'); } function div1paraelems() { var div1 = document.getelementbyid('div1'); var div1paras = div1.getelementsbytagname('p'); ...
Document.hasFocus() - Web APIs
WebAPIDocumenthasFocus
document.hasfocus()) { log.textcontent = 'this document has the focus.'; body.style.background = '#fff'; } else { log.textcontent = 'this document does not have the focus.'; body.style.background = '#ccc'; } } function openwindow() { window.open('https://developer.mozilla.org/', 'mdn', 'width=640,height=320,left=150,top=150'); } // check page focus every 300 milliseconds setinterval(checkpagefocus, 300); result specification specification status comment html living standardthe definition of 'document.hasfocus()' in that specification.
Document: keydown event - Web APIs
to ignore all keydown events that are part of composition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keydown example this example logs the keyboardevent.code value whenever you press down a key.
Document: keyup event - Web APIs
to ignore all keyup events that are part of composition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keyup", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples this example logs the keyboardevent.code value whenever you release a key.
Document: lostpointercapture event - Web APIs
const para = document.queryselector('p'); document.addeventlistener('lostpointercapture', () => { console.log('i\'ve been released!') }); para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, but using the onlostpointercapture event handler property: const para = document.queryselector('p'); document.onlostpointercapture = () => { console.log('i\'ve been released!') }; para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status ...
Document.onafterscriptexecute - Web APIs
the event's target attribute is set to the <script> element that just finished executing.
Document.onbeforescriptexecute - Web APIs
the event's target attribute is set to the script element that is about to be executed.
Document.ononline - Web APIs
WebAPIDocumentononline
you can register listeners for these events in a few familiar ways: using addeventlistener on the window, document, or document.body by setting the .ononline or .onoffline properties on document or document.body to a javascript function object.
Document.querySelector() - Web APIs
return value an htmlelement object representing the first element in the document that matches the specified set of css selectors, or null is returned if there are no matches.
Document: readystatechange event - Web APIs
display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.tex...
Document.referrer - Web APIs
WebAPIDocumentreferrer
inside an <iframe>, the document.referrer will initially be set to the same value as the href of the parent window's window.location.
Document: scroll event - Web APIs
instead, it is recommended to throttle the event using requestanimationframe(), settimeout(), or a customevent, as follows.
Document.timeline - Web APIs
WebAPIDocumenttimeline
the time values for this timeline are calculated as a fixed offset from the global clock such that the zero time corresponds to the navigationstart moment plus a signed delta known as the origin time.
Document: transitionend event - Web APIs
in the case where a transition is removed before completion, such as if the transition-property is removed or display is set to none, then the event will not be generated.
Document.visibilityState - Web APIs
typical use of this can be to prevent the download of some assets when the document is solely prerendered, or stop some activities when the document is in the background or minimized.
Document: wheel event - Web APIs
0) { // zoom in scale *= event.deltay * -2; } else { // zoom out scale /= event.deltay * 2; } // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale transform el.style.transform = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); document.onwheel = zoom; addeventlistener equivalent the event handler can also be set up using the addeventlistener() method: document.addeventlistener('wheel', zoom); specifications specification status comment ui eventsthe definition of 'wheel' in that specification.
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.
DocumentOrShadowRoot.getSelection() - Web APIs
htmlinputelement.setselectionrange()) could be used to work around this.
DocumentOrShadowRoot.pointerLockElement - Web APIs
the pointerlockelement property of the document and shadowroot interfaces provides the element set as the target for mouse events while the pointer is locked.
Events and the DOM - Web APIs
the problem with this method is that only one handler can be set per element and per event.
Locating DOM elements using selectors - Web APIs
the selectors api provides methods that make it quick and easy to retrieve element nodes from the dom by matching against a set of selectors.
EXT_disjoint_timer_query.createQueryEXT() - Web APIs
the ext_disjoint_timer_query.createqueryext() method of the webgl api creates and initializes webglquery objects, which track the time needed to fully complete a set of gl commands.
EXT_disjoint_timer_query - Web APIs
the ext_disjoint_timer_query extension is part of the webgl api and provides a way to measure the duration of a set of gl commands, without stalling the rendering pipeline.
EXT_texture_filter_anisotropic - Web APIs
ext.texture_max_anisotropy_ext this is the pname argument to the gl.gettexparameter() and gl.texparameterf() / gl.texparameteri() calls and sets the desired maximum anisotropy for a texture.
EcKeyGenParams - Web APIs
this should be set to ecdsa or ecdh, depending on the algorithm you want to use.
EcKeyImportParams - Web APIs
this should be set to ecdsa or ecdh, depending on the algorithm you want to use.
EcdhKeyDeriveParams - Web APIs
this should be set to ecdh.
EcdsaParams - Web APIs
this should be set to ecdsa.
Element: DOMActivate event - Web APIs
01/xml-events" width="6cm" height="5cm" viewbox="0 0 600 500"> <desc>example: invoke an ecmascript function from a domactivate event</desc> <!-- ecmascript to change the radius --> <script type="application/ecmascript"><![cdata[ function change(evt) { var circle = evt.target; var currentradius = circle.getfloattrait("r"); if (currentradius == 100) circle.setfloattrait("r", currentradius * 2); else circle.setfloattrait("r", currentradius * 0.5); } ]]></script> <!-- act on each domactivate event --> <circle cx="300" cy="225" r="100" fill="red"> <handler type="application/ecmascript" ev:event="domactivate"> change(evt); </handler> </circle> <text x="300" y="480" font-family="verdana" font-size="35" text-anchor="middle">...
Element: DOMMouseScroll event - Web APIs
bubbles yes cancelable yes interface mousescrollevent if you want to prevent the default action of mouse wheel events, it's not enough to handle only this event on gecko because if scroll amount by a native mouse wheel event is less than 1 line (or less than 1 page when the system setting is by page scroll), other mouse wheel events may be fired without this event.
Element.accessKey - Web APIs
WebAPIElementaccessKey
the element.accesskey property sets the keystroke which a user can press to jump to a given element.
Element: blur event - Web APIs
m> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are two ways of implementing event delegation for this event: by using the focusout event, or by setting the usecapture parameter of addeventlistener() to true.
Element.clientLeft - Web APIs
when layout.scrollbar.side preference is set to 1 or to 3 and when the text-direction is set to rtl, then the vertical scrollbar is positioned on the left and this impacts the way clientleft is computed.
Element.currentStyle - Web APIs
however, it returns the units set in css while window.getcomputedstyle() returns the values in pixels.
Element: error event - Web APIs
width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); const badimg = document.queryselector('.bad-img'); badimg.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: loading image\n`; console.log(event) }); const imgerror = document.queryselector('#img-error'); imgerror.addeventlistener('click', () => { badimg.setattribute('src', 'i-dont-exist'); }); result specifications specification status ui events working draft ...
Element: focus event - Web APIs
rm> javascript const password = document.queryselector('input[type="password"]'); password.addeventlistener('focus', (event) => { event.target.style.background = 'pink'; }); password.addeventlistener('blur', (event) => { event.target.style.background = ''; }); result event delegation there are two ways of implementing event delegation for this event: by using the focusin event, or by setting the usecapture parameter of addeventlistener() to true.
Element.getAttributeNS() - Web APIs
dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element.getattributens()' in that specification.
Element.getAttributeNode() - Web APIs
dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'getattributenode()' in that specification.
Element.hasAttribute() - Web APIs
s[name] && this.attributes[name].specified); } })(element.prototype); notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element.hasattribute()' in that specification.
Element.id - Web APIs
WebAPIElementid
syntax var idstr = element.id; // get the id element.id = idstr; // set the id idstr is the identifier of the element.
Element.insertAdjacentElement() - Web APIs
example beforebtn.addeventlistener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('beforebegin',tempdiv); } setlistener(tempdiv); }); afterbtn.addeventlistener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('afterend',tempdiv); } setlistener(tempdiv); }); have a look at our insertadjacentelement.html demo on github (see the source code too.) here we have a sequence of <div> ...
Element: keydown event - Web APIs
to ignore all keydown events that are part of composition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keydown example this example logs the keyboardevent.code value whenever you press down a key inside the <input> element.
Element: keyup event - Web APIs
to ignore all keyup events that are part of composition, do something like this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keyup", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keyup example this example logs the keyboardevent.code value whenever you release a key inside the <input> element.
Element: mouseout event - Web APIs
html <ul id="test"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> javascript let test = document.getelementbyid("test"); // briefly make the list purple when the mouse moves off the // <ul> element test.addeventlistener("mouseleave", function( event ) { // highlight the mouseleave target event.target.style.color = "purple"; // reset the color after a short delay settimeout(function() { event.target.style.color = ""; }, 1000); }, false); // briefly make an <li> orange when the mouse moves off of it test.addeventlistener("mouseout", function( event ) { // highlight the mouseout target event.target.style.color = "orange"; // reset the color after a short delay settimeout(function() { event.target.style.col...
Element: mouseover event - Web APIs
html <ul id="test"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> javascript let test = document.getelementbyid("test"); // this handler will be executed only once when the cursor // moves over the unordered list test.addeventlistener("mouseenter", function( event ) { // highlight the mouseenter target event.target.style.color = "purple"; // reset the color after a short delay settimeout(function() { event.target.style.color = ""; }, 500); }, false); // this handler will be executed every time the cursor // is moved over a different list item test.addeventlistener("mouseover", function( event ) { // highlight the mouseover target event.target.style.color = "orange"; // reset the color after a short delay settimeout(functi...
Element: msContentZoom event - Web APIs
the zoom level can be reset with element.mszoomto().
Element.openOrClosedShadowRoot - Web APIs
syntax var shadowroot = element.shadowroot; value a shadowroot object instance, regardless if its mode is set to open or closed, or null if no shadow root is present.
Element.part - Web APIs
WebAPIElementpart
set using the part attribute), returned as a domtokenlist.
Element: paste event - Web APIs
bubbles yes cancelable yes interface clipboardevent event handler property onpaste if the cursor is in an editable context (for example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position.
Element.querySelector() - Web APIs
the entire hierarchy of elements is considered when matching, including those outside the set of elements including baseelement and its descendants; in other words, selectors is first applied to the whole document, not the baseelement, to generate an initial list of potential elements.
Element.querySelectorAll() - Web APIs
examples dataset selector & attribute selectors <section class="box" id="sect1"> <div class="funnel-chart-percent1">10.900%</div> <div class="funnel-chart-percent2">3700.00%</div> <div class="funnel-chart-percent3">0.00%</div> </section> // dataset selectors const refs = [...document.queryselectorall(`[data-name*="funnel-chart-percent"]`)]; // attribute selectors // const refs = [...document.queryselect...
Element.removeAttributeNS() - Web APIs
/www.mozilla.org/ns/specialspace", "specialalign"); // now: <div id="div1" width="200px" /> notes dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element: removeattributens' in that specification.
Element.removeAttributeNode() - Web APIs
dom methods dealing with element's attributes: not namespace-aware, most commonly used methods namespace-aware variants (dom level 2) dom level 1 methods for dealing with attr nodes directly (seldom used) dom level 2 namespace-aware methods for dealing with attr nodes directly (seldom used) setattribute (dom 1) setattributens setattributenode setattributenodens getattribute (dom 1) getattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe definition of 'element: removeattributenode' in that specificatio...
Element.scroll() - Web APIs
WebAPIElementscroll
the scroll() method of the element interface scrolls the element to a particular set of coordinates inside a given element.
Element.scrollLeftMax - Web APIs
the element.scrollleftmax read-only property returns a number representing the maximum left scroll offset possible for the element.
Element.scrollTo() - Web APIs
WebAPIElementscrollTo
the scrollto() method of the element interface scrolls to a particular set of coordinates inside a given element.
Element.scrollTopMax - Web APIs
the element.scrolltopmax read-only property returns a number representing the maximum top scroll offset possible for the element.
Element.scrollWidth - Web APIs
ck for overflow </button> </body> <script> var buttonone = document.getelementbyid('abutton'), buttontwo = document.getelementbyid('anotherbutton'), divone = document.getelementbyid('adiv'), divtwo = document.getelementbyid('anotherdiv'); //check to determine if an overflow is happening function isoverflowing(element) { return (element.scrollwidth > element.offsetwidth); } function alertoverflow(element) { if (isoverflowing(element)) { alert('contents are overflowing the container.'); } else { alert('no overflows!'); } } buttonone.addeventlistener('click', function() { alertoverflow(divone); }); buttontwo.addeventlistener('click', function() { alertoverflow(divtwo); ...
Element: scroll event - Web APIs
instead, it is recommended to throttle the event using requestanimationframe(), settimeout(), or a customevent, as follows.
Element: select event - Web APIs
is element."> <p id="log"></p> function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const input = document.queryselector('input'); input.addeventlistener('select', logselection); onselect equivalent you can also set up the event handler using the onselect property: input.onselect = logselection; specifications specification status ui eventsthe definition of 'select' in that specification.
Element.shadowRoot - Web APIs
syntax var shadowroot = element.shadowroot; value a shadowroot object instance, or null if the associated shadow root was attached with its mode set to closed.
Element: underflow event - Web APIs
this only works for elements for which overflow is not set to visible.
Element: wheel event - Web APIs
background: #cdf; padding: 5px; } function zoom(event) { event.preventdefault(); scale += event.deltay * -0.01; // restrict scale scale = math.min(math.max(.125, scale), 4); // apply scale transform el.style.transform = `scale(${scale})`; } let scale = 1; const el = document.queryselector('div'); el.onwheel = zoom; addeventlistener equivalent the event handler can also be set up using the addeventlistener() method: el.addeventlistener('wheel', zoom); specifications specification status comment ui eventsthe definition of 'wheel' in that specification.
ElementCSSInlineStyle - Web APIs
propertiesstylethe style property is used to get as well as set the inline style of an element.
Encrypted Media Extensions API - Web APIs
mediakeys represents a set of keys that an associated htmlmediaelement can use for decryption of media data during playback.
Event.bubbles - Web APIs
WebAPIEventbubbles
events that do bubble have this property set to true.
Event.composedPath() - Web APIs
the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively.
Event.explicitOriginalTarget - Web APIs
(mozilla-specific) 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.
Event.preventDefault() - Web APIs
ningtimeout; var warningbox = document.createelement("div"); warningbox.classname = "warning"; function displaywarning(msg) { warningbox.innerhtml = msg; if (document.body.contains(warningbox)) { window.cleartimeout(warningtimeout); } else { // insert warningbox after mytextbox mytextbox.parentnode.insertbefore(warningbox, mytextbox.nextsibling); } warningtimeout = window.settimeout(function() { warningbox.parentnode.removechild(warningbox); warningtimeout = -1; }, 2000); } result notes calling preventdefault() during any stage of event flow cancels the event, meaning that any default action normally taken by the implementation as a result of the event will not occur.
Event.timeStamp - Web APIs
WebAPIEventtimeStamp
<p>timestamp: <span id="time">-</span></p> javascript function gettime(event) { var time = document.getelementbyid("time"); time.firstchild.nodevalue = event.timestamp; } document.body.addeventlistener("keypress", gettime); result reduced time precision to offer protection against timing attacks and fingerprinting, the precision of event.timestamp might get rounded depending on browser settings.
Event.type - Web APIs
WebAPIEventtype
it is set when the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
EventSource() - Web APIs
the possible entries are: withcredentials, defaulting to false, indicating if cors should be set to include credentials.
EventSource.close() - Web APIs
WebAPIEventSourceclose
the close() method of the eventsource interface closes the connection, if one is made, and sets the eventsource.readystate attribute to 2 (closed).
ExtendableEvent() - Web APIs
init optional an options object containing any custom settings that you want to apply to the event object.
ExtendableMessageEvent() - Web APIs
origin: a domstring that defines the origin of the corresponding service worker's environment settings object.
FeaturePolicy.allowedFeatures() - Web APIs
as such, allowedfeatures() method returns a subset of directives returned by features().
FeaturePolicy - Web APIs
the featurepolicy interface of the feature policy api represents the set of policies applied to the current execution context.
FetchEvent.request - Web APIs
it will return a normal response object that has the appropriate error code set.
FetchEvent.respondWith() - Web APIs
if a worker script is intercepted, then the final url is used to set self.location and used as the base url for relative urls in the worker script.
File.lastModified - Web APIs
WebAPIFilelastModified
e.bin', { lastmodified: new date(2017, 1, 1), }); console.log(filewithdate.lastmodified); //returns 1485903600000 const filewithoutdate = new file([], 'file.bin'); console.log(filewithoutdate.lastmodified); //returns current time reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodified might get rounded depending on browser settings.
File.lastModifiedDate - Web APIs
nput"); // files is a filelist object (simliar to nodelist) var files = fileinput.files; for (var i = 0; i < files.length; i++) { alert(files[i].name + " has a last modified date of " + files[i].lastmodifieddate); } reduced time precision to offer protection against timing attacks and fingerprinting, the precision of somefile.lastmodifieddate.gettime() might get rounded depending on browser settings.
File.webkitRelativePath - Web APIs
the file.webkitrelativepath is a read-only property that contains a usvstring which specifies the file's path relative to the directory selected by the user in an <input> element with its webkitdirectory attribute set.
FileError - Web APIs
WebAPIFileError
when you're just testing your app, and you don't want to set up a web server, you can bypass the security restriction on chrome.
FileSystemDirectoryReader.readEntries() - Web APIs
first, the list is emptied by setting listing.innerhtml to be empty.
FileSystemFileEntry.file() - Web APIs
the filereader's load event handler is set up to deliver the loaded string to the successcallback specified when the readfile() method was called; similarly, its error handler is set up to call the errorcallback specified.
FileSystemFileEntry - Web APIs
inside the success callback, event handlers are set up to handle the error error and writeend events.
FileSystemFlags - Web APIs
the filesystemflags dictionary defines a set of values which are used when specifying option flags when calling certain methods in the file and directory entries api.
File and Directory Entries API support in Firefox - Web APIs
this subset of the api provided by chrome is still not fully specified; however, for web compatibility reasons, it was decided to implement a subset of the api in firefox; this was introduced in firefox 50.
File and Directory Entries API - Web APIs
filesystemflags defines a set of values which are used when specifying option flags when calling certain methods in the file and directory entries api.
FocusEvent() - Web APIs
when the event has both a source and a destination, the relatedtarget value must be set to the other target.
FocusEvent.relatedTarget - Web APIs
relatedtarget may also be set to null for security reasons, like when tabbing in or out of a page.
FocusEvent - Web APIs
in some cases (such as when tabbing in or out a page), this property may be set to null for security reasons.
FontFace.family - Web APIs
WebAPIFontFacefamily
the fontface.family property allows the author to get or set the font family of a fontface object.
FontFace.stretch - Web APIs
WebAPIFontFacestretch
the stretch property of the fontface interface retrieves or sets how the font stretches.
FontFace.style - Web APIs
WebAPIFontFacestyle
the style property of the fontface interface retrieves or sets the font's style.
FontFace.unicodeRange - Web APIs
the unicoderange property of the fontface interface retrieves or sets the range of unicode codepoints encompassing the font.
FontFace.variant - Web APIs
WebAPIFontFacevariant
the variant property of the fontface interface programatically retrieves or sets font variant values.
FontFace.weight - Web APIs
WebAPIFontFaceweight
the weight property of the fontface interface retrieves or sets the weight of the font.
FormData.append() - Web APIs
WebAPIFormDataappend
the difference between formdata.set and append() is that if the specified key already exists, formdata.set will overwrite all existing values with the new one, whereas append() will append the new value onto the end of the existing set of values.
Using the Frame Timing API - Web APIs
registering for notifications after an observer is created, the next step is to use the performanceobserver.observe() method to specify the set of performance events to observe.
FullscreenOptions.navigationUI - Web APIs
"auto" the browser will choose which of the above settings to apply.
GainNode.gain - Web APIs
WebAPIGainNodegain
gainnode.gain.setvalueattime(0, audioctx.currenttime); mute.id = "activated"; mute.innerhtml = "unmute"; } else { gainnode.gain.setvalueattime(1, audioctx.currenttime); mute.id = ""; mute.innerhtml = "mute"; } } specifications specification status comment web audio apithe definition of 'gain' in that specification.
Gamepad.mapping - Web APIs
WebAPIGamepadmapping
if the browser is able to map controls on the device to that layout the mapping property will be set to the string standard.
GeolocationCoordinates.longitude - Web APIs
); let lattext = document.getelementbyid("latitude"); let longtext = document.getelementbyid("longitude"); button.addeventlistener("click", function() { navigator.geolocation.getcurrentposition(function(position) { let lat = position.coords.latitude; let long = position.coords.longitude; lattext.innertext = lat.tofixed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listener is established by calling addeventlistener() on the <button> element.
Geolocation API - Web APIs
interfaces geolocation the main class of this api — contains methods to retrieve the user's current position, watch for changes in their position, and clear a previously-set watch.
GlobalEventHandlers.onloadstart - Web APIs
the onloadstart property sets and returns the event handler for the loadstart event.
GlobalEventHandlers.onanimationcancel - Web APIs
function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationname + "</code> at time " + event.elapsedtime.tofixed(2) + " seconds."; } logbox.innerhtml += "\n"; }; then we set up the handlecancelevent() function, which is called in response to the animationcancel event, as set up in the html above.
GlobalEventHandlers.oncontextmenu - Web APIs
tems: center; justify-content: center; animation: spin 18s linear infinite; background: lightsalmon; border-radius: 42%; margin: 1em; } .paused { background-color: #ddd; } .paused .shape { animation-play-state: paused; } javascript function pause(e) { body.classlist.add('paused'); note.removeattribute('hidden'); } function play(e) { body.classlist.remove('paused'); note.setattribute('hidden', ''); } const body = document.queryselector('body'); const note = document.queryselector('.note'); window.oncontextmenu = pause; window.onpointerdown = play; result specifications specification status comment html living standardthe definition of 'oncontextmenu' in that specification.
GlobalEventHandlers.ondrop - Web APIs
ing the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); } </script> <body> <h1>examples of <code>ondrag</code>, <code...
GlobalEventHandlers.onemptied - Web APIs
the onemptied property sets and returns the event handler for the emptied event.
GlobalEventHandlers.onerror - Web APIs
these error events do not bubble up to window, but (at least in firefox) can be handled with a window.addeventlistener configured with usecapture set to true.
GlobalEventHandlers.onfocus - Web APIs
the focus event is raised when the user sets focus on an element.
GlobalEventHandlers.oninvalid - Web APIs
thanks!</p> javascript const form = document.getelementbyid('form'); const error = document.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) { error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specification specification status comment html living standardthe definition of 'oninvalid' in that specification.
GlobalEventHandlers.onmousedown - Web APIs
ius: 50%; } img { mix-blend-mode: darken; } javascript function showview(event) { view.removeattribute('hidden'); view.style.left = event.clientx - 50 + 'px'; view.style.top = event.clienty - 50 + 'px'; event.preventdefault(); } function moveview(event) { view.style.left = event.clientx - 50 + 'px'; view.style.top = event.clienty - 50 + 'px'; } function hideview(event) { view.setattribute('hidden', ''); } const container = document.queryselector('.container'); const view = document.queryselector('.view'); container.onmousedown = showview; container.onmousemove = moveview; document.onmouseup = hideview; result specification specification status comment html living standardthe definition of 'onmousedown' in that specification.
GlobalEventHandlers.onmousemove - Web APIs
ta-tooltip="first link">see a tooltip here &hellip;</a></p> <p><a href="#" data-tooltip="second link">&hellip; or here!</a></p> css .tooltip { position: absolute; z-index: 9999; padding: 6px; background: #ffd; border: 1px #886 solid; border-radius: 5px; } javascript const tooltip = new (function() { const node = document.createelement('div'); node.classname = 'tooltip'; node.setattribute('hidden', ''); document.body.appendchild(node); this.follow = function(event) { node.style.left = event.clientx + 20 + 'px'; node.style.top = event.clienty + 10 + 'px'; }; this.show = function(event) { node.textcontent = event.target.dataset.tooltip; node.removeattribute('hidden'); }; this.hide = function() { node.setattribute('hidden', ''); }; })(); ...
GlobalEventHandlers.onmousewheel - Web APIs
the onmousewheel property sets and returns the event handler for the mousewheel event.
GlobalEventHandlers.onpointerdown - Web APIs
</div> css the css simply sets up the appearance of the target, and doesn't affect its functionality at all.
GlobalEventHandlers.onpointerenter - Web APIs
example this example shows two ways to use onpointerenter to set an element's pointerenter event handler.
GlobalEventHandlers.onpointerleave - Web APIs
example this example shows two ways to use onpointerleave to set an element's pointerleave event handler.
GlobalEventHandlers.onpointermove - Web APIs
example this example shows two ways to use onpointermove to set an element's pointermove event handler.
GlobalEventHandlers.onpointerout - Web APIs
example this example shows two ways to use onpointerout to set an element's pointerout event handler.
GlobalEventHandlers.onpointerover - Web APIs
example this example shows two ways to use onpointerover to set an element's pointerover event handler.
GlobalEventHandlers.onpointerup - Web APIs
example this example shows two ways to use onpointerup to set an element's pointerup event handler.
GlobalEventHandlers.onsubmit - Web APIs
thanks!</p> javascript const form = document.getelementbyid('form'); const error = document.getelementbyid('error'); const city = document.getelementbyid('city'); const thanks = document.getelementbyid('thanks'); city.oninvalid = invalid; form.onsubmit = submit; function invalid(event) { error.removeattribute('hidden'); } function submit(event) { form.setattribute('hidden', ''); thanks.removeattribute('hidden'); // for this example, don't actually submit the form event.preventdefault(); } result specifications specification status comment html living standardthe definition of 'onsubmit' in that specification.
GlobalEventHandlers.ontouchcancel - Web APIs
example this example shows two ways to use ontouchcancel to set an element's touchcancel event handler.
GlobalEventHandlers.ontouchend - Web APIs
example this example shows two ways to use ontouchend to set an element's touchend event handler.
GlobalEventHandlers.ontouchmove - Web APIs
example this example shows two ways to use ontouchmove to set an element's touchmove event handler.
GlobalEventHandlers.ontouchstart - Web APIs
example this example shows two ways to use ontouchstart to set an element's touchstart event handler.
GlobalEventHandlers.ontransitionend - Web APIs
another is if the display attribute is set to none.
GlobalEventHandlers - Web APIs
globaleventhandlers.onreset is an eventhandler representing the code to be called when the reset event is raised.
Gyroscope.Gyroscope() - Web APIs
if a feature policy blocks use of a feature, it is because your code is inconsistent with the policies set on your server.
Gyroscope.x - Web APIs
WebAPIGyroscopex
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Gyroscope.y - Web APIs
WebAPIGyroscopey
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Gyroscope.z - Web APIs
WebAPIGyroscopez
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Gyroscope - Web APIs
WebAPIGyroscope
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
HTMLAnchorElement.relList - Web APIs
it is a live domtokenlist containing the set of link types indicating the relationship between the resource represented by the <a> element and the current document.
HTMLAreaElement.relList - Web APIs
it is a live domtokenlist containing the set of link types indicating the relationship between the resource represented by the <area> element and the current document.
Audio() - Web APIs
return value a new htmlaudioelement object, configured to be used for playing back the audio from the file specified by url.the new object's preload property is set to auto and its src property is set to the specified url or null if no url is given.
HTMLCanvasElement.captureStream() - Web APIs
if not set, a new frame will be captured each time the canvas changes; if set to 0, frames will not be captured automatically; instead, they will only be captured when the returned track's requestframe() method is called.
HTMLCanvasElement.height - Web APIs
when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used.
HTMLCanvasElement.toBlob() - Web APIs
a download link is created by setting the download attribute.
HTMLCanvasElement.width - Web APIs
when the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used.
HTMLCollection.item - Web APIs
the htmlcollection method item() returns the node located at the specified offset into the collection.
HTMLDialogElement: cancel event - Web APIs
bubbles no cancelable yes interface event event handler oncancel examples live example html <dialog class="example-dialog"> <button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('cancel', (event) => { result.textcontent = 'dialog was canceled'; }); const opendialog = document.queryselec...
HTMLDialogElement.close() - Web APIs
d="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); di...
HTMLDialogElement: close event - Web APIs
bubbles no cancelable no interface event event handler property onclose examples live example html <dialog class="example-dialog"> <button class="close" type="reset">close</button> </dialog> <button class="open-dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('close', (event) => { result.textcontent = 'dialog was closed'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (ty...
HTMLDialogElement.returnValue - Web APIs
the returnvalue property of the htmldialogelement interface gets or sets the return value for the <dialog>, usually to indicate which button the user pressed to close it.
HTMLDialogElement.show() - Web APIs
d="favdialog"> <form method="dialog"> <section> <p><label for="favanimal">favorite animal:</label> <select id="favanimal" name="favanimal"> <option></option> <option>brine shrimp</option> <option>red panda</option> <option>spider monkey</option> </select></p> </section> <menu> <button id="cancel" type="reset">cancel</button> <button type="submit">confirm</button> </menu> </form> </dialog> <menu> <button id="updatedetails">update details</button> </menu> <script> (function() { var updatebutton = document.getelementbyid('updatedetails'); var cancelbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); di...
HTMLElement.hidden - Web APIs
javascript document.getelementbyid("okbutton") .addeventlistener("click", function() { document.getelementbyid("welcome").hidden = true; document.getelementbyid("awesome").hidden = false; }, false); this code sets up a handler for the welcome panel's "ok" button that hides the welcome panel and makes the follow-up panel—with the curious name "awesome"—visible in its place.
HTMLElement: lostpointercapture event - Web APIs
const para = document.queryselector('p'); para.addeventlistener('lostpointercapture', () => { console.log('i\'ve been released!') }); para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); the same example, but using the onlostpointercapture event handler property: const para = document.queryselector('p'); para.onlostpointercapture = () => { console.log('i\'ve been released!') }; para.addeventlistener('pointerdown', (event) => { para.setpointercapture(event.pointerid); }); specifications specification status point...
HTMLElement.outerText - Web APIs
as a setter, it removes the current node and replaces it with the given text.
HTMLElement: transitionend event - Web APIs
in the case where a transition is removed before completion, such as if the transition-property is removed or display is set to none, then the event will not be generated.
HTMLFormControlsCollection - Web APIs
it represents the lists returned by the htmlformelement interface's elements property and the htmlfieldsetelement interface's elements property.
HTMLFormElement.action - Web APIs
this property can be retrieved or set.
HTMLFormElement.length - Web APIs
the elements included by htmlformelement.elements and htmlformelement.length are the following: <button> <fieldset> <input> (with the exception that any whose type is "image" are omitted for historical reasons) <object> <output> <select> <textarea> no other elements are included in the list returned by elements, which makes it an excellent way to get at the elements most important when processing forms.
HTMLFormElement.name - Web APIs
internet explorer (ie) does not allow the name attribute of an element created using createelement() to be set or modified using the name property.
HTMLHRElement - Web APIs
htmlhrelement.noshade is a boolean that sets the rule to have no shading.
HTMLHyperlinkElementUtils.password - Web APIs
if it is set without first setting the username property, it silently fails.
HTMLHyperlinkElementUtils.port - Web APIs
if the url does not contain an explicit port number, it will be set to ''.
HTMLIFrameElement.featurePolicy - Web APIs
syntax var policy = htmliframeelement.featurepolicy value a featurepolicy object that can be used to inspect the feature policy settings applied to the frame.
HTMLIFrameElement.referrerPolicy - Web APIs
carefully consider the impact of this setting.
HTMLIFrameElement - Web APIs
htmliframeelement.sandbox is a domsettabletokenlist that reflects the sandbox html attribute, indicating extra restrictions on the behavior of the nested content.
HTMLImageElement.align - Web APIs
syntax htmlimageelement.align = alignmode; alignmode = htmlimageelement.align; value a domstring specifying one of the following strings which set the alignment mode for the image.
HTMLImageElement.border - Web APIs
the border property or its longhand properties to not only set the thickness of the border but to potentially apply a wide variety of other styling options to it.
HTMLImageElement.decode() - Web APIs
usage notes one potential use case for decode(): when loading very large images (for example, in an online photo album), you can present a low resolution thumbnail image initially and then replace that image with the full-resolution image by instantiating a new htmlimageelement, setting its source to the full-resolution image's url, then using decode() to get a promise which is resolved once the full-resolution image is ready for use.
HTMLImageElement.isMap - Web APIs
usage notes when an image marked as being part of a server-side image map is clicked, the browser constructs the string "?x,y", where x and y indicate the coordinates at which the mouse was clicked as offsets from the top-left corner of the image, specified in css pixels.
HTMLInputElement: search event - Web APIs
bubbles yes cancelable no interface event event handler property onsearch there are several ways a search can be initiated, such as by pressing enter while the <input> is focused, or, if the incremental attribute is present, after a ua-defined timeout elapses since the most recent keystroke (with new keystrokes resetting the timeout so the firing of the event is debounced).
HTMLInputElement.select() - Web APIs
in browsers where it is not supported, it is possible to replace it with a call to htmlinputelement.setselectionrange() with parameters 0 and the input's value length: <input onclick="this.select();" value="sample text" /> <!-- equivalent to --> <input onclick="this.setselectionrange(0, this.value.length);" value="sample text" /> specifications specification status comment html living standardthe definition of 'select' in that specification.
HTMLKeygenElement - Web APIs
setcustomvalidity(in domstring error) void sets a custom validity message for the element.
HTMLLIElement - Web APIs
as the standard way of defining the list type is via the css list-style-type property, use the cssom methods to set it via a script.
HTMLLabelElement.htmlFor - Web APIs
that means that this script-accessible property is used to set and read the value of the content property for, which is the id of the label's associated control element.
HTMLLinkElement.rel - Web APIs
the most common use of this attribute is to specify a link to an external style sheet: the property is set to stylesheet, and the href attribute is set to the url of an external style sheet to format the page.
HTMLLinkElement.relList - Web APIs
it is a live domtokenlist containing the set of link types indicating the relationship between the resource represented by the <link> element and the current document.
HTMLMapElement - Web APIs
if the id attribute is set, this must have the same value; and it cannot be null or empty.
HTMLMediaElement: abort event - Web APIs
bubbles no cancelable no interface event event handler property onabort examples const video = document.queryselector('video'); const videosrc = 'https://path/to/video.webm'; video.addeventlistener('abort', () => { console.log(`abort loading: ${videosrc}`); }); const source = document.createelement('source'); source.setattribute('src', videosrc); source.setattribute('type', 'video/webm'); video.appendchild(source); specifications specification status html living standard living standard html5 recommendation ...
HTMLMediaElement.autoplay - Web APIs
however, autoplay can be useful when creating media elements whose source will be set at a later time, under user control.
HTMLMediaElement.controlsList - Web APIs
the controlslist property of the htmlmediaelement interface returns a domtokenlist that helps the user agent select what controls to show on the media element whenever the user agent shows its own set of controls.
HTMLMediaElement.currentTime - Web APIs
setting currenttime to a new value seeks the media to the given time, if the media is available.
HTMLMediaElement: error event - Web APIs
bubbles no cancelable no interface event event handler property onerror examples const video = document.queryselector('video'); const videosrc = 'https://path/to/video.webm'; video.addeventlistener('error', () => { console.error(`error loading: ${videosrc}`); }); video.setattribute('src', videosrc); specifications specification status html living standard living standard html5 recommendation ...
HTMLMediaElement.fastSeek() - Web APIs
note: if you need to seek with precision, you should set htmlmediaelement.currenttime instead.
HTMLMediaElement: loadeddata event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onloadeddata specification html5 media note that this event will not fire in mobile/tablet devices if data-saver is on in browser settings.
HTMLMediaElement: loadstart event - Web APIs
nt = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('progress', handleevent); video.addeventlistener('canplay', handleevent); video.addeventlistener('canplaythrough', handleevent); loadvideo.addeventlistener('click', () => { if (source) { document.location.reload(); } else { loadvideo.textcontent = "reset example"; source = document.createelement('source'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', 'video/webm'); video.appendchild(source); } }); result specifications specification status html living standardthe definition of 'loadstart media ev...
HTMLMediaElement.msInsertAudioEffect() - Web APIs
effectrequired a boolean which if set to true requires an audio effect to be defined.
HTMLMediaElement.playbackRate - Web APIs
the htmlmediaelement.playbackrate property sets the rate at which the media is being played back.
HTMLMediaElement: progress event - Web APIs
nt = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('progress', handleevent); video.addeventlistener('canplay', handleevent); video.addeventlistener('canplaythrough', handleevent); loadvideo.addeventlistener('click', () => { if (source) { document.location.reload(); } else { loadvideo.textcontent = "reset example"; source = document.createelement('source'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', 'video/webm'); video.appendchild(source); } }); result specifications specification status html living standardthe definition of 'progress media event' ...
HTMLMediaElement.volume - Web APIs
the htmlmediaelement.volume property sets the volume at which the media will be played.
HTMLOptionElement - Web APIs
if this attribute isn't specifically set, reading it returns the element's text content.
HTMLSourceElement - Web APIs
htmlsourceelement.srcset is a domstring reflecting the srcset html attribute, containing a list of candidate images, separated by a comma (',', u+002c comma).
HTMLTableColElement - Web APIs
htmltablecolelement.choff is a domstring representing the offset for the alignment character.
HTMLTableElement.align - Web APIs
syntax htmltableelement.align = alignment; var alignment = htmltableelement.align; parameters alignment domstring with one of the following values: left center right example // set the alignmnet of a table var t = document.getelementbyid('tablea'); t.align = 'center'; specification w3c dom 2 html specification htmltableelement .align.
HTMLTableElement.bgColor - Web APIs
example // set table background colour to lightblue var t = document.getelementbyid('tablea'); t.bgcolor = 'lightblue'; specification dom level 2 html:htmltableelement .bgcolor ...
HTMLTableElement.border - Web APIs
example // set the width of a table border to 2 pixels var t = document.getelementbyid('tablea'); t.border = '2'; specification w3c dom 2 html specification htmltableelement .border.
HTMLTableElement.cellPadding - Web APIs
example // set cell padding to 10 pixels let t = document.getelementbyid('tablea'); t.cellpadding = '10'; specification w3c dom 2 html specification htmltableelement .cellpadding.
HTMLTableElement.cellSpacing - Web APIs
example this example sets cell spacing for a given table to 10 pixels.
HTMLTableElement.frame - Web APIs
"above" top side "below" bottom side "hsides" top and bottom only "vsides" right and left sides only "lhs" left-hand side only "rhs" right-hand side only "box" all four sides "border" all four sides example // set the frame of tablea to 'border' var t = document.getelementbyid('tablea'); t.frame = "border"; t.border = "2px"; specification w3c dom 2 html specification ...
HTMLTimeElement.dateTime - Web APIs
23:59 12:15:47 12:15:52.998 valid local date and time string yyyy-mm-dd hh:mm yyyy-mm-dd hh:mm:ss yyyy-mm-dd hh:mm:ss.mmm yyyy-mm-ddthh:mm yyyy-mm-ddthh:mm:ss yyyy-mm-ddthh:mm:ss.mmm 2013-12-25 11:12 1972-07-25 13:43:07 1941-03-15 07:06:23.678 2013-12-25t11:12 1972-07-25t13:43:07 1941-03-15t07:06:23.678 valid time-zone offset string z +hhmm +hh:mm -hhmm -hh:mm z +0200 +04:30 -0300 -08:00 valid global date and time string any combination of a valid local date and time string followed by a valid time-zone offset string 2013-12-25 11:12+0200 1972-07-25 13:43:07+04:30 1941-03-15 07:06:23.678z 2013-12-25t11:12-08:00 valid week string yyyy-www 2...
HTMLTrackElement: cuechange event - Web APIs
bubbles no cancelable no interface event event handler oncuechange examples on the texttrack you can set up a listener for the cuechange event on a texttrack using the addeventlistener() method: track.addeventlistener('cuechange', function () { let cues = track.activecues; // array of current cues }); or you can just set the oncuechange event handler property: track.oncuechange = function () { let cues = track.activecues; // array of current cues } on the track element the underlying texttrack, indicated by the track property, recei...
HTMLTrackElement - Web APIs
if you need to be able to perform any processing on the track after the <track> is set up, you should instead ensure that the track's mode is either hidden (if you don't want it to start out being presented to the user) or showing (to initially display the track).
HTMLVideoElement.msFrameStep() - Web APIs
syntax htmlvideoelement.msframestep(forward); parameters forward a boolean which if set to true steps the video forward by one frame, if false steps the video backwards by one frame.
HTMLVideoElement.msInsertVideoEffect() - Web APIs
effectrequired a boolean which if set to true requires a video effect to be defined.
HashChangeEvent - Web APIs
here is a version that allows only one handler to be bound to the onhashchange property: ;(function(window) { // exit if the browser implements that event if ( "onhashchange" in window.document.body ) { return; } var location = window.location, oldurl = location.href, oldhash = location.hash; // check the location hash on a 100ms interval setinterval(function() { var newurl = location.href, newhash = location.hash; // if the hash has changed and a handler has been bound...
Headers() - Web APIs
WebAPIHeadersHeaders
in the following snippet we create a new headers object, adding some headers by passing the constructor an init object as an argument: var httpheaders = { 'content-type' : 'image/jpeg', 'accept-charset' : 'utf-8', 'x-my-custom-header' : 'zeke are cool' }; var myheaders = new headers(httpheaders); you can now create another headers object, passing it the first headers object as its init object: var secondheadersobj = new headers(myheaders); secondheadersobj.get('content-type'); // would return 'image/jpeg' — it inherits it from the first headers object specifications specification...
History.scrollRestoration - Web APIs
the scrollrestoration property of history interface allows web applications to explicitly set default scroll restoration behavior on history navigation.
History - Web APIs
WebAPIHistory
scrollrestoration allows web applications to explicitly set default scroll restoration behavior on history navigation.
HkdfParams - Web APIs
this should be set to hkdf.
HmacImportParams - Web APIs
this should be set to hmac.
HmacKeyGenParams - Web APIs
this should be set to hmac.
IDBCursor.advance() - Web APIs
WebAPIIDBCursoradvance
the advance() method of the idbcursor interface sets the number of times a cursor should move its position forward.
IDBCursor.direction - Web APIs
the direction read-only property of the idbcursor interface is a domstring that returns the direction of traversal of the cursor (set using idbobjectstore.opencursor for example).
IDBCursor.key - Web APIs
WebAPIIDBCursorkey
if the cursor is outside its range, this is set to undefined.
IDBCursor.primaryKey - Web APIs
if the cursor is currently being iterated or has iterated outside its range, this is set to undefined.
IDBCursorSync - Web APIs
setting this attribute can raise an idbdatabaseexception with the following codes: data_err if the underlying object store uses in-line keys and the property at the key path does not match the key in this cursor's position.
IDBDatabase.createObjectStore() - Web APIs
invalidaccesserror if autoincrement is set to true and keypath is either an empty string or an array containing an empty string.
IDBFactory.deleteDatabase() - Web APIs
if the database is successfully deleted, then a success event is fired on the request object returned from this method, with its result set to undefined.
IDBFactory.open() - Web APIs
WebAPIIDBFactoryopen
if the operation is successful, a success event is fired on the request object that is returned from this method, with its result attribute set to the new idbdatabase object for the connection.
IDBIndex.getAllKeys() - Web APIs
the getallkeys() method of the idbindex interface instantly retrieves the primary keys of all objects inside the index, setting them as the result of the request object.
IDBIndex.multiEntry - Web APIs
this method takes an optional options parameter whose multientry property is set to true/false.
IDBIndex.name - Web APIs
WebAPIIDBIndexname
chrome android full support 25firefox android full support 22opera android full support 14safari ios full support 8samsung internet android full support 1.5renaming with name setterchrome full support yesedge full support ≤79firefox full support 49ie ?
IDBIndex.unique - Web APIs
WebAPIIDBIndexunique
this method takes an optional parameter, unique, which if set to true means that the index will not be able to accept duplicate entries.
IDBIndex - Web APIs
WebAPIIDBIndex
you can grab a set of keys within a range.
IDBObjectStore.delete() - Web APIs
the request.result attribute is set to undefined.
IDBObjectStore.get() - Web APIs
if a value is successfully found, then a structured clone of it is created and set as the result of the request object.
IDBObjectStore.getAll() - Web APIs
if a value is successfully found, then a structured clone of it is created and set as the result of the request object.
IDBObjectStore.getAllKeys() - Web APIs
if a value is successfully found, then a structured clone of it is created and set as the result of the request object.
IDBObjectStore.name - Web APIs
full support 14safari ios full support 8samsung internet android full support 1.5 full support 1.5 no support 1.5 — 7.0prefixed prefixed implemented with the vendor prefix: webkitrenaming through name setterchrome full support yesedge full support ≤18firefox full support 49ie ?
IDBObjectStore.openKeyCursor() - Web APIs
the openkeycursor() method of the idbobjectstore interface returns an idbrequest object whose result will be set to an idbcursor that can be used to iterate through matching results.
IDBObjectStore.put() - Web APIs
if the record is successfully stored, then a success event is fired on the returned request object with the result set to the key for the stored record, and the transaction set to the transaction in which this object store is opened.
IDBObjectStoreSync - Web APIs
if this attribute is set to null, then the application must provide a key for each modification operation.
IDBTransaction.abort() - Web APIs
all pending idbrequest objects created during this transaction have their idbrequest.error attribute set to aborterror.
IDBTransaction.mode - Web APIs
this mode is for updating the version number of transactions that were started using idbdatabase.setversion().
IDBTransaction.oncomplete - Web APIs
you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.indexeddb.experimental pref is set to true in about:config.
IIRFilterNode - Web APIs
it also has the following additional methods: getfrequencyresponse() uses the filter's current parameter settings to calculate the response for frequencies specified in the provided array of frequencies.
ImageCapture.getPhotoCapabilities() - Web APIs
const input = document.queryselector('input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specifica...
ImageCapture - Web APIs
imagecapture.getphotosettings() returns a promise that resolves with a photosettings object containing the current photo configuration settings.
ImageData - Web APIs
WebAPIImageData
it can also be used to set a part of the canvas by using putimagedata().
InputDeviceCapabilities - Web APIs
parameters inputdevicecapabilitiesinit optional a dictionary object containing a set of device capabilities.
InputEvent.data - Web APIs
WebAPIInputEventdata
examples in the following simple example we've set up an event listener on the input event so that when any change is made to the contents of the <input> element (either by typing or pasting), the text that was added is retrieved via the inputevent.data property and reported in the paragraph below the input.
InputEvent.dataTransfer - Web APIs
examples in the following simple example we've set up an event listener on the input event so that when any content is pasted into the contenteditable <p> element, its html source is retrieved via the inputevent.datatransfer.getdata() method and reported in the paragraph below the input.
InstallEvent.InstallEvent() - Web APIs
init optional an options object containing any custom settings that you want to apply to the event object.
install - Web APIs
the { } constructor takes a comma-delimited set of label/value pairs.
IntersectionObserverEntry.intersectionRatio - Web APIs
example in this simple example, an intersection callback sets each target element's opacity to the intersection ratio of that element with the root.
IntersectionObserverEntry.target - Web APIs
example in this simple example, each targeted element's opacity is set to its intersectionratio.
KeyboardEvent.getModifierState() - Web APIs
note that which modifier key makes it return true depends on platforms, browsers, and user settings.
KeyboardEvent.initKeyEvent() - Web APIs
initkeyevent() must be called to set the event before it is dispatched.
KeyframeEffect.composite - Web APIs
syntax // getting var compositeenumeration = keyframeeffect.composite; // setting keyframeeffect.composite = 'accumulate'; value to understand these values, take the example of a keyframeeffect value of blur(2) working on an underlying property value of blur(3).
KeyframeEffect.iterationComposite - Web APIs
syntax // getting var iterationcompositeenumeration = keyframeeffect.iterationcomposite; // setting keyframeeffect.iterationcomposite = 'replace'; values replace the keyframeeffect value produced is independent of the current iteration.
LargestContentfulPaint - Web APIs
this example also demonstrates how to include buffered entries (those that ocurred before observer() was called), which is done by setting the buffered option to true.
LinearAccelerationSensor.LinearAccelerationSensor() - Web APIs
if a feature policy blocks use of a feature, it is because your code is inconsistent with the policies set on your server.
LinearAccelerationSensor.x - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
LinearAccelerationSensor.y - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
LinearAccelerationSensor.z - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
LinearAccelerationSensor - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
LocalFileSystemSync - Web APIs
example //taking care of the browser-specific prefix window.requestfilesystemsync = window.requestfilesystemsync || window.webkitrequestfilesystemsync; // the first parameter defines the type of storage: persistent or temporary // next, set the size of space needed (in bytes) // initfs is the success callback // and the last one is the error callback // for denial of access and other errors.
Location: href - Web APIs
WebAPILocationhref
setting the value of href navigates to the provided url.
Location: password - Web APIs
WebAPILocationpassword
if it is set without first setting the username property, it silently fails.
Location: port - Web APIs
WebAPILocationport
if the url does not contain an explicit port number, it will be set to ''.
LockManager.request() - Web APIs
settimeout(() => controller.abort(), 200); try { await navigator.locks.request('my_resource', {signal: controller.signal}, async lock => { // the lock was acquired!
LockedFile.abort() - Web APIs
WebAPILockedFileabort
summary the abort method is used to release the lock on the lockedfile object, making it inactive: its active property is set to false and all ongoing operations are canceled.
LockedFile.append() - Web APIs
WebAPILockedFileappend
the write operation is performed at the end of the file, regardless of the lockedfile.location value, and actually sets this value to null.
LockedFile.truncate() - Web APIs
if the method is called with no argument, the operation removes all the bytes starting at the index set in lockedfile.location.
LockedFile.write() - Web APIs
WebAPILockedFilewrite
the write starts at the position set in lockedfile.location and moves that position by the number of written bytes.
LockedFile - Web APIs
lockedfile.write() allows to write some data in the file starting at the location offset.
MIDIInputMap - Web APIs
though it works generally like a map, because it is read-only it does not contain clear(), delete(), or set() functions.
MIDIOutputMap - Web APIs
although it works like a map, because it is read-only, it does not contain clear(), delete(), or set() functions.
MSCandidateWindowShow - Web APIs
mscandidatewindowshow fires immediately after the input method editor (ime) candidate window is set to appear, but before it renders.
MSSiteModeEvent - Web APIs
cancelbubble gets or sets a value that indicates whether an event should be stopped from propagating up from the current target.
Magnetometer.Magnetometer() - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Magnetometer.x - Web APIs
WebAPIMagnetometerx
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Magnetometer.y - Web APIs
WebAPIMagnetometery
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Magnetometer.z - Web APIs
WebAPIMagnetometerz
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Magnetometer - Web APIs
if a feature policy blocks use of a feature, it's because your code is inconsistent with the policies set on your server.
MediaCapabilitiesInfo - Web APIs
properties the mediacapabilitiesinfo interface contains three boolean attribues: supported: given the properties defined in the mediaconfiguration, can the specified piece of media content be encoded (if mediaencodingconfiguration is set) or decode (if mediadecodingconfiguration is set) at all?
MediaDeviceInfo.deviceId - Web APIs
it is reset when the user clears cookies.
MediaDevices.enumerateDevices() - Web APIs
the mediadevices method enumeratedevices() requests a list of the available media input and output devices, such as microphones, cameras, headsets, and so forth.
MediaDevices.getDisplayMedia() - Web APIs
example in the example below, a startcapture() method is created which initiates screen capture given a set of options specified by the displaymediaoptions parameter.
MediaElementAudioSourceNode - Web APIs
pt.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a gain node var gainnode = audioctx.creategain(); // create variables to store mouse pointer y coordinate // and height of screen var cury; var height = window.innerheight; // get new mouse pointer coordinates when mouse is moved // then set new gain value document.onmousemove = updatepage; function updatepage(e) { cury = (window.event) ?
MediaError.code - Web APIs
WebAPIMediaErrorcode
example this example creates a <video> element, establishes an error handler for it, and then sets the element's src attribute to the video resource to present in the element.
MediaMetadata.MediaMetadata() - Web APIs
example the following example creates a new media session and assigns action handlers to it: if ('mediasession' in navigator){ navigator.mediasession.metadata = new mediametadata({ title: "podcast episode title", artist: "podcast host", album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previoustrack', function() {}); navigator.mediasession.setactionhandler('nexttrack', function() {}); } ...
MediaMetadata.album - Web APIs
the album property of the mediametadata interface returns or sets the name of the album or collection containing the media to be played.
MediaMetadata.artist - Web APIs
the artist property of the mediametadata interface returns or sets the name of the artist, group, creator, etc., of the media to be played.
MediaMetadata.artwork - Web APIs
the artwork property of the mediametadata interface returns or sets an array of mediaimage objects representing images associated with playing media.
MediaMetadata.title - Web APIs
the title property of the mediametadata interface returns or sets the title of the media to be played.
MediaQueryList.media - Web APIs
javascript let mql = window.matchmedia('(max-width: 600px)'); document.queryselector(".mq-value").innertext = mql.media; the javascript code simply passes the media query to match into matchmedia() to compile it, then sets the <span>'s innertext to the value of the result's media property.
MediaQueryList - Web APIs
examples this simple example creates a mediaquerylist and then sets up a listener to detect when the media query status changes, running a custom function when it does to change the appearence of the page.
MediaRecorder() - Web APIs
example this example shows how to create a media recorder for a specified stream, whose audio bit rate is set to 128 kbit/sec and whose video bit rate is set to 2.5 mbit/sec.
MediaRecorder.onerror - Web APIs
it returns either the mediarecorder or the name of the error that occurred if any exceptions are thrown during the setup process.
MediaRecorder.pause() - Web APIs
set mediarecorder.state to "paused".
MediaRecorder.resume() - Web APIs
set mediarecorder.state to "recording".
MediaRecorder.stop() - Web APIs
set the mediarecorder.state to "inactive" and stop capturing media.
MediaSession.playbackState - Web APIs
example the following example sets up event handlers, for pausing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; navigator.mediasession.setactionhandler('play', play); navigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); navigator.mediasession.playbackstate = "playing"; } function pause() { audio.pause(); navigator.mediasession.playbackstate ...
MediaSource.MediaSource() - Web APIs
example the following snippet is taken from a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) var video = document.queryselector('video'); var asseturl = 'frag_bunny.mp4'; // need to be specific for blink regarding codecs // ./mp4info frag_bunny.mp4 | grep codec var mimecodec = 'video/mp4; codecs="avc1.42e01e, mp4a.40.2"'; if ('mediasource' in window && mediasource.istypesupported(mimecodec)) { var mediasource = new mediasource; //console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource...
MediaSource.clearLiveSeekableRange() - Web APIs
the clearliveseekablerange() method of the mediasource interface clears a seekable range previously set with a call to setliveseekablerange().
MediaSource.readyState - Web APIs
//console.log(mediasource.readystate); // closed video.src = url.createobjecturl(mediasource); mediasource.addeventlistener('sourceopen', sourceopen); } else { console.error('unsupported mime type or codec: ', mimecodec); } function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; specifications specification status comment media source extensionsthe definition of 'readystate' in that specification.
MediaSource.sourceBuffers - Web APIs
example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, function (buf) { sourcebuffer.addeventlistener('updateend', function (_) { mediasource.endofstream(); console.log(mediasource.sourcebuffers); // will contain the source buffer that was added above video.play(); //console.log(mediasource.readystate); // ended }); sourcebuffer.appendbuffer(buf); }); }; ...
MediaStream.addTrack() - Web APIs
if the specified track is already in the stream's track set, this method has no effect.
MediaStreamAudioSourceNode - Web APIs
quadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling c...
MediaStreamTrack.kind - Web APIs
the mediastreamtrack.kind read-only property returns a domstring set to "audio" if the track is an audio track and to "video", if it is a video track.
MediaStreamTrack: mute event - Web APIs
you can also use the onmute event handler property to set up a handler for this event; similarly, the onunmute event handler is available for setting up a handler for the unmute event.
MediaStreamTrack.muted - Web APIs
when a track is disabled by setting enabled to false, it generates only empty frames (audio frames in which every sample is 0, or video frames in which every pixel is black).
MediaStreamTrack.onended - Web APIs
examples this example sets up an event handler for the ended event which changes an on-screen icon to indicate that the track is no longer active.
MediaStreamTrack.onmute - Web APIs
example in this example, an onmute handler is established to set the content html of an element to display the "muted speaker" emoji.
MediaStreamTrack: unmute event - Web APIs
you can also use the onunmute event handler property to set up a handler for this event; similarly, the onmute event handler is available for setting up a handler for the mute event.
MediaStreamTrackAudioSourceNode - Web APIs
quadfilter.gain.value = range.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination, so we can play the // music and adjust the volume using the mouse cursor source.connect(biquadfilter); biquadfilter.connect(audioctx.destination); // get new mouse pointer coordinates when mouse is moved // then set new gain value range.oninput = function() { biquadfilter.gain.value = range.value; } }) .catch(function(err) { console.log('the following gum error occured: ' + err); }); } else { console.log('getusermedia not supported on your browser!'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; note: as a consequence of calling c...
MediaStream Image Capture API - Web APIs
in addition to capturing data, it also allows you to retrieve information about device capabilities such as image size, red-eye reduction and whether or not there is a flash and what they are currently set to.
MediaTrackConstraints.aspectRatio - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.channelCount - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.deviceId - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.facingMode - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.frameRate - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.height - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.latency - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.sampleRate - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.sampleSize - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackConstraints.width - Web APIs
example see example: constraint exerciser in capabilities, constraints, and settings for an example.
MediaTrackSupportedConstraints.aspectRatio - Web APIs
the mediatracksupportedconstraints dictionary's aspectratio property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the aspectratio constraint.
MediaTrackSupportedConstraints.autoGainControl - Web APIs
the mediatracksupportedconstraints dictionary's autogaincontrol property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the autogaincontrol constraint.
MediaTrackSupportedConstraints.channelCount - Web APIs
the mediatracksupportedconstraints dictionary's channelcount property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the channelcount constraint.
MediaTrackSupportedConstraints.cursor - Web APIs
example this method sets up the constraints object specifying the options for the call to getdisplaymedia().
MediaTrackSupportedConstraints.deviceId - Web APIs
the mediatracksupportedconstraints dictionary's deviceid property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the deviceid constraint.
MediaTrackSupportedConstraints.displaySurface - Web APIs
example this method sets up the constraints object specifying the options for the call to getdisplaymedia().
MediaTrackSupportedConstraints.echoCancellation - Web APIs
the mediatracksupportedconstraints dictionary's echocancellation property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the echocancellation constraint.
MediaTrackSupportedConstraints.facingMode - Web APIs
the mediatracksupportedconstraints dictionary's facingmode property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the facingmode constraint.
MediaTrackSupportedConstraints.frameRate - Web APIs
the mediatracksupportedconstraints dictionary's framerate property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the framerate constraint.
MediaTrackSupportedConstraints.groupId - Web APIs
the mediatracksupportedconstraints dictionary's groupid property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the groupid constraint.
MediaTrackSupportedConstraints.height - Web APIs
the mediatracksupportedconstraints dictionary's height property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the height constraint.
MediaTrackSupportedConstraints.latency - Web APIs
the mediatracksupportedconstraints dictionary's latency property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the latency constraint.
MediaTrackSupportedConstraints.logicalSurface - Web APIs
example this method sets up the constraints object specifying the options for the call to getdisplaymedia().
MediaTrackSupportedConstraints.noiseSuppression - Web APIs
the mediatracksupportedconstraints dictionary's noisesuppression property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the noisesuppression constraint.
MediaTrackSupportedConstraints.sampleRate - Web APIs
the mediatracksupportedconstraints dictionary's samplerate property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the samplerate constraint.
MediaTrackSupportedConstraints.sampleSize - Web APIs
the mediatracksupportedconstraints dictionary's samplesize property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the samplesize constraint.
MediaTrackSupportedConstraints.volume - Web APIs
the mediatracksupportedconstraints dictionary's volume property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the volume constraint.
MediaTrackSupportedConstraints.width - Web APIs
the mediatracksupportedconstraints dictionary's width property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the width constraint.
MerchantValidationEvent.complete() - Web APIs
*/ } this code sets up a handler for the merchantvalidation event.
MessageEvent.MessageEvent() - Web APIs
this defaults to null if not set.
MessageEvent.ports - Web APIs
otherwise called implicitly by onmessage setter.
Microsoft API extensions - Web APIs
islayoutoptimalforplayback 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 mscapslockwa...
MouseEvent.pageX - Web APIs
WebAPIMouseEventpageX
prior to being added to the cssom view specification, pagex and pagey were available on the uievent interface in a limited subset of browsers for a short time.
MouseEvent.screenX - Web APIs
the screenx read-only property of the mouseevent interface provides the horizontal coordinate (offset) of the mouse pointer in global (screen) coordinates.
MouseEvent.screenY - Web APIs
the screeny read-only property of the mouseevent interface provides the vertical coordinate (offset) of the mouse pointer in global (screen) coordinates.
MutationRecord - Web APIs
note that for this to work as expected, attributeoldvalue or characterdataoldvalue must be set to true in the corresponding mutationobserverinit parameter of the mutationobserver observe method specifications specification status comment domthe definition of 'mutationrecord' in that specification.
Navigator.doNotTrack - Web APIs
the navigator.donottrack property returns the user's do not track setting, which indicates whether the user is requesting web sites and advertisers to not track them.
Navigator.getUserMedia() - Web APIs
for details, see the constraints section under the modern mediadevices.getusermedia() method, as well as the article capabilities, constraints, and settings.
Navigator.sendBeacon() - Web APIs
creating an <img> element and setting its src in the unload handler.
Navigator - Web APIs
WebAPINavigator
navigator.cookieenabled read only returns false if setting a cookie will be ignored and true otherwise.
Online and offline events - Web APIs
you can register listeners for these events in a few familiar ways: using addeventlistener on the window, document, or document.body by setting the .ononline or .onoffline properties on document or document.body to a javascript function object.
NavigatorStorage - Web APIs
the storage standard is designed to serve as a common basis for the implementation of all of those apis and storage technologies, so that their constraints and configurations can be understood and controlled using a common set of methods and properties.
NetworkInformation.saveData - Web APIs
the networkinformation.savedata read-only property of the networkinformation interface returns true if the user has set a reduced data usage option on the user agent.
NetworkInformation - Web APIs
networkinformation.savedata read only returns true if the user has set a reduced data usage option on the user agent.
Network Information API - Web APIs
if a cellular connection is found, then the preloadvideo flag is set to false.
Node.appendChild() - Web APIs
WebAPINodeappendChild
notes chaining may not work as expected, due to appendchild() returning the child element: let ablock = document.createelement('block').appendchild( document.createelement('b') ); sets ablock to <b></b> only, which is probably not what you want.
Node.getRootNode() - Web APIs
WebAPINodegetRootNode
syntax var root = node.getrootnode(options); parameters options optional an object that sets options for getting the root node.
Node.isEqualNode() - Web APIs
WebAPINodeisEqualNode
the specific set of data points that must match varies depending on the types of the nodes.
Node.lookupPrefix() - Web APIs
WebAPINodelookupPrefix
due to bug 312019, this method does not work with dynamically assigned namespaces, that is, those set with the node.prefix property.
Node.prefix - Web APIs
WebAPINodeprefix
obsolete specifies the behavior when it's set to null.
NodeIterator.detach() - Web APIs
originally, it detached the nodeiterator from the set over which it iterates, releasing any resources used by the set and setting the iterator's state to invalid.
NonDocumentTypeChildNode.nextElementSibling - Web APIs
unction (item) { if (item.hasownproperty('nextelementsibling')) { return; } object.defineproperty(item, 'nextelementsibling', { configurable: true, enumerable: true, get: function () { var el = this; while (el = el.nextsibling) { if (el.nodetype === 1) { return el; } } return null; }, set: undefined }); }); })([element.prototype, characterdata.prototype]); specifications specification status comment domthe definition of 'childnodenextelementsibling' in that specification.
NonDocumentTypeChildNode.previousElementSibling - Web APIs
tem) { if (item.hasownproperty('previouselementsibling')) { return; } object.defineproperty(item, 'previouselementsibling', { configurable: true, enumerable: true, get: function () { let el = this; while (el = el.previoussibling) { if (el.nodetype === 1) { return el; } } return null; }, set: undefined }); }); })([element.prototype, characterdata.prototype]); specifications specification status comment domthe definition of 'nondocumenttypechildnode.previouselementsibling' in that specification.
Notification.actions - Web APIs
the actions read-only property of the notification interface returns the list of notificationaction objects set using the actions option when creating the notification using the notification() constructor.
Notification.requestPermission() - Web APIs
possible values for this string are: granted denied default examples assume this basic html: <button onclick="notifyme()">notify me!</button> it's possible to send a notification as follows — here we present a fairly verbose and complete set of code you could use if you wanted to first check whether notifications are supported, then check if permission has been granted for the current origin to send notifications, then request permission if required, before then sending a notification.
Notification.requireInteraction - Web APIs
note: this can be set when the notification is first created by setting the requireinteraction option to true in the options object of the notification.notification() constructor.
Notification.silent - Web APIs
the silent read-only property of the notification interface specifies whether the notification should be silent, i.e., no sounds or vibrations should be issued, regardless of the device settings.
Notification.timestamp - Web APIs
for example, a timestamp for an upcoming meeting could be set in the future, whereas a timestamp for a missed message could be set in the past.
NotificationEvent.action - Web APIs
the notification id is set during the creation of the notification via the actions array attribute and can't be modified unless the notification is replaced.
NotificationEvent.notification - Web APIs
the notification provides read-only access to many properties that were set at the instantiation time of the notification such as tag and data attributes that allow you to store information for defered use in the notificationclick event.
Notifications API - Web APIs
once a choice has been made, the setting will generally persist for the current session.
NotifyAudioAvailableEvent - Web APIs
all audio frames are normalized to contain 1024 samples by default, but could be any length between 512 and 16384 samples if the user has set a different length using the mozframebufferlength attribute.
OES_texture_float - Web APIs
if you set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use floating-point textures, the texture will be marked as incomplete.
OES_texture_float_linear - Web APIs
with the help of this extension, you can now set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use floating-point textures.
OES_texture_half_float - Web APIs
if you set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use half floating-point textures, the texture will be marked as incomplete.
OES_texture_half_float_linear - Web APIs
with the help of this extension, you can now set the magnification or minification filter in the webglrenderingcontext.texparameter() method to one of gl.linear, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear, or gl.linear_mipmap_linear, and use half floating-point textures.
OES_vertex_array_object.createVertexArrayOES() - Web APIs
the oes_vertex_array_object.createvertexarrayoes() method of the webgl api creates and initializes a webglvertexarrayobject object that represents a vertex array object (vao) pointing to vertex array data and which provides names for different sets of vertex data.
OES_vertex_array_object - Web APIs
these objects keep pointers to vertex data and provide names for different sets of vertex data.
OVR_multiview2 - Web APIs
most vr headsets have two views, but there are prototypes of headset with ultra-wide fov using 4 views which is currently the maximum number of views supported by multiview.
OfflineAudioContext.OfflineAudioContext() - Web APIs
syntax var offlineaudioctx = new offlineaudiocontext(numberofchannels, length, samplerate); var offlineaudioctx = new offlineaudiocontext(options); parameters you can specify the parameters for the offlineaudiocontext() constructor as either the same set of parameters as are inputs into the audiocontext.createbuffer() method, or by passing those parameters in an options object.
OfflineAudioContext: complete event - Web APIs
is complete, you might want to use the oncomplete handler the prompt the user that the audio can now be played, and enable the play button: let offlineaudioctx = new offlineaudiocontext(); offlineaudioctx.addeventlistener('complete', () => { console.log('offline audio processing now complete'); showmodaldialog('song processed and ready to play'); playbtn.disabled = false; }) you can also set up the event handler using the offlineaudiocontext.oncomplete property: let offlineaudioctx = new offlineaudiocontext(); offlineaudioctx.oncomplete = function() { console.log('offline audio processing now complete'); showmodaldialog('song processed and ready to play'); playbtn.disabled = false; } specifications specification status comment web audio apithe defini...
OrientationSensor.populateMatrix() - Web APIs
where: w = cos(θ/2) x = vx * sin(θ/2) y = vy * sin(θ/2) z = vz * sin(θ/2) if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
OrientationSensor - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
OscillatorNode.onended - Web APIs
the onended property of the oscillatornode interface is used to set the event handler for the ended event, which fires when the tone has stopped playing.
OscillatorNode.start() - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status comment web audio apithe definition of 'start' in that specification.
OverconstrainedError.OverconstrainedError() - Web APIs
the overconstrainederror constructor creates a new overconstrainederror object which indicates that the set of desired capabilities for the current mediastreamtrack cannot currently be met.
OverconstrainedError - Web APIs
the overconstrainederror interface of the media capture and streams api indicates that the set of desired capabilities for the current mediastreamtrack cannot currently be met.
PannerNode.positionX - Web APIs
const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.positionx.setvalueattime(-1, context.currenttime + 1); panner.positionx.setvalueattime(1, context.currenttime + 2); panner.positionx.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positionx' in that specification.
PannerNode.positionY - Web APIs
const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positiony.setvalueattime(1, context.currenttime + 1); panner.positiony.setvalueattime(-1, context.currenttime + 2); panner.positiony.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positiony' in that specification.
PannerNode.positionZ - Web APIs
const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positionz.setvalueattime(1, context.currenttime + 1); panner.positionz.setvalueattime(-1, context.currenttime + 2); panner.positionz.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positionz' in that specification.
PannerNode.rolloffFactor - Web APIs
reates a graph for the test tone with a given rollofffactor // and schedules it to move away from the listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (rollofffactor, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.rollofffactor = rollofffactor; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay fairly quickly scheduletesttone(1, context.currenttime); // this tone s...
ParentNode.childElementCount - Web APIs
as this interface contained two distinct set of properties, one aimed at node that have children, one at those that are children, they have been moved into two separate pure interfaces, parentnode and childnode.
ParentNode.firstElementChild - Web APIs
as this interface contained two distinct set of properties, one aimed at node that have children, one at those that are children, they have been moved into two separate pure interfaces, parentnode and childnode.
ParentNode.lastElementChild - Web APIs
as this interface contained two distinct set of properties, one aimed at node that have children, one at those that are children, they have been moved into two separate pure interfaces, parentnode and childnode.
ParentNode.prepend() - Web APIs
the parentnode.prepend() method inserts a set of node objects or domstring objects before the first child of the parentnode.
PasswordCredential - Web APIs
examples this example shows how to set up an htmlformelement to caputure data which we'll use to create a passwordcredential object.
PasswordCredential.idName - Web APIs
this property defaults to 'username', but may be set to match whatever your backend service expects.
PayerErrors.email - Web APIs
WebAPIPayerErrorsemail
syntax payeremail = payererrors.email; value if validation of the payer's email address (paymentresponse.payeremail) found problems, this property should be set to a domstring that explains the validation problem and how to correct it.
PaymentRequest: merchantvalidation event - Web APIs
you can also use the onmerchantvalidation event handler property to set up the handler for this event: request.onmerchantvalidation = event => { event.complete(async () => { const merchantserverurl = window.location.origin + '/validate?url=' + encodeuricomponent(event.validationurl); // get validation data, and complete validation; return await fetch(merchantserverurl).then(response => response.text()); }); }; const response = await request.
PaymentRequest: shippingaddresschange event - Web APIs
example in this example, a handler for the shippingaddresschange event is set up to validate that the address meets requirements set by the web application.
PaymentRequest: shippingoptionchange event - Web APIs
bubbles no cancelable no interface paymentrequestupdateevent event handler property onshippingoptionchange examples this code snippet sets up a handler for the shippingoptionchange event.
PayerResponse.payerPhone - Web APIs
this option is only present when the requestpayerphone option is set to true in the paymentoptions object passed to the paymentrequest constructor.
PaymentResponse.retry() - Web APIs
requestorresponse.addeventlistener(event, async function listener(ev) { const promisetovalidate = validator(requestorresponse); ev.updatewith(promisetovalidate); const errors = await promisetovalidate; if (!errors) { // yay!
Payment Request API - Web APIs
note: the api is available inside cross-origin <iframe> elements only if they have had the allowpaymentrequest attribute set on them.
Pbkdf2Params - Web APIs
this should be set to pbkdf2.
PerformanceObserver - Web APIs
methods performanceobserver.observe() specifies the set of entry types to observe.
PerformanceObserverEntryList.getEntries() - Web APIs
the list's members are determined by the set of entry types specified in the call to the observe() method.
PerformanceObserverEntryList.getEntriesByName() - Web APIs
the list's members are determined by the set of entry types specified in the call to the observe() method.
PerformanceObserverEntryList.getEntriesByType() - Web APIs
the list's members are determined by the set of entry types specified in the call to the observe() method.
PerformanceServerTiming - Web APIs
example given a server that sends the server-timing header, for example a node.js server like this: const http = require('http'); function requesthandler(request, response) { const headers = { 'server-timing': ` cache;desc="cache read";dur=23.2, db;dur=53, app;dur=47.2 `.replace(/\n/g, '') }; response.writehead(200, headers); response.write(''); return settimeout(_ => { response.end(); }, 1000) }; http.createserver(requesthandler).listen(3000).on('error', console.error); the performanceservertiming entries are now observable from javascript via the performanceresourcetiming.servertiming property: let entries = performance.getentriesbytype('resource'); console.log(entries[0].servertiming); // 0: performanceservertiming {name: "cache", duratio...
PerformanceTiming.requestStart - Web APIs
if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request.
PerformanceTiming - Web APIs
if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request.
Performance API - Web APIs
adds the clearresourcetimings() method, the setresourcetimingbuffersize() method, and the onresourcetimingbufferfull event handler to the performance interface.
Using Performance Timeline - Web APIs
performance extensions performance timeline extends the performance object with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria.
Permissions.query() - Web APIs
WebAPIPermissionsquery
}) parameters permissiondescriptor an object that sets options for the query operation consisting of a comma-separated list of name-value pairs.
PhotoCapabilities.redEyeReduction - Web APIs
controllable red-eye reduction is available in the source and it is configurable via the photosettings object.
PointerEvent.getCoalescedEvents() - Web APIs
nowebview android full support 58chrome android full support 58firefox android partial support 59disabled partial support 59disabled disabled from version 59: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true).
PointerEvent.isPrimary - Web APIs
in a multi-pointer scenario (such as a touch screen that supports more than one touch point), this property is used to identify a master pointer among the set of active pointers for each pointer type.
PointerEvent - Web APIs
the pointer can target a specific coordinate (or set of coordinates) on the contact surface such as a screen.
PromiseRejectionEvent.promise - Web APIs
examples this example listens for unhandled promises and, if the reason is an object with a code field containing the text "module not ready", it sets up an idle callback that will retry the task that failed to execute correctly.
PublicKeyCredential - Web APIs
always set to public-key for publickeycredential instances.
PushEvent.PushEvent() - Web APIs
when the constructor is invoked, the pushevent.data property of the resulting object will be set to a new pushmessagedata object containing bytes extracted from the eventinitdict data member.
PushManager.getSubscription() - Web APIs
var pushbutton = document.queryselector('.js-push-button'); pushbutton.disabled = false; if (!subscription) { // we aren’t subscribed to push, so set ui // to allow the user to enable push return; } // keep your server in sync with the latest subscriptionid sendsubscriptiontoserver(subscription); showcurlcommand(subscription); // set your ui to show they have subscribed for // push messages pushbutton.textcontent = 'disable push messages'; ispushenabled = tr...
PushSubscription.getKey() - Web APIs
subbtn.disabled = false; if (!subscription) { console.log('not yet subscribed to push') // we aren't subscribed to push, so set ui // to allow the user to enable push return; } // set your ui to show they have subscribed for // push messages subbtn.textcontent = 'unsubscribe from push messaging'; ispushenabled = true; // initialize status, which includes setting ui elements for subscribed status // and updating subscribers list via push var endpoint = subscription.endpoint; var key = subscripti...
RTCAnswerOptions - Web APIs
the rtcansweroptions dictionary is used to provide optional settings when creating an sdp answer using rtcpeerconnection.createoffer() after receiving an offer from a remote peer.
RTCConfiguration.bundlePolicy - Web APIs
examples the following example creates a new rtcpeerconnection with a configuration setting the connection's bundlepolicy to max-compat to maximize compatibility while attempting to optimize network use.
RTCConfiguration.iceServers - Web APIs
if the list of servers is changed while a connection is already active by calling the the rtcpeerconnection method setconfiguration(), no immediate effect occurs.
RTCDTMFSender.ontonechange - Web APIs
the ontonechange property of the rtcdtmfsender interface is used to set the event handler for the tonechange event, which is sent to the rtcdtmfsender each time a tone begins or ends.
RTCDTMFSender.toneBuffer - Web APIs
settting the tone buffer to an empty string ("") cancels any pending dtmf codes.
RTCDTMFSender: tonechange event - Web APIs
this can be done using addeventlistener(): dtmfsender.addeventlistener("tonechange", ev => { let tone = ev.tone; if (tone === "") { tone = "&lt;none&gt;"; } document.getelementbyid("playingtone").innertext = tone; }, false); you can also just set the ontonechange event handler property directly: dtmfsender.ontonechange = function( ev ) { let tone = ev.tone; if (tone === "") { tone = "&lt;none&gt;" } document.getelementbyid("playingtone").innertext = tone; }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'tonechange' in that specific...
RTCDataChannel.bufferedAmount - Web APIs
closing the data channel doesn't reset this count, even though the user agent purges the queued messages.
RTCDataChannel.bufferedAmountLowThreshold - Web APIs
syntax var threshold = adatachannel.bufferedamountlowthreshold; adatachannel.bufferedamountlowthreshold = threshold; value the number of queued outgoing data bytes below which the buffer is considered to be "low." example in this snippet of code, bufferedamountlowthreshold is set to 64kb, and a handler for the bufferedamountlow event is established by setting the rtcdatachannel.onbufferedamountlow property to a function which should send more data into the buffer by calling send().
RTCDataChannel.id - Web APIs
WebAPIRTCDataChannelid
this id is set at the time the data channel is created, either by the user agent (if rtcdatachannel.negotiated is false) or by the site or app script (if negotiated is true).
RTCDataChannel.onclose - Web APIs
example in this sample from a hypothetical instant messaging client, a data channel is created, then handlers for the open and close events are set up to enable and disable user interface objects based on the state of the channel.
RTCDataChannel: open event - Web APIs
dc.addeventlistener("open", ev => { messageinputbox.disabled = false; sendmessagebutton.disabled = false; disconnectbutton.disabled = false; connectbutton.disabled = true; messageinputbox.focus(); }, false); this can also be done by directly setting the value of the channel's onopen event handler property.
RTCDataChannel.ordered - Web APIs
this is set when the rtcdatachannel is created, by setting the ordered property on the rtcdatachannelinit object passed as rtcpeerconnection.createdatachannel()'s options parameter.
RTCDataChannel.readyState - Web APIs
constant description "connecting" the user agent (browser) is in the process of creating the underlying data transport; that is, whatever network level connection is used to link the two peers together is in the process of being set up.
RTCDataChannel.stream - Web APIs
this id is set at the time the data channel is created, either by the user agent (if rtcdatachannel.negotiated is false) or by the site or app script (if negotiated is true).
RTCDataChannel - Web APIs
these labels are not required to be unique.maxpacketlifetime read only the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.maxretransmits read only the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.negotiated read only the read-only rtcdatachannel property negotiated indicates whe...
RTCDataChannelEvent - Web APIs
torrtcdatachannelevent() the rtcdatachannelevent() constructor creates a new rtcdatachannelevent.propertiesalso inherits properties from: eventchannel read only the read-only property rtcdatachannelevent.channel returns the rtcdatachannel associated with the event.methodsthis interface has no methods, but inherits methods from: event examples in this example, the datachannel event handler is set up to save the data channel reference and set up handlers for the events which need to be monitored.
RTCDtlsTransport - Web APIs
description allocation of dtls transports rtcdtlstransport objects are created when an app calls either setlocaldescription() or setremotedescription().
RTCError - Web APIs
WebAPIRTCError
all rtcerror objects have their name set to operationerror.
RTCErrorEvent.error - Web APIs
all rtcerror objects have their name set to operationerror.
RTCIceCandidate.protocol - Web APIs
the protocol property's value is set when the rtcicecandidate() constructor is used.
RTCIceCandidate.relatedPort - Web APIs
the relatedport field's value is set when the rtcicecandidate() constructor is used.
RTCIceCandidate. toJSON() - Web APIs
syntax json = rtcicecandidate.tojson(); return value an object conforming to the rtcicecandidateinit dictionary, whose members' values are set to the corresponding values in the rtcicecandidate object.
RTCIceCandidate.type - Web APIs
the type field's value is set when the rtcicecandidate() constructor is used.
RTCIceCandidateInit.sdpMLineIndex - Web APIs
value a number containing a 0-based index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available.
RTCIceCandidateInit - Web APIs
this property has no default value and is not present unless set explicitly.
RTCIceCandidatePair - Web APIs
example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair.
RTCIceCandidatePairStats.nominated - Web APIs
syntax nominated = rtcicecandidatepairstats.nominated; value a boolean value which is set to true by the ice layer if the controlling user agent has indicated that the candidate pair should be used to configure the webrtc connection between the two peers.
RTCIceCandidateStats.priority - Web APIs
during ice negotiation while setting up a webrtc peer connection, the priority values reported to the remote peer by a user agent are used to determine which candidates are considered "more desirable".
RTCIceCandidateType - Web APIs
the webrtc api's rtcicecandidatetype enumerated type provides a set of domstring values representing the types of ice candidate that can arrive.
RTCIceProtocol - Web APIs
the webrtc api's rtciceprotocol enumerated type provides a set of domstring values representing the names of the transport protocols ice candidates can use.
RTCIceTcpCandidateType - Web APIs
the webrtc api's rtcicetcpcandidatetype enumerated type provides a set of domstring values representing the types of tcp candidates.
RTCIceTransport.getLocalParameters() - Web APIs
the local peer's parameters are obtained during ice signaling and delivered to the transport when the client calls rtcpeerconnection.setlocaldescription().
RTCIceTransport.getRemoteParameters() - Web APIs
the remote peer's parameters are received during ice signaling and delivered to the transport when the client calls rtcpeerconnection.setremotedescription().
RTCIceTransport.getSelectedCandidatePair() - Web APIs
example in this example, an event handler for selectedcandidatepairchange is set up to update an on-screen display showing the protocol used by the currently selected candidate pair.
RTCIceTransport.onstatechange - Web APIs
syntax rtcicetransport.onstatechange = statechangehandler; value set this property to reference a function you provide that is called by the webrtc layer when the rtcicetransport object's state changes.
RTCIceTransport: selectedcandidatepairchange event - Web APIs
document.getelementbyid("local-protocol"); let remoteprotoelem = document.getelementbyid("remote-protocol"); icetransport.addeventlistener("selectedcandidatepairchange", ev => { let pair = icetransport.getselectedcandidatepair(); localprotoelem.innertext = pair.local.protocol.touppercase(); remoteprotoelem.innertext = pair.remote.protocol.touppercase(); }, false) this can also be done by setting the onselectedcandidatepairchange event handler property directly.
RTCInboundRtpStreamStats.bytesReceived - Web APIs
this value can be used to calculate an approximation of the average media data rate: avgdatarate = rtcinboundrtpstreamstats.bytesreceived / elapsedtime; this value gets reset to zero if the sender's ssrc identifier changes for any reason.
RTCInboundRtpStreamStats.fecPacketsReceived - Web APIs
usage notes it's possible that a subset of the fec packets which have been received were discarded instead of being used.
RTCInboundRtpStreamStats.qpSum - Web APIs
this value takes the place of the range of values, thereby reducing the number of different values that appear in the overall data set, making the data more compressible.
RTCNetworkType - Web APIs
the webrtc rtcnetworktype enumerated type defines a set of strings used to identify the type of network used by a connection between two peers.
RTCOutboundRtpStreamStats.qpSum - Web APIs
this value takes the place of the range of values, thereby reducing the number of different values that appear in the overall data set, making the data more compressible.
RTCPeerConnection.addTransceiver() - Web APIs
the rtcpeerconnection method addtransceiver() creates a new rtcrtptransceiver and adds it to the set of transceivers associated with the rtcpeerconnection.
RTCPeerConnection.localDescription - Web APIs
if it has not yet been set, this is null.
RTCPeerConnection.ondatachannel - Web APIs
syntax rtcpeerconnection.ondatachannel = function; value set this property to be a function you provide which receives as input a single parameter: an rtcdatachannelevent which provides in its channel property the rtcdatachannel which has been created.
RTCPeerConnection.onicecandidateerror - Web APIs
syntax rtcpeerconnection.onicecandidateerror = eventhandler; value this should be set to a function you provide which is passed a single parameter: an rtcpeerconnectioniceerrorevent object describing the icecandidateerror event.
RTCPeerConnection.oniceconnectionstatechange - Web APIs
syntax rtcpeerconnection.oniceconnectionstatechange = eventhandler; value this event handler can be set to function which is passed a single input parameter: an event object describing the iceconnectionstatechange event which occurred.
RTCPeerConnection: peeridentity event - Web APIs
the peeridentity event is sent to the connection concerned when peer identity has been set and verified on it.
RTCPeerConnection: removestream event - Web APIs
you can use the rtcpeerconnection interface's onremovestream property to set a handler for this event.
RTCPeerConnection: signalingstatechange event - Web APIs
bubbles no cancelable no interface event event handler property rtcpeerconnection.onsignalingstatechange examples given an rtcpeerconnection, pc, and an updatestatus() function that presents status information to the user, this code sets up an event handler to let the user know when the ice negotiation process finishes up.
RTCPeerConnectionIceErrorEvent - Web APIs
if no host candidate can reach the server, this property is set to the number 701, which is outside the range of valid stun error codes.
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
syntax let localid = rtcremoteoutboundrtpstreamstats.localid; value a domstring which can be compared to the value of an rtcinboundrtpstreamstats object's remoteid property to see if the two represent statistics for each of the two sides of the same set of data received by the local peer.
RTCRtpCapabilities - Web APIs
if two sets of capabilities can be described as one, they will be.
RTCRtpCodecParameters - Web APIs
in addition to being the type of the rtcrtpparameters.codecs property, it's used when calling rtcrtptransceiver.setcodecpreferences() to configure a transceiver's codecs before beginning the offer/answer process to establish a webrtc peer connection.
RTCRtpEncodingParameters.maxBitrate - Web APIs
other parameters may further reduce the bandwidth used by the track; for example, maxframerate will, if set low enough, constrain the bandwidth as well.
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
therefore, specifying a value less than 1.0 is not permitted and will cause a rangeerror exception to be thrown by rtcpeerconnection.addtransceiver() or rtcrtpsender.setparameters().
RTCRtpSender.getParameters() - Web APIs
examples this example gets the sender's current transaction id; the transaction id uniquely identifies the current set of parameters, to ensure that calls to setparameters() are always handled in the correct order, avoiding inadvertently overwriting parameters with older parameters.
RTCRtpStreamStats.qpSum - Web APIs
this value takes the place of the range of values, thereby reducing the number of different values that appear in the overall data set, making the data more compressible.
RTCRtpStreamStats - Web APIs
while the dictionary has a base set of properties that are present in each of these cases, there are also additional properties added depending on which interface the method is called on.
RTCRtpTransceiver.stop() - Web APIs
the negotiation process causes currentnegotiation to be set to stopped, finally indicating that the transceiver has been fully stopped.
RTCSessionDescription.sdp - Web APIs
sessiondescription.sdp = value; value the value is a domstring containing an sdp message like this one: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 example // the remote description has been set previously on pc, an rtcpeerconnection alert(pc.remotedescription.sdp); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.sdp' in that specification.
RTCSessionDescription.type - Web APIs
example // the remote description has been set previously on pc, a rtcpeerconnection alert(pc.remotedescription.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.type' in that specification.
RTCSessionDescription - Web APIs
example signalingchannel.onmessage = function (evt) { if (!pc) start(false); var message = json.parse(evt.data); if (message.sdp) pc.setremotedescription(new rtcsessiondescription(message), function () { // if we received an offer, we need to answer if (pc.remotedescription.type == "offer") pc.createanswer(localdesccreated, logerror); }, logerror); else pc.addicecandidate(new rtcicecandidate(message.candidate), function () {}, logerror); }; specifications ...
RTCSessionDescriptionCallback - Web APIs
example var pc = new rtcpeerconnection(); var descriptioncallback = function(offer) { pc.setlocaldescription(offer); } pc.createoffer(descriptioncallback); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescriptioncallback' in that specification.
RTCStatsIceCandidatePairState - Web APIs
the rtcstatsicecandidatepairstate enumerated type represents the set of string values which are possible for the rtcicecandidatepairstats object's state property.
RTCStatsType - Web APIs
the rtcstatstype enumerated type (enum) is a set of strings which define the type of statistics reported in a record found in the rtcstatsreport object.
RTCTrackEvent - Web APIs
example this simple example creates an event listener for the track event which sets the srcobject of the <video> element with the id videobox to the first stream in the list passed in the event's streams array.
RadioNodeList.value - Web APIs
on setting the value property, the first radio button input element whose value property is equal to the new value will be set to checked.
Range.collapsed - Web APIs
WebAPIRangecollapsed
syntax iscollapsed = range.collapsed; example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); iscollapsed = range.collapsed; specifications specification status comment domthe definition of 'range.collapsed' in that specification.
Range.createContextualFragment() - Web APIs
the html fragment parsing algorithm is used if the range belongs to a document whose htmlness bit is set.
Range.getBoundingClientRect() - Web APIs
the bounding client rectangle contains everything selected in the range.</p> css #highlight { background: yellow; position: absolute; z-index: -1; } p { width: 200px; } javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); const clientrect = range.getboundingclientrect(); const highlight = document.getelementbyid('highlight'); highlight.style.left = `${clientrect.x}px`; highlight.style.top = `${clientrect.y}px`; highlight.style.width = `${clientrect.width}px`; highlight.style.height = `${cli...
Range.selectNode() - Web APIs
WebAPIRangeselectNode
the range.selectnode() method sets the range to contain the node and its contents.
Range.toString() - Web APIs
WebAPIRangetoString
look at the output below.</p> <p id="log"></p> javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); document.getelementbyid('log').textcontent = range.tostring(); result specifications specification status comment domthe definition of 'range.tostring()' in that specification.
ReadableStreamDefaultController.close() - Web APIs
const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); ...
ReadableStreamDefaultController.enqueue() - Web APIs
const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); ...
ReadableStreamDefaultController - Web APIs
const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); ...
RelativeOrientationSensor.RelativeOrientationSensor() - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
RelativeOrientationSensor - Web APIs
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
Report - Web APIs
WebAPIReport
observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
ReportingObserver() - Web APIs
options optional an reportingobserveroptions object allowing you to set the options for creating the object.
ReportingObserver - Web APIs
tructor: observer.observe(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
ReportingObserverOptions - Web APIs
the reportingobserveroptions dictionary of the reporting api allows options to be set in the constructor when creating a reportingobserver.
Request() - Web APIs
WebAPIRequestRequest
init optional an options object containing any custom settings that you want to apply to the request.
Request.destination - Web APIs
the destination is used by the user agent to, for example, help determine which set of rules to follow for cors purposes, or how to navigate any complicated code paths that affect how specific types of request get handled.
Request.referrer - Web APIs
WebAPIRequestreferrer
the referrer read-only property of the request interface is set by the user agent to be the referrer of the request.
Resize Observer API - Web APIs
a callback function set up inside the constructor then runs every time the size changes, providing access to the new dimensions and allowing you to do anything you like in response to those changes.
Resource Timing API - Web APIs
the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the specified number of resource performance entries.
Response() - Web APIs
WebAPIResponseResponse
this can be null (which is the default value), or one of: blob buffersource formdata readablestream urlsearchparams usvstring init optional an options object containing any custom settings that you want to apply to the response, or an empty object (which is the default value).
Response.error() - Web APIs
WebAPIResponseerror
an error response has its type set to error.
Response.redirected - Web APIs
d) { elem.innerhtml = "unexpected redirect"; } else { elem.innerhtml = ""; } return response.blob(); }).then(function(imageblob) { let imgobjecturl = url.createobjecturl(imageblob); document.getelementbyid("img-element-id").src = imgobjecturl; }); disallowing redirects because using redirected to manually filter out redirects can allow forgery of redirects, you should instead set the redirect mode to "error" in the init parameter when calling fetch(), like this: fetch("awesome-picture.jpg", { redirect: "error" }).then(function(response) { return response.blob(); }).then(function(imageblob) { let imgobjecturl = url.createobjecturl(imageblob); document.getelementbyid("img-element-id").src = imgobjecturl; }); specifications specification status commen...
Response.useFinalURL - Web APIs
example consider a script residing in page index.html: fetch('/test').then((r) => console.log(r.url)) test.html is being controlled by the service worker sw.js: onfetch = (e) => { e.respondwith(fetch('/page2').then((r) => { r.usefinalurl = true; return r; }) } the output will be /page2 and not /test in index.html, since setting the usefinalurl means that the response's url is not set to request's url.
RsaHashedImportParams - Web APIs
this should be set to rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep, depending on the algorithm you want to use.
RsaHashedKeyGenParams - Web APIs
this should be set to rsassa-pkcs1-v1_5, rsa-pss, or rsa-oaep, depending on the algorithm you want to use.
RsaOaepParams - Web APIs
this should be set to rsa-oaep.
RsaPssParams - Web APIs
this should be set to rsa-pss.
SVGAElement - Web APIs
example in the example below, the target attribute of the <a> element is set to _blank and when the link is clicked, it logs to notify whether the condition is met or not.
SVGAltGlyphElement - Web APIs
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.
SVGAnimatedString - Web APIs
setter throws domexception.
SVGAnimationElement: endEvent event - Web APIs
xtcontent = 'endevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) btn.addeventlistener('click', () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler property equivalent note that you can also create an event listener for the end event using the onend event handler property: animateelem.onend = () => { console.log('endevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the definition of 'endevent' in that specification.
cx - Web APIs
if unspecified, the effect is as if the value is set to 0.
cy - Web APIs
if unspecified, the effect is as if the value is set to 0.
r - Web APIs
if unspecified, the effect is as if the value is set to 0.
SVGCircleElement - Web APIs
10 : -10; // clamp the circle radius to a minimum of 10 and a maximum of 250, // so it won't disappear or get bigger than the viewport var newvalue = math.min(math.max(circle.r.baseval.value + change, 10), 250); circle.setattribute("r", newvalue); } click on the circle.
SVGComponentTransferFunctionElement - Web APIs
svgcomponenttransferfunctionelement.offset read only an svganimatednumber corresponding to the offset attribute of the given element.
SVGFEDropShadowElement - Web APIs
svgfedropshadowelement.setstddeviation() sets the values for the stddeviation attribute.
SVGFEGaussianBlurElement - Web APIs
svgfegaussianblurelement.setstddeviation() sets the values for the stddeviation attribute.
SVGFilterPrimitiveStandardAttributes - Web APIs
the svgfilterprimitivestandardattributes interface defines the set of dom attributes that are common across the filter primitive interfaces.
SVGGraphicsElement: cut event - Web APIs
a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the default action using event.preventdefault().
SVGGraphicsElement: paste event - Web APIs
bubbles yes cancelable yes interface clipboardevent event handler property onpaste if the cursor is in an editable context (for example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position.
SVGPoint - Web APIs
WebAPISVGPoint
example // create an svgpoint in the user coordinate system let s = document.getelementbyid("svg-elementid").createsvgpoint(); // then, set the x and y values of the returned svgpoint object // (which is the variable `s`) s.y = 10; s.x = 10; ...
SVGStopElement - Web APIs
svgstopelement.offset read only an svganimatednumber corresponding to the offset of the given element.
SVGTextPathElement - Web APIs
svgtextpathelement.startoffset read only an svganimatedlength corresponding to the x component of the startoffset attribute of the given element.
SVGTransformList - Web APIs
data[ function transformme(evt) { // svg root element to access the createsvgtransform() function var svgroot = evt.target.parentnode; // svgtransformlist of the element that has been clicked on var tfmlist = evt.target.transform.baseval; // create a seperate transform object for each transform var translate = svgroot.createsvgtransform(); translate.settranslate(50,5); var rotate = svgroot.createsvgtransform(); rotate.setrotate(10,0,0); var scale = svgroot.createsvgtransform(); scale.setscale(0.8,0.8); // apply the transformations by appending the svgtranform objects to the svgtransformlist associated with the element tfmlist.appenditem(translate); tfmlist.appenditem(rotate); tfmlist.appenditem(...
SVGUnitTypes - Web APIs
the svgunittypes interface defines a commonly used set of constants used for reflecting gradientunits, patterncontentunits and other similar attributes.
Screen.availTop - Web APIs
WebAPIScreenavailTop
syntax let availtop = window.screen.availtop; example let setx = window.screen.width - window.screen.availleft; let sety = window.screen.height - window.screen.availtop; window.moveto(setx, sety); notes in most cases, this property returns 0.
Screen.mozEnabled - Web APIs
WebAPIScreenmozEnabled
setting it to false will turn off the screen.
Screen.unlockOrientation() - Web APIs
the screen.unlockorientation() method removes all the previous screen locks set by the page/app.
Screen Wake Lock API - Web APIs
a request may be rejected for a number of reasons, including system settings (such as power save mode or low battery level) or if the document is not active or visible.
ScriptProcessorNode: audioprocess event - Web APIs
nnel); var outputdata = outputbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } }) you could also set up the event handler using the scriptprocessornode.onaudioprocess property: scriptnode.onaudioprocess = function(audioprocessingevent) { ...
Selection.rangeCount - Web APIs
html <table> <tr><td>a.1<td>a.2 <tr><td>b.1<td>b.2 <tr><td>c.1<td>c.2 javascript window.setinterval(function () { console.log(window.getselection().rangecount); }, 1000); result open your console to see how many ranges are in the selection.
Sensor - Web APIs
WebAPISensor
if a feature policy blocks use of a feature it is because your code is inconsistent with the policies set on your server.
ServiceWorker - Web APIs
a serviceworker object is available in the serviceworkerregistration.active property, and the serviceworkercontainer.controller property — this is a service worker that has been activated and is controlling the page (the service worker has been successfully registered, and the controlled page has been reloaded.) the serviceworker interface is dispatched a set of lifecycle events — install and activate — and functional events including fetch.
ServiceWorkerContainer.startMessages() - Web APIs
note: the messages start being sent automatically when setting the handler directly using serviceworkercontainer.onmessage.
ServiceWorkerGlobalScope: activate event - Web APIs
globalscope.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); you can also set up the event handler using the serviceworkerglobalscope.onactivate property: globalscope.onactivate = function(event) { ...
ServiceWorkerGlobalScope: contentdelete event - Web APIs
self.addeventlistener('contentdelete', event => { event.waituntil( caches.open('cache-name').then(cache => { return promise.all([ cache.delete(`/icon/${event.id}`), cache.delete(`/content/${event.id}`) ]) }) ); }); you can also set up the event handler using the serviceworkerglobalscope.ondelete property: self.oncontentdelete = (event) => { ...
ServiceWorkerGlobalScope.onfetch - Web APIs
it will return a normal response object that has the appropriate error code set.
ServiceWorkerGlobalScope.oninstall - Web APIs
}; examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the service worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunt...
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
this might happen if, for example, the push service sets an expiration time a subscription.
ServiceWorkerGlobalScope: push event - Web APIs
bubbles no cancelable no interface pushevent event handler property onpush example this example sets up a handler for push events that takes json data, parses it, and dispatches the message for handling based on information contained within the message.
ServiceWorkerGlobalScope: pushsubscriptionchange event - Web APIs
you can also use the onpushsubscriptionchange event handler property to set up the event handler: self.onpushsubscriptionchange = event => { event.waituntil(swregistration.pushmanager.subscribe(event.oldsubscription.options) .then(subscription => { /* ...
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
origin: a domstring that defines the origin of the corresponding service worker's environment settings object.
ServiceWorkerRegistration.installing - Web APIs
this property is initially set to null.
ServiceWorkerRegistration.showNotification() - Web APIs
silent: when set indicates that no sounds or vibrations should be made.
ServiceWorkerRegistration.waiting - Web APIs
this property is initially set to null.
ShadowRoot.delegatesFocus - Web APIs
the delegatesfocus read-only property of the shadowroot interface returns a boolean that indicates whether delegatesfocus was set when the shadow was attached (see element.attachshadow()).
ShadowRoot.innerHTML - Web APIs
the innerhtml property of the shadowroot interface sets or returns a reference to the dom tree inside the shadowroot.
SharedWorker() - Web APIs
options optional an object containing option properties that can set when creating the object instance.
SharedWorker - Web APIs
otherwise called implicitly by onmessage setter.
SharedWorkerGlobalScope: connect event - Web APIs
self.onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) addeventlistener equivalent you could also set up an event handler using the addeventlistener() method: self.addeventlistener('connect', function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } }); specifications specification status html living standardthe definition of 'connect event' in that spec...
SourceBuffer.changeType() - Web APIs
the changetype() method of the sourcebuffer interface sets the mime type that future calls to appendbuffer() should expect the new media data to conform to.
SourceBuffer.trackDefaults - Web APIs
exceptions the following exceptions may be thrown when setting a new value for this property.
SpeechGrammarList.SpeechGrammarList() - Web APIs
examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammarlist, add our grammar string to it using the speechgrammarlist.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property.
SpeechGrammarList - Web APIs
examples in our simple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammarlist, add our grammar string to it using the speechgrammarlist.addfromstring method, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property.
SpeechRecognition.grammars - Web APIs
the grammars property of the speechrecognition interface returns and sets a collection of speechgrammar objects that represent the grammars that will be understood by the current speechrecognition.
SpeechRecognition.maxAlternatives - Web APIs
the maxalternatives property of the speechrecognition interface sets the maximum number of speechrecognitionalternatives provided per speechrecognitionresult.
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.
SpeechSynthesis.getVoices() - Web APIs
ipt function populatevoicelist() { if(typeof speechsynthesis === 'undefined') { return; } var voices = speechsynthesis.getvoices(); for(var i = 0; i < voices.length; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); document.getelementbyid("voiceselect").appendchild(option); } } populatevoicelist(); if (typeof speechsynthesis !== 'undefined' && speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } html <select id="voiceselect"></select> specifications ...
SpeechSynthesis.onvoiceschanged - Web APIs
var voices = []; function populatevoicelist() { voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } specifications specification status comment web speech apithe definition of 'onvoiceschanged' in that spe...
SpeechSynthesis.paused - Web APIs
it can be set to paused even if nothing is currently being spoken through it.
SpeechSynthesisUtterance.text - Web APIs
the text property of the speechsynthesisutterance interface gets and sets the text that will be synthesised when the utterance is spoken.
SpeechSynthesisVoice.default - Web APIs
examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'default' in that specification.
SpeechSynthesisVoice.lang - Web APIs
examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'lang' in that specification.
SpeechSynthesisVoice.localService - Web APIs
examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } console.log(voices[i].localservice); option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'localservice' in that specification.
SpeechSynthesisVoice.name - Web APIs
examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'name' in that specification.
SpeechSynthesisVoice.voiceURI - Web APIs
examples for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } console.log(voices[i].voiceuri); // on mac, this returns urns, for example 'urn:moz-tts:osx:com.apple.speech.synthesis.voice.daniel' option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } specifications specification status comment web speech apithe definition of 'voiceuri' in that specification.
SpeechSynthesisVoice - Web APIs
function populatevoicelist() { voices = synth.getvoices(); for(i = 0; i < voices.length ; i++) { var option = document.createelement('option'); option.textcontent = voices[i].name + ' (' + voices[i].lang + ')'; if(voices[i].default) { option.textcontent += ' -- default'; } option.setattribute('data-lang', voices[i].lang); option.setattribute('data-name', voices[i].name); voiceselect.appendchild(option); } } populatevoicelist(); if (speechsynthesis.onvoiceschanged !== undefined) { speechsynthesis.onvoiceschanged = populatevoicelist; } inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); ...
StereoPannerNode.pan - Web APIs
-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.oninput = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and the pannode to the destination, so we can play the // music and adjust the panning using the controls source.connect(pannode); pannode.connect(audioctx.destination); specifications specification status comment we...
StereoPannerNode - Web APIs
-value'); pre.innerhtml = myscript.innerhtml; // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a stereo panner var pannode = audioctx.createstereopanner(); // event handler function to increase panning to the right and left // when the slider is moved pancontrol.oninput = function() { pannode.pan.setvalueattime(pancontrol.value, audioctx.currenttime); panvalue.innerhtml = pancontrol.value; } // connect the mediaelementaudiosourcenode to the pannode // and the pannode to the destination, so we can play the // music and adjust the panning using the controls source.connect(pannode); pannode.connect(audioctx.destination); specifications specification status comment we...
Storage.clear() - Web APIs
WebAPIStorageclear
function populatestorage() { localstorage.setitem('bgcolor', 'red'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'migato.png'); localstorage.clear(); } note: for a real world example, see our web storage demo.
Storage.key() - Web APIs
WebAPIStoragekey
examples the following function iterates over the local storage keys: function foreachkey(callback) { for (var i = 0; i < localstorage.length; i++) { callback(localstorage.key(i)); } } the following function iterates over the local storage keys and gets the value set for each key: for(var i =0; i < localstorage.length; i++){ console.log(localstorage.getitem(localstorage.key(i))); } note: for a real world example, see our web storage demo.
Storage.length - Web APIs
WebAPIStoragelength
example the following function adds three data items to the local storage for the current domain, then returns the number of items in the storage: function populatestorage() { localstorage.setitem('bgcolor', 'yellow'); localstorage.setitem('font', 'helvetica'); localstorage.setitem('image', 'cats.png'); return localstorage.length; // should return 3 } note: for a real world example, see our web storage demo.
Storage API - Web APIs
the "persistent-storage" feature's permission-related flags, algorithms, and types are all set to the standard defaults for a permission, except that the permission state must be the same across the entire origin, and that if the permission state isn't "granted" (meaning that for whatever reason, access to the persistent storage feature was denied), the origin's site storage unit's box mode is always "best-effort".
Streams API concepts - Web APIs
the streams api adds a very useful set of tools to the web platform, providing objects allowing javascript to programmatically access streams of data received over the network and process them as desired by the developer.
Using writable streams - Web APIs
inside this method, you should include code that sets up the stream functionality, e.g.
Streams API - Web APIs
this is something browsers do anyway when receiving assets to be shown on webpages — videos buffer and more is gradually available to play, and sometimes you'll see images display gradually as more is loaded.
StylePropertyMap - Web APIs
stylepropertymap.set() changes the css declaration with the given property.
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.
SubmitEvent() - Web APIs
next, a new submitevent is created, configured with its submitter set to the identified button (or null if the button wasn't found).
SubmitEvent.submitter - Web APIs
examples in this example, a shopping cart may have an assortment of different submit buttons depending on factors such as the user's settings, the shop's settings, and any minimum or maximum shopping card totals established by the payment processors.
SubmitEvent - Web APIs
examples in this example, a shopping cart may have an assortment of different submit buttons depending on factors such as the user's settings, the shop's settings, and any minimum or maximum shopping card totals established by the payment processors.
SubtleCrypto.deriveKey() - Web APIs
note that the key usages must be allowed by the algorithm set in derivedkeyalgorithm.
SubtleCrypto.importKey() - Web APIs
der is a set of rules for encoding asn.1 structures into a binary form.
SyncEvent.SyncEvent() - Web APIs
init optional an options object containing any custom settings that you want to apply to the event object.
SyncManager.register() - Web APIs
parameters options optional an object that sets options for an instance of syncregistration.
Text.wholeText - Web APIs
WebAPITextwholeText
so you try this: para.firstchild.data = "thru-hiking is great, but "; all set, right?
Text - Web APIs
WebAPIText
text.splittext breaks the node into two nodes at a specified offset.
TextDecoder.prototype.decode() - Web APIs
set to true if processing the data in chunks, and false for the final chunk or if the data is not chunked.
TextEncoder.prototype.encodeInto() - Web APIs
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); }; } })(typeof global == "" + void 0 ?
TextTrack: cuechange event - Web APIs
bubbles no cancelable no interface event event handler property globaleventhandlers.oncuechange examples on the texttrack you can set up a listener for the cuechange event on a texttrack using the addeventlistener() method: track.addeventlistener('cuechange', function () { let cues = track.activecues; // array of current cues }); or you can just set the oncuechange event handler property: track.oncuechange = function () { let cues = track.activecues; // array of current cues } on the track element the underlying texttrack, indicated ...
TextTrack - Web APIs
WebAPITextTrack
texttrack.activecues read only a texttrackcuelist object listing the currently active set of text track cues.
TextTrackList.onaddtrack - Web APIs
syntax texttracklist.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been added to the media.
TextTrackList.onremovetrack - Web APIs
syntax texttracklist.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as input a trackevent object which indicates in its track property which text track has been removed from the media element.
TimeRanges.end() - Web APIs
WebAPITimeRangesend
returns the time offset at which a specified time range ends.
TimeRanges.start() - Web APIs
WebAPITimeRangesstart
returns the time offset at which a specified time range begins.
TouchEvent.changedTouches - Web APIs
for the touchend event, it is a list of the touch points that have been removed from the surface (that is, the set of touch points corresponding to fingers no longer touching the surface).
TouchEvent.targetTouches - Web APIs
as such, the targettouches list is a strict subset of the touches list.
TouchEvent - Web APIs
to override this behavior, you need to set the passive option to false, after which calling preventdefault() will work as specified.
TouchList.item() - Web APIs
WebAPITouchListitem
target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment touch events – level 2 draft non-stable version.
TouchList.length - Web APIs
WebAPITouchListlength
target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment touch events – level 2 draft non-stable version.
TrackDefault - Web APIs
a trackdefault object is provided to a sourcebuffer object by setting its sourcebuffer.trackdefaults property.
TrackEvent() - Web APIs
eventinfo optional an optional dictionary providing additional information configuring the new event; it can contain the following fields in any combination: track optional the track to which the event refers; this is null by default, but should be set to a videotrack, audiotrack, or texttrack as appropriate given the type of track.
TransitionEvent - Web APIs
transitionrun an event fired when a css transition is created, when it is added to a set of running transitions, though not nessarilty started transitionstart an event fired when a css transition has started transitioning.
URL.createObjectURL() - Web APIs
important: if you still have code that relies on createobjecturl() to attach streams to media elements, you need to update your code to simply set srcobject to the mediastream directly.
URL.password - Web APIs
WebAPIURLpassword
if it is set without first setting the username property, it silently fails.
URL.port - Web APIs
WebAPIURLport
if the url does not contain an explicit port number, it will be set to ''.
URL - Web APIs
WebAPIURL
usage notes the constructor takes a url parameter, and an optional base parameter to use as a base if the url parameter is a relative url: const url = new url('../cats', 'http://www.example.com/dogs'); console.log(url.hostname); // "www.example.com" console.log(url.pathname); // "/cats" url properties can be set to construct the url: url.hash = 'tabby'; console.log(url.href); // "http://www.example.com/cats#tabby" urls are encoded according to the rules found in rfc 3986.
URLSearchParams.toString() - Web APIs
(returns an empty string if no search parameters have been set.) examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a second foo parameter.
USBDevice.controlTransferIn() - Web APIs
syntax var promise = usbdevice.controltransferin(setup, length) parameters setup an object that sets options for .
USBDevice.controlTransferOut() - Web APIs
syntax var promise = usbdevice.controltransferout(setup, data) parameters setup an object that sets options for .
USBDevice - Web APIs
WebAPIUSBDevice
usbdevice.reset() returns a promise that resolves when the device is reset and all app operations canceled and their promises rejected.
USBInterface - Web APIs
by default this is the usbalternateinterface from alternates with alternatesetting equal to 0.
USVString - Web APIs
WebAPIUSVString
usvstring corresponds to the set of all possible sequences of unicode scalar values.
UserDataHandler - Web APIs
summary when associating user data with a key on a node, node.setuserdata() can also accept, in its third argument, a handler which will be called when the object is cloned, imported, deleted, renamed, or adopted.
Using the User Timing API - Web APIs
mark events are named by the application and can be set at any location in an application.
validityState.tooShort - Web APIs
the read-only tooshort property of a validitystate object indicates if the value of an <input>, <button>, <select>, <output>, <fieldset> or <textarea>, after having been edited by the user, is less than the minimum code-unit length established by the element's minlength attribute.
ValidityState - Web APIs
customerror read only a boolean indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setcustomvalidity() method.
VideoPlaybackQuality.totalVideoFrames - Web APIs
this value is reset when the media is reloaded or replaced.
VideoTrack.selected - Web APIs
only a single video track can be active at any given time, so setting this property to true for one track while another track is active will make that other track inactive.
VideoTrack - Web APIs
only a single video track can be active at any given time, so setting this property to true for one track while another track is active will make that other track inactive.
VideoTrackList.onaddtrack - Web APIs
syntax videotracklist.onaddtrack = eventhandler; value set onaddtrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been added to the media.
VideoTrackList.onchange - Web APIs
syntax videotracklist.onchange = eventhandler; value set onchange to a function that should be called whenever a track is made active.
VideoTrackList.onremovetrack - Web APIs
syntax videotracklist.onremovetrack = eventhandler; value set onremovetrack to a function that accepts as input a trackevent object which indicates in its track property which video track has been removed from the media element.
WEBGL_compressed_texture_astc - Web APIs
for more information, see the article using astc texture compression for game assets by nvidia.
WEBGL_debug_shaders - Web APIs
availability: depending on the privacy settings of the browser, this extension might only be available to privileged contexts.
WebGL2RenderingContext.clearBuffer[fiuv]() - Web APIs
syntax void gl.clearbufferfv(buffer, drawbuffer, values, optional srcoffset); void gl.clearbufferiv(buffer, drawbuffer, values, optional srcoffset); void gl.clearbufferuiv(buffer, drawbuffer, values, optional srcoffset); void gl.clearbufferfi(buffer, drawbuffer, depth, stencil); parameters buffer a glenum specifying the buffer to clear.
WebGL2RenderingContext.createVertexArray() - Web APIs
the webgl2renderingcontext.createvertexarray() method of the webgl 2 api creates and initializes a webglvertexarrayobject object that represents a vertex array object (vao) pointing to vertex array data and which provides names for different sets of vertex data.
WebGL2RenderingContext.drawBuffers() - Web APIs
the draw buffer settings are part of the state of the currently bound framebuffer or the drawingbuffer if no framebuffer is bound.
WebGL2RenderingContext.fenceSync() - Web APIs
syntax webglsync gl.fencesync(condition, flags); parameters condition a glenum specifying the condition that must be met to set the sync object's state to signaled.
WebGL2RenderingContext.resumeTransformFeedback() - Web APIs
examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.pausetransformfeedback(); //...
WebGLRenderingContext.colorMask() - Web APIs
the webglrenderingcontext.colormask() method of the webgl api sets which color components to enable or to disable when drawing or rendering to a webglframebuffer.
WebGLRenderingContext.depthFunc() - Web APIs
syntax void gl.depthfunc(func); parameters func a glenum specifying the depth comparison function, which sets the conditions under which the pixel will be drawn.
WebGLRenderingContext.depthMask() - Web APIs
the webglrenderingcontext.depthmask() method of the webgl api sets whether writing into the depth buffer is enabled or disabled.
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
this code sets the buffer of vertexes that will be used to draw the triangles of the shape by calling bindbuffer().
WebGLRenderingContext.frontFace() - Web APIs
the webglrenderingcontext.frontface() method of the webgl api specifies whether polygons are front- or back-facing by setting a winding orientation.
WebGLRenderingContext.generateMipmap() - Web APIs
the webglrenderingcontext.generatemipmap() method of the webgl api generates a set of mipmaps for a webgltexture object.
WebGLRenderingContext.getContextAttributes() - Web APIs
examples given this <canvas> element <canvas id="canvas"></canvas> and given this webgl context var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getcontextattributes(); the getcontextattributes method returns an object that describes the attributes set on this context, for example: { alpha: true, antialias: true, depth: true, failifmajorperformancecaveat: false, powerpreference: "default", premultipliedalpha: true, preservedrawingbuffer: false, stencil: false, desynchronized: false } the context attributes can be set when creating the context using the htmlcanvaselement.getcontext() method: canvas.getcontext('webgl', ...
WebGLRenderingContext.isContextLost() - Web APIs
another page running in the user's browser performs an operation using the gpu that takes too long, causing hte browser to decide to reset the gpu in order to break the stall.
WebGLRenderingContext.stencilFunc() - Web APIs
the webglrenderingcontext.stencilfunc() method of the webgl api sets the front and back function and reference value for stencil testing.
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
the webglrenderingcontext.stencilfuncseparate() method of the webgl api sets the front and/or back function and reference value for stencil testing.
WebGLRenderingContext.stencilMask() - Web APIs
the webglrenderingcontext.stencilmaskseparate() method can set front and back stencil writemasks to different values.
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
the webglrenderingcontext.stencilmask() method can set both, the front and back stencil writemasks to one value at the same time.
WebGLRenderingContext.useProgram() - Web APIs
the webglrenderingcontext.useprogram() method of the webgl api sets the specified webglprogram as part of the current rendering state.
WebGLTransformFeedback - Web APIs
eedback objects, the following methods of the webgl2renderingcontext are useful: webgl2renderingcontext.createtransformfeedback() webgl2renderingcontext.deletetransformfeedback() webgl2renderingcontext.istransformfeedback() webgl2renderingcontext.bindtransformfeedback() webgl2renderingcontext.begintransformfeedback() webgl2renderingcontext.endtransformfeedback() webgl2renderingcontext.pausetransformfeedback() webgl2renderingcontext.resumetransformfeedback() webgl2renderingcontext.transformfeedbackvaryings() webgl2renderingcontext.gettransformfeedbackvarying() examples creating a webgltransformfeedback object in this example, gl must be a webgl2renderingcontext.
WebGLVertexArrayObject - Web APIs
the webglvertexarrayobject interface is part of the webgl 2 api, represents vertex array objects (vaos) pointing to vertex array data, and provides names for different sets of vertex data.
Boilerplate 1 - Web APIs
boilerplate code for setting up webgl rendering context by now you are quite used to seeing the same pieces of html, css, and javascript repeated again and again.
Detect WebGL - Web APIs
the webgl rendering context is an interface, through which you can set and query the state of the graphics machine, send data to the webgl, and execute draw commands.
Hello GLSL - Web APIs
n : auto; padding : 0.6em; } <script type="x-shader/x-vertex" id="vertex-shader"> #version 100 void main() { gl_position = vec4(0.0, 0.0, 0.0, 1.0); gl_pointsize = 64.0; } </script> <script type="x-shader/x-fragment" id="fragment-shader"> #version 100 void main() { gl_fragcolor = vec4(0.18, 0.54, 0.34, 1.0); } </script> ;(function(){ "use strict" window.addeventlistener("load", setupwebgl, false); var gl, program; function setupwebgl (evt) { window.removeeventlistener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = document.queryselec...
Textures from code - Web APIs
ype="x-shader/x-fragment" id="fragment-shader"> #version 100 precision mediump float; void main() { vec2 fragmentposition = 2.0*gl_pointcoord - 1.0; float distance = length(fragmentposition); float distancesqrd = distance * distance; gl_fragcolor = vec4( 0.2/distancesqrd, 0.1/distancesqrd, 0.0, 1.0 ); } </script> ;(function(){ "use strict" window.addeventlistener("load", setupwebgl, false); var gl, program; function setupwebgl (evt) { window.removeeventlistener(evt.type, setupwebgl, false); if (!(gl = getrenderingcontext())) return; var source = document.queryselector("#vertex-shader").innerhtml; var vertexshader = gl.createshader(gl.vertex_shader); gl.shadersource(vertexshader,source); gl.compileshader(vertexshader); source = document.queryselec...
WebGL by example - Web APIs
canvas size and webgl the example explores the effect of setting (or not setting) the canvas size to its element size in css pixels, as it appears in the browser window.
Compressed texture formats - Web APIs
, texture); // create texture object on gpu const ext = gl.getextension('webgl_compressed_texture_s3tc'); // will be null if not supported if (ext) { // the file is already in the correct compressed format const dataarraybuffer = await fetch('/textures/foobar512x512.rgba_s3tc_dxt1') .then(response => response.arraybuffer()); gl.compressedteximage2d(gl.texture_2d, 0, // set the base image level ext.compressed_rgba_s3tc_dxt1_ext, // the compressed format we are using 512, 512, // width, height of the image 0, // border, always 0 new dataview(dataarraybuffer)); gl.generatemipmap(); // create mipmap levels, like we would for a standard image return texture; } } ...
Data in WebGL - Web APIs
WebAPIWebGL APIData
<<how to use>> uniforms uniforms are set by the javascript code and are available to both the vertex and fragment shaders.
WebGL tutorial - Web APIs
in this tutorial getting started with webgl how to set up a webgl context.
High-level guides - Web APIs
webrtc (web real-time communications) is a broad, multi-component system for setting up and operating complex audio, video, and data channels across networks among two or more peers on the web.
Writing WebSocket client applications - Web APIs
ext user list updates the code that interprets these incoming messages might look like this: examplesocket.onmessage = function(event) { var f = document.getelementbyid("chatbox").contentdocument; var text = ""; var msg = json.parse(event.data); var time = new date(msg.date); var timestr = time.tolocaletimestring(); switch(msg.type) { case "id": clientid = msg.id; setusername(); break; case "username": text = "<b>user <em>" + msg.name + "</em> signed in at " + timestr + "</b><br>"; break; case "message": text = "(" + timestr + ") <b>" + msg.name + "</b>: " + msg.text + "<br>"; break; case "rejectusername": text = "<b>your username has been set to <em>" + msg.name + "</em> because the name you chose is in use.</b>...
Writing a WebSocket server in Java - Web APIs
outputstream methods: write(byte[] b, int off, int len) writes len bytes from the specified byte array starting at offset off to this output stream.
Web Animations API - Web APIs
keyframeeffect describes sets of animatable properties and values, called keyframes and their timing options.
Web Locks API - Web APIs
it takes a lock name, an optional set of options, and a callback.
Web Speech API - Web APIs
the speechgrammar interface represents a container for a particular set of grammar that your app should recognise.
Web Workers API - Web APIs
they are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
Window: beforeunload event - Web APIs
event.preventdefault(); // chrome requires returnvalue to be set.
Window.captureEvents() - Web APIs
syntax window.captureevents(eventtype) eventtype is a combination of the following values: event.abort, event.blur, event.click, event.change, event.dblclick, event.dragddrop, event.error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload.
Window.focus() - Web APIs
WebAPIWindowfocus
it may fail due to user settings and the window isn't guaranteed to be frontmost before this method returns.
Window.innerHeight - Web APIs
example assuming a frameset var intframeheight = window.innerheight; // or var intframeheight = self.innerheight; // will return the height of the frame viewport within the frameset var intframesetheight = parent.innerheight; // will return the height of the viewport of the closest frameset var intouterframesetheight = top.innerheight; // will return the height of the viewport of the outermost frameset fixme: link to ...
Window.innerWidth - Web APIs
WebAPIWindowinnerWidth
example // this will return the width of the viewport var intframewidth = window.innerwidth; // this will return the width of the frame viewport within a frameset var intframewidth = self.innerwidth; // this will return the width of the viewport of the closest frameset var intframesetwidth = parent.innerwidth; // this will return the width of the viewport of the outermost frameset var intouterframesetwidth = top.innerwidth; specification specification status comment css object model (cssom) view modulethe definition of 'wind...
Window: load event - Web APIs
WebAPIWindowload event
display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.tex...
Window.locationbar - Web APIs
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> var visible = window.locationbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> specifications specification status comment html living standardthe definition of 'window.locationbar' in that specification.
Window.matchMedia() - Web APIs
WebAPIWindowmatchMedia
javascript let mql = window.matchmedia('(max-width: 600px)'); document.queryselector(".mq-value").innertext = mql.matches; the javascript code simply passes the media query to match into matchmedia() to compile it, then sets the <span>'s innertext to the value of the results' matches property, so that it indicates whether or not the document matches the media query at the moment the page was loaded.
Window.minimize() - Web APIs
WebAPIWindowminimize
the window.minimize() method sets the window to a minimized state.
Window: pageshow event - Web APIs
bubbles no cancelable no interface pagetransitionevent event handler property onpageshow examples this example sets up event handlers for events listed in the array events.
Window.releaseEvents() - Web APIs
syntax window.releaseevents(eventtype) eventtype is a combination of the following values: event.abort, event.blur, event.click, event.change, event.dblclick, event.dragddrop, event.error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload.
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.be...
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.be...
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.be...
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.be...
Window.scrollTo() - Web APIs
WebAPIWindowscrollTo
window.scrollto() scrolls to a particular set of coordinates in the document.
Window.showModalDialog() - Web APIs
syntax returnval = window.showmodaldialog(uri[, arguments][, options]); returnval holds the returnvalue property as set by the document specified by uri.
Window.statusbar - Web APIs
WebAPIWindowstatusbar
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>various dom tests</title> <script> // changing bar states on the existing window netscape.security.privilegemanager.enableprivilege("universalbrowserwrite"); window.statusbar.visible=!window.statusbar.visible; </script> </head> <body> <p>various dom tests</p> </body> </html> notes when you load the example page above, the browser displays the following dialog: to toggle...
Window.top - Web APIs
WebAPIWindowtop
this property is especially useful when you are dealing with a window that is in a subframe of a parent or parents, and you want to get to the top-level frameset.
Window: transitionend event - Web APIs
in the case where a transition is removed before completion, such as if the transition-property is removed or display is set to none, then the event will not be generated.
Window: unhandledrejection event - Web APIs
window.addeventlistener("unhandledrejection", event => { console.warn(`unhandled promise rejection: ${event.reason}`); }); you can also use the onunhandledrejection event handler property to set up the event listener: window.onunhandledrejection = event => { console.warn(`unhandled promise rejection: ${event.reason}`); }; preventing default handling many environments (such as node.js) report unhandled promise rejections to the console by default.
Window.updateCommands() - Web APIs
notes this enables or disables items (setting or clearing the "disabled" attribute on the command node as appropriate), or ensures that the command state reflects the state of the selection by setting current state information in the "state" attribute of the xul command nodes.
WindowEventHandlers.onbeforeunload - Web APIs
window.addeventlistener('beforeunload', function (e) { // cancel the event e.preventdefault(); // if you prevent default behavior in mozilla firefox prompt will always be shown // chrome requires returnvalue to be set e.returnvalue = ''; }); guarantee the browser unload by removing the returnvalue property of the event window.addeventlistener('beforeunload', function (e) { // the absence of a returnvalue property on the event will guarantee the browser unload happens delete e['returnvalue']; }); notes when your page uses javascript to render content, the javascript may stop when leaving and then nav...
WindowEventHandlers.onhashchange - Web APIs
function hashhandler() { console.log('the hash has changed!'); } window.addeventlistener('hashchange', hashhandler, false); overriding the hash this function sets a new hash dynamically, setting it randomly to one of two values.
WindowEventHandlers - Web APIs
the windoweventhandlers mixin describes the event handlers common to several interfaces like window, or htmlbodyelement and htmlframesetelement.
self.createImageBitmap() - Web APIs
options optional an object that sets options for the image's extraction.
Worker() - Web APIs
WebAPIWorkerWorker
options optional an object containing option properties that can be set when creating the object instance.
WorkerGlobalScope.location - Web APIs
it is a specific location object, mostly a subset of the location for browsing scopes, but adapted to workers.
WorkerGlobalScope.navigator - Web APIs
it is a specific navigator object, mostly a subset of the navigator for browsing scopes, but adapted to workers.
WorkerGlobalScope.onclose - Web APIs
}; example the following code snippet shows an onclose handler set inside a worker: self.onclose = function() { console.log('your worker instance has been closed'); } specifications this feature is no longer defined in any specifications.
WorkerGlobalScope.onerror - Web APIs
}; example the following code snippet shows an onerror handler set inside a worker: self.onerror = function() { console.log('there is an error inside your worker!'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.onerror' in that specification.
WorkerGlobalScope.onlanguagechange - Web APIs
}; example the following code snippet shows an onlanguagechange handler set inside a worker: self.onlanguagechange = function() { console.log('your preferred language settings have been changed'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.onlanguagechange' in that specification.
WorkerGlobalScope.onoffline - Web APIs
}; example the following code snippet shows an onoffline handler set inside a worker: self.onoffline = function() { console.log('your worker is now offline'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.onoffline' in that specification.
WorkerGlobalScope.ononline - Web APIs
}; example the following code snippet shows an ononline handler set inside a worker: self.ononline = function() { console.log('your worker is now online'); } specifications specification status comment html living standardthe definition of 'workerglobalscope.ononline' in that specification.
WorkerNavigator - Web APIs
the workernavigator interface represents a subset of the navigator interface allowed to be accessed from a worker.
WritableStream - Web APIs
the highwatermark property, which is set when creating the counting strategy (line 35), sets the maximum amount of data that the writablestream instance will handle in a single write() operation.
XDomainRequest.onerror - Web APIs
example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onerror = function(){ //handle error } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.ontimeout - Web APIs
example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.ontimeout = function(){ //handle timeout } xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.send() - Web APIs
example var xdr = new xdomainrequest(); xdr.open("post", "http://example.com/api/method"); xdr.onload = function(){ //handle response with xdr.responsetext } xdr.send("param1=value1&param2=value2"); specification not part of any specification.
XDomainRequest.timeout - Web APIs
gets or sets the amount of time in milliseconds until an xdomainrequest times out.
XMLDocument.async - Web APIs
WebAPIXMLDocumentasync
document.async can be set to indicate whether a xmldocument.load() call should be an asynchronous or synchronous request.
XMLHttpRequest.abort() - Web APIs
when a request is aborted, its readystate is changed to xmlhttprequest.unsent (0) and the request's status code is set to 0.
XMLHttpRequest.mozBackgroundRequest - Web APIs
note: this property must be set before calling open().
XMLHttpRequest.onreadystatechange - Web APIs
get", url = "https://developer.mozilla.org/"; xhr.open(method, url, true); xhr.onreadystatechange = function () { // in local files, status is 0 upon success in mozilla firefox if(xhr.readystate === xmlhttprequest.done) { var status = xhr.status; if (status === 0 || (status >= 200 && status < 400)) { // the request has been completed successfully console.log(xhr.responsetext); } else { // oh no!
XMLHttpRequest.timeout - Web APIs
using a timeout with an asynchronous request in internet explorer, the timeout property may be set only after calling the open() method and before calling the send() method.
XMLHttpRequestEventTarget - Web APIs
xmlhttprequesteventtarget.ontimeout contains the function that is called if the event times out and the timeout event is received by this object; this only happens if a timeout has been previously established by setting the value of the xmlhttprequest object's timeout attribute.
XMLSerializer - Web APIs
serializetostream() the subtree rooted by the specified element is serialized to a byte stream using the character set specified.
XPathResult.snapshotItem() - Web APIs
syntax var node = result.snapshotitem(i); return value the node at the given index within the node set of the xpathresult.
XRBoundedReferenceSpace - Web APIs
the webxr device api's xrboundedreferencespace interface describes a virtual world reference space which has preset boundaries.
XRInputSource.handedness - Web APIs
this may indicate, for example, an input source which isn't hand-held, such as controls built into a headset or an input device attached to the head or body.
XRInputSourceEvent() - Web APIs
examples the code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene.
XRInputSourceEvent - Web APIs
examples the code below sets up handlers for primary action events in order to determine when the user clicks on (shoots at/pokes at/whatever) objects in the scene.
XRInputSourceEventInit.inputSource - Web APIs
the new object's inputsource will be set to this value.
XRInputSourcesChangeEvent() - Web APIs
event types inputsourceschange delivered to the xrsession when the set of input devices available to it changes.
XRInputSourcesChangeEventInit - Web APIs
the xrinputsourceschangeeventinit dictionary is used to provide options to the xrinputsourceschangeevent() constructor in order to set the initial state of the new xrinputsourceschangeevent object.
XRPermissionDescriptor.mode - Web APIs
let xrpermissiondesc = { name: "xr", mode: "immersive-vr" }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": promptandsetupxr(); break; default: /* do nothing otherwise */ break; } .catch(err) { console.log(err); } } else { setupxr(); } specifications specification status comment webxr device apithe definition of 'xrpermissiondescriptor.mode' in that specification.
XRPermissionStatus.granted - Web APIs
it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces.
XRPose.transform - Web APIs
WebAPIXRPosetransform
syntax let posetransform = xrpose.transform; value an xrrigidtransform which provides the position and orientation of the xrpose relative to the xrframe to which this xrpose is aligned.
XRReferenceSpaceType - Web APIs
it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces.
XRRigidTransform.inverse - Web APIs
the inverse's matrix is multiplied by the object's matrix to get the model view matrix, which is then passed into the shader program by setting a uniform to contain that information.
XRRigidTransform.matrix - Web APIs
q_xq_y - q_zq_w) & 2(q_xq_z + q_yq_w) & p_x\\ 2(q_xq_y + q_zq_w) & 1 - 2(q_x^2 + q_z^2) & 2(q_yq_z - q_xq_w) & p_y\\ 2(q_xq_z - q_yq_w) & 2(q_yq_z + q_xq_w) & 1 - 2(q_x^2 + q_y^2) & p_z\\ 0 & 0 & 0 & 1 \end{bmatrix} examples in this example, a transform is created to create a matrix which can be used as a transform during rendering of webgl objects, in order to place objects to match a given offset and orientation.
XRRigidTransform.orientation - Web APIs
examples to create a reference space which is oriented to look straight up, positioned 2 meters off of ground level: xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform({y: -2}, {x: 0.0, y: 1.0, z: 0.0, w: 1.0}); ); the unit quaternion specified here is [0.0, 1.0, 0.0, 1.0] to indicate that the object should be facing directly along the y axis.
XRSession: inputsourceschange event - Web APIs
the inputsourceschange event is sent to an xrsession when the set of available webxr input devices changes.
XRSession.onsqueezestart - Web APIs
the xrsession interface's onsqueezestart event handler property can be set to a function which is then invoked to handle the squeezestart event that's sent when the user successfully begins a primary squeeze action on a webxr input device.
XRSession.requestReferenceSpace() - Web APIs
it's particularly useful when determining the distance between the viewer and an input, or when working with offset spaces.
XRSession: selectend event - Web APIs
source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "selectstart": targetobj = mybegintracking(targetraypose.matrix); break; case "select": mydropobject(targetobj, targetraypose.matrix); break; case "selectend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler for selectend events by setting the xrsession object's onselectend event handler property to a function that handles the event: xrsession.onselectstart = onselectionevent; xrsession.onselect = onselectionevent; xrsession.onselectend = onselectionevent; specifications specification status comment webxr device apithe definition of 'selectend event' in tha...
XRSession: selectstart event - Web APIs
source.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "selectstart": targetobj = mybegintracking(targetraypose.matrix); break; case "select": mydropobject(targetobj, targetraypose.matrix); break; case "selectend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler for selectend events by setting the xrsession object's onselectend event handler property to a function that handles the event: xrsession.onselectstart = onselectionevent; xrsession.onselect = onselectionevent; xrsession.onselectend = onselectionevent; specifications specification status comment webxr device apithe definition of 'selectstart event' in t...
XRSession: squeezeend event - Web APIs
rce.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "squeezestart": targetobj = mybegintracking(targetraypose.matrix); break; case "squeeze": mydropobject(targetobj, targetraypose.matrix); break; case "squeezeend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler these events by setting the xrsession object's onsqueezeend event handler property to a function that handles the event: xrsession.onsqueezestart = onsqueezeevent; xrsession.onsqueeze = onsqueezeevent; xrsession.onsqueezeend = onsqueezeevent; specifications specification status comment webxr device apithe definition of 'squeezeend event' in that specifi...
XRSession: squeezestart event - Web APIs
rce.targetrayspace, myrefspace); if (!targetraypose) { return; } switch(event.type) { case "squeezestart": targetobj = mybegintracking(targetraypose.matrix); break; case "squeeze": mydropobject(targetobj, targetraypose.matrix); break; case "squeezeend": mystoptracking(targetobj, targetraypose.matrix); break; } } you can of course also set up a handler these events by setting the xrsession object's onsqueezeend event handler property to a function that handles the event: xrsession.onsqueezestart = onsqueezeevent; xrsession.onsqueeze = onsqueezeevent; xrsession.onsqueezeend = onsqueezeevent; specifications specification status comment webxr device apithe definition of 'squeezestart event' in that speci...
XRSession.updateRenderState() - Web APIs
the inlineverticalfieldofview property was set, but the session is immersive and therefore does not allow this property to be used.
XRSpace - Web APIs
WebAPIXRSpace
there are exceptions to this static nature; most commonly, an xrreferencespace may move in order to adjust based on reconfiguration of the user's headset or other motion-sensitive device.
XRViewerPose.views - Web APIs
stereo views require two views to render properly, with the left eye's view having its eye set to the string left and the right eye's view a value of right.
XRWebGLLayer() - Web APIs
the specified webgl context, context, has been lost for any reason, such as a gpu switch or reset.
XRWebGLLayer.antialias - Web APIs
usage notes since this is a read-only property, you can set the antialiasing mode only when initially creating the xrwebgllayer, by specifying the antialias object in the xrwebgllayer() constructor's layerinit parameter.
XRWebGLLayer - Web APIs
methods getviewport() returns a new xrviewport instance representing the position, width, and height to which the webgl context's viewport must be set to contain drawing to the area of the framebuffer designated for the specified view's contents.
XRWebGLLayerInit.ignoreDepthValues - Web APIs
syntax let layerinit = { ignoredepthvalues: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { ignoredepthvalues: boolvalue }); value a boolean value which can be set to true to disable the use of the depth buffer by the webgl rendering layer created by the xrwebgllayer() constructor.
XRWebGLLayerInit.stencil - Web APIs
syntax let layerinit = { stencil: false }; let gllayer = new xrwebgllayer(xrsession, gl, layerinit); let gllayer = new xrwebgllayer(xrsession, gl, { stencil: false }); value a boolean which can be set to false to specify that the new webgl layer should not include a stencil buffer.
XRWebGLLayerInit - Web APIs
examples given an xrsession, xrsession, and a webgl rendering context, gl, this snippet sets the rendering layer for the session, specifying the ignoredepthvalues option, indicating that the depth buffer should not be used (or should not exist at all), and that the only source for distance information of any given point is its position relative to the viewer.
XSLT Basic Example - Web APIs
basic example this first example demonstrates the basics of setting up an xslt transformation in a browser.
XSL Transformations in Mozilla FAQ - Web APIs
make sure the mime type for both source and stylesheet are set to an xml mimetype, namely text/xml or application/xml.
msPutPropertyEnabled - Web APIs
the msputpropertyenabled method sets whether a given property in the style object is enabled or disabled.
msthumbnailclick - Web APIs
example function thumbnailclickhandler(evt) { alert ("clicked button: " + evt.buttonid); } document.addeventlistener('msthumbnailclick', thumbnailclickhandler); example 2 // adds an overlay icon on your app pinned to the taskbar window.external.mssitemodeseticonoverlay(iconuri, tooltip); // removes an overlay icon window.external.mssitemodecleariconoverlay(); // pinned icons on your taskbar can be instructed to trigger specific events on your site from the taskbar // add an event handlerdocument.addeventlistener('msthumbnailclick', onbuttonclicked, false); // add the buttons var btnplay = window.external.mssitemodeaddthumbbarbutton(iconuri, toolti...
Using the aria-relevant attribute - Accessibility
any change that is not relevant acts in the same manner it would if the aria-live attribute were set to off.
Using the aria-valuetext attribute - Accessibility
authors should only set the aria-valuetext attribute when the rendered value cannot be accurately represented as a number.
Using the status role - Accessibility
these should be announced when the user is idle, unless aria-live=”assertive” has been set and in which case the user may be interrupted.
x-ms-aria-flowfrom - Accessibility
example <div tabindex="0" class="foo" id="element2" role="option" aria-posinset="1" aria-setsize="15" aria-flowto="element8" x-ms-aria-flowfrom="element5"> see also aria relationship attributes microsoft api extensions ...
Using ARIA: Roles, states, and properties - Accessibility
aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop attributes aria-dropeffect aria-dragged relationship attributes aria-activedescendant aria-colcount aria-colindex aria-colspan aria-controls aria-describedby aria-details aria-errormessage aria-flowto aria-labelledby aria-owns aria-posinset aria-rowcount aria-rowindex aria-rowspan aria-setsize microsoftedge-specific properties x-ms-aria-flowfrom ...
ARIA: alert role - Accessibility
setting role="alert" is equivalent to setting aria-live="assertive" and aria-atomic="true".
ARIA: cell role - Accessibility
for example, a cell in the first row of the first header would likely have aria-rowindex="1" set, and cells in row 47 would have aria-rowindex="47", if aria-rowindex were needed due to not all rows being in the dom.
ARIA: gridcell role - Accessibility
use aria-colcount and aria-rowcount on the parent element with role="grid" applied to it to set the total number of columns or rows.
ARIA: Navigation Role - Accessibility
if two or more navigational landmark on a page have the same set of links, use the same label for each.
ARIA: rowgroup role - Accessibility
the aria roles are only necessary if the native semantics of the table, and therefore the table rows, are obliterated, such as by setting the display property to flex or grid.
ARIA: Suggestion role - Accessibility
this is the job of role="suggestion", which should be set on an element wrapping both of them like so: <p>freida’s pet is a <span role="suggestion"> <span role="deletion">black cat called luna</span> <span role="insertion">purple tyrannosaurus rex called tiny</span> </span>.
ARIA: dialog role - Accessibility
in other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element provides a grouping label for the controls inside a <fieldset> element).
WAI-ARIA Roles - Accessibility
it is usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.aria: banner rolea banner role represents general and informative content frequently placed at the beginning of the page.
Accessibility Information for Web Authors - Accessibility
web content accessibility guidelines (wcag) 1.0 another important set of guidelines from the w3c web accessibility initiative (wai).
Operable - Accessibility
2.4.8 location within site (aaa) when on a page inside a complex site or set of steps, the user should be given an indicator of where they are in the site, for example a breadcrumb trail, sitemap or text such as "form page 2 of 10".
Accessibility
other documentation understanding the web content accessibility guidelines this set of articles provides quick explanations to help you understand the steps that need to be taken to conform to the recommendations outlined in the w3c web content accessibility guidelines 2.0 (wcag 2.0 or just wcag, for the purposes of this writing).
-moz-float-edge - CSS: Cascading Style Sheets
/* keyword values */ -moz-float-edge: border-box; -moz-float-edge: content-box; -moz-float-edge: margin-box; -moz-float-edge: padding-box; /* global values */ -moz-float-edge: inherit; -moz-float-edge: initial; -moz-float-edge: unset; syntax values border-box the height and width properties include the content, padding and border but not the margin.
-webkit-mask-attachment - CSS: Cascading Style Sheets
/* keyword values */ -webkit-mask-attachment: scroll; -webkit-mask-attachment: fixed; -webkit-mask-attachment: local; /* multiple values */ -webkit-mask-attachment: scroll, local; -webkit-mask-attachment: fixed, local, scroll; /* global values */ -webkit-mask-attachment: inherit; -webkit-mask-attachment: initial; -webkit-mask-attachment: unset; syntax values scroll if scroll is specified, the mask image scrolls within the viewport along with the block that contains the mask image.
-webkit-mask-composite - CSS: Cascading Style Sheets
mposite: source-in; -webkit-mask-composite: source-out; -webkit-mask-composite: source-atop; -webkit-mask-composite: destination-over; -webkit-mask-composite: destination-in; -webkit-mask-composite: destination-out; -webkit-mask-composite: destination-atop; -webkit-mask-composite: xor; /* global values */ -webkit-mask-composite: inherit; -webkit-mask-composite: initial; -webkit-mask-composite: unset; there is a standardized mask-composite property covering parts of this non-standard property using different keywords.
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
/* keyword values */ -webkit-mask-repeat-x: repeat; -webkit-mask-repeat-x: no-repeat; -webkit-mask-repeat-x: space; -webkit-mask-repeat-x: round; /* multiple values */ -webkit-mask-repeat-x: repeat, no-repeat, space; /* global values */ -webkit-mask-repeat-x: inherit; -webkit-mask-repeat-x: initial; -webkit-mask-repeat-x: unset; syntax values repeat the mask image is repeated both horizontally and vertically.
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
-webkit-tap-highlight-color is a non-standard css property that sets the color of the highlight that appears over a link while it's being tapped.
-webkit-text-stroke-width - CSS: Cascading Style Sheets
/* keyword values */ -webkit-text-stroke-width: thin; -webkit-text-stroke-width: medium; -webkit-text-stroke-width: thick; /* <length> values */ -webkit-text-stroke-width: 2px; -webkit-text-stroke-width: 0.1em; -webkit-text-stroke-width: 1mm; -webkit-text-stroke-width: 5pt; /* global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width: initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke.
-webkit-text-stroke - CSS: Cascading Style Sheets
/* width and color values */ -webkit-text-stroke: 4px navy; text-stroke: 4px navy; /* global values */ -webkit-text-stroke: inherit; -webkit-text-stroke: initial; -webkit-text-stroke: unset; text-stroke: inherit; text-stroke: initial; text-stroke: unset; constituent properties this property is a shorthand for the following css properties: -webkit-stroke-color -webkit-stroke-width syntax values <length> the width of the stroke.
-webkit-touch-callout - CSS: Cascading Style Sheets
/* keyword values */ -webkit-touch-callout: default; -webkit-touch-callout: none; /* global values */ -webkit-touch-callout: initial; -webkit-touch-callout: inherit; -webkit-touch-callout: unset; syntax values default the default callout is displayed.
:-moz-focusring - CSS: Cascading Style Sheets
whether the user agent has focus ring drawing enabled can depend on operating system settings and other factors, so the precise behavior of this pseudo-class will vary from platform to platform.
:-moz-loading - CSS: Cascading Style Sheets
syntax :-moz-loading examples setting a background for images that are loading :-moz-loading { background-color: #aaa; background-image: url(loading-animation.gif) center no-repeat; } specifications not part of any standard.
:-moz-locale-dir(ltr) - CSS: Cascading Style Sheets
this is determined by the preference intl.uidirection.locale (where locale is the current locale) being set to "ltr".
:-moz-locale-dir(rtl) - CSS: Cascading Style Sheets
this is determined by the preference intl.uidirection.locale (where locale is the current locale) being set to "rtl".
:-moz-window-inactive - CSS: Cascading Style Sheets
note: prior to the addition of this pseudo-class, giving different styles to background windows was achieved by setting an attribute (active="true") on the top-level xul chrome window.
::-webkit-meter-bar - CSS: Cascading Style Sheets
examples html <meter min="0" max="10" value="6">score out of 10</meter> css meter { /* reset the default appearance */ -webkit-appearance: none; -moz-appearance: none; appearance: none; } meter::-webkit-meter-bar { background: #eee; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2) inset; border-radius: 3px; } result ...
::-webkit-meter-inner-element - CSS: Cascading Style Sheets
html <meter min="0" max="10" value="6">score out of 10</meter> css meter { /* reset the default appearance */ -webkit-appearance: none; -moz-appearance: none; appearance: none; } meter::-webkit-meter-inner-element { -webkit-appearance: inherit; box-sizing: inherit; border: 1px solid #aaa; } result ...
::-webkit-meter-optimum-value - CSS: Cascading Style Sheets
html <meter min="0" max="10" value="6">score out of 10</meter> css meter::-webkit-meter-bar { /* required to get rid of the default background property */ background : none; background-color : whitesmoke; box-shadow : 0 5px 5px -5px #333 inset; } meter::-webkit-meter-optimum-value { box-shadow: 0 5px 5px -5px #999 inset; } result ...
::-webkit-outer-spin-button - CSS: Cascading Style Sheets
hiding the spinner this example uses input::-webkit-outer-spin-button to find <input> elements' spinner widgets and set their -webkit-appearance to none, thus hiding them.
::-webkit-progress-bar - CSS: Cascading Style Sheets
note: for ::-webkit-progress-value to take effect, appearance needs to be set to none on the <progress> element.
::-webkit-progress-inner-element - CSS: Cascading Style Sheets
note: in order to let ::-webkit-progress-value take effect, -webkit-appearance needs to be set to none on the <progress> element.
::-webkit-progress-value - CSS: Cascading Style Sheets
note: in order to let ::-webkit-progress-value take effect, -webkit-appearance needs to be set to none on the <progress> element.
::cue-region - CSS: Cascading Style Sheets
::cue-region { color: yellow; font-weight: bold; } the properties are applied to the entire set of cues as if they were a single unit.
::grammar-error - CSS: Cascading Style Sheets
allowable properties only a small subset of css properties can be used in a rule with ::grammar-error in its selector: color background-color cursor caret-color outline and its longhands text-decoration and its associated properties text-emphasis-color text-shadow syntax ::grammar-error examples simple document grammar check in this example, eventual supporting browsers should highlight any flagged grammatical errors with the styles shown.
::marker - CSS: Cascading Style Sheets
WebCSS::marker
it works on any element or pseudo-element set to display: list-item, such as the <li> and <summary> elements.
::part() - CSS: Cascading Style Sheets
WebCSS::part
element></tabbed-custom-element> css tabbed-custom-element::part(tab) { color: #0c0c0dcc; border-bottom: transparent solid 2px; } tabbed-custom-element::part(tab):hover { background-color: #0c0c0d19; border-color: #0c0c0d33; } tabbed-custom-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.shado...
::placeholder - CSS: Cascading Style Sheets
::placeholder { color: blue; font-size: 1.5em; } only the subset of css properties that apply to the ::first-line pseudo-element can be used in a rule using ::placeholder in its selector.
::spelling-error - CSS: Cascading Style Sheets
allowable properties only a small subset of css properties can be used in a rule with ::spelling-error in its selector: color background-color cursor caret-color outline and its longhands text-decoration and its associated properties text-emphasis-color text-shadow syntax ::spelling-error examples simple document spell check in this example, eventual supporting browsers should highlight any flagged spelling errors with the styles shown.
:default - CSS: Cascading Style Sheets
WebCSS:default
syntax :default examples html <fieldset> <legend>favorite season</legend> <input type="radio" name="season" id="spring"> <label for="spring">spring</label> <input type="radio" name="season" id="summer" checked> <label for="summer">summer</label> <input type="radio" name="season" id="fall"> <label for="fall">fall</label> <input type="radio" name="season" id="winter"> <label for="winter">winter</label> </fieldset> ...
:dir() - CSS: Cascading Style Sheets
WebCSS:dir
it doesn't account for styling directionality, i.e., the directionality set by css properties such as direction.
:fullscreen - CSS: Cascading Style Sheets
#fs-toggle:not(:fullscreen) { background-color: #afa; } when the document is in full-screen mode, the following css applies instead, setting the background color to a pale shade of red.
:invalid - CSS: Cascading Style Sheets
WebCSS:invalid
however, it does apply a style (a red "glow" using the box-shadow property) to the :-moz-ui-invalid pseudo-class, which applies in a subset of cases for :invalid.
:left - CSS: Cascading Style Sheets
WebCSS:left
syntax :left examples setting a margin for left-hand pages @page :left { margin: 2in 3in; } specifications specification status comment css paged media module level 3the definition of ':left' in that specification.
:link - CSS: Cascading Style Sheets
WebCSS:link
(after that, you'll need to clear your browser history to see them again.) however, the background-color values are likely to remain, as most browsers do not set that property on visited links by default.
:nth-child() - CSS: Cascading Style Sheets
functional notation <an+b> represents elements in a list whose indices match those found in a custom pattern of numbers, defined by an+b, where: a is an integer step size, b is an integer offset, n is all positive integers, starting from 0.
:optional - CSS: Cascading Style Sheets
WebCSS:optional
the :optional css pseudo-class represents any <input>, <select>, or <textarea> element that does not have the required attribute set on it.
:read-only - CSS: Cascading Style Sheets
input:-moz-read-only, textarea:-moz-read-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-only non-form controls this selector doesn't just select <input>/<textarea> elements — it will select any element that cannot be edited by the user.
:read-write - CSS: Cascading Style Sheets
input:-moz-read-only, textarea:-moz-read-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } you can find the full source code at readonly-confirmation.html; this renders like so: styling read-write non-form controls this selector doesn't just select <input>/<textarea> elements — it will select any element that can be edited by the user, such as a <p> element with contenteditable set on it.
:required - CSS: Cascading Style Sheets
WebCSS:required
the :required css pseudo-class represents any <input>, <select>, or <textarea> element that has the required attribute set on it.
:right - CSS: Cascading Style Sheets
WebCSS:right
syntax :right examples setting margins for right-hand pages @page :right { margin: 2in 3in; } specifications specification status comment css paged media module level 3the definition of ':right' in that specification.
:valid - CSS: Cascading Style Sheets
WebCSS:valid
e" type="text" required> <span></span> </div> to provide these indicators, we use the following css: input + span { position: relative; } input + span::before { position: absolute; right: -20px; top: 5px; } input:invalid { border: 2px solid red; } input:invalid + span::before { content: '✖'; color: red; } input:valid + span::before { content: '✓'; color: green; } we set the <span>s to position: relative so that we can position the generated content relative to them.
range - CSS: Cascading Style Sheets
formal definition related at-rule@counter-styleinitial valueautocomputed valueas specified formal syntax [ [ <integer> | infinite ]{2} ]# | auto examples setting counter style over a range <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> <li>six</li> <li>seven</li> <li>eight</li> <li>nine</li> <li>ten</li> </ul> @counter-style range-multi-example { system: cyclic; symbols: "\25a0" "\25a1"; range: 2 4, 7 9; } .list { list-style: range-multi-example; } the above list will display as f...
speak-as - CSS: Cascading Style Sheets
let's talk about speech css | css tricks formal definition related at-rule@counter-styleinitial valueautocomputed valueas specified formal syntax auto | bullets | numbers | words | spell-out | <counter-style-name>where <counter-style-name> = <custom-ident> examples setting the spoken form for a counter html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style speak-as-example { system: fixed; symbols:     ; suffix: " "; speak-as: numbers; } .list { list-style: speak-as-example; } result specifications specification status comment ...
system - CSS: Cascading Style Sheets
fixed defines a finite set of symbols are specified.
font-family - CSS: Cascading Style Sheets
formal definition related at-rule@font-faceinitial valuen/a (required)computed valueas specified formal syntax <family-name>where <family-name> = <string> | <custom-ident>+ examples setting the font family name @font-face { font-family: examplefont; src: url('examplefont.ttf'); } specifications specification status comment css fonts module level 3the definition of 'font-family' in that specification.
font-stretch - CSS: Cascading Style Sheets
ions understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal definition related at-rule@font-faceinitial valuenormalcomputed valueas specified formal syntax <font-stretch-absolute>{1,2}where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples setting a percentage range for font-stretch the following find a local open sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded states.
src - CSS: Cascading Style Sheets
WebCSS@font-facesrc
when a font is needed the user agent iterates over the set of references listed using the first one it can successfully activate.
@import - CSS: Cascading Style Sheets
WebCSS@import
description imported rules must precede all other types of rules, except @charset rules; as it is not a nested statement, @import cannot be used inside conditional group at-rules.
-ms-high-contrast - CSS: Cascading Style Sheets
@media screen and (-ms-high-contrast: active) { /* all high contrast styling rules */ } @media screen and (-ms-high-contrast: black-on-white) { div { background-image: url('image-bw.png'); } } @media screen and (-ms-high-contrast: white-on-black) { div { background-image: url('image-wb.png'); } } accessibility concerns theming high contrast mode's theme colors come from a limited subset of deprecated css2 system colors.
display-mode - CSS: Cascading Style Sheets
minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation.
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
if you have set privacy.resistfingerprinting to true, prefers-color-scheme preference is overridden to light.
prefers-contrast - CSS: Cascading Style Sheets
user preferences various operating systems do support such preferences and user agents are likely to rely on the settings provided by the operating system.
prefers-reduced-data - 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.
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.
@media - CSS: Cascading Style Sheets
WebCSS@media
a browser might also offer additional measures in this area; for example, if firefox's "resist fingerprinting" setting is enabled, many media queries report default values rather than values representing the actual device state.
@namespace - CSS: Cascading Style Sheets
any @namespace rules must follow all @charset and @import rules, and precede all other at-rules and style declarations in a style sheet.
bleed - CSS: Cascading Style Sheets
WebCSS@pagebleed
formal definition related at-rule@pageinitial valueautocomputed valueas specified formal syntax auto | <length> examples setting a page bleed of 1cm @page { bleed: 1cm; } specifications specification status comment css paged media module level 3the definition of 'bleed' in that specification.
CSS Basic User Interface - CSS: Cascading Style Sheets
reference properties appearance box-sizing cursor ime-mode nav-down nav-left nav-right nav-up outline outline-width outline-style outline-color outline-offset resize text-overflow user-select guides using url values for the cursor property explains how a url can be used with the cursor property to produce custom cursors.
Using feature queries - CSS: Cascading Style Sheets
we can set the width back to auto if grid is supported.
CSS Conditional Rules - CSS: Cascading Style Sheets
css conditional rules is a css module that allows to define a set of rules that will only apply based on the capabilities of the processor or the document the style sheet is being applied to.
CSS Containment - CSS: Cascading Style Sheets
using contain: style would ensure that the counter-increment and counter-set properties created new counters scoped to that subtree only.
CSS Counter Styles - CSS: Cascading Style Sheets
reference properties counter-increment counter-reset at-rules @counter-style system additive-symbols negative prefix suffix range pad speak-as fallback guides using css counters describes how to use counters to number any html element or to perform complex counting.
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
flex containers in the following live example, i have floated two blocks and then set display: flex on the container.
Ordering Flex Items - CSS: Cascading Style Sheets
the card is going to be our flex container, with flex-direction set to column.
CSS Flow Layout - CSS: Cascading Style Sheets
the flow is essentially a set of things that are all working together and know about each other in your layout.
CSS Masking - CSS: Cascading Style Sheets
reference properties clip clip-path clip-rule mask mask-border mask-border-mode mask-border-outset mask-border-repeat mask-border-slice mask-border-source mask-border-width mask-clip mask-composite mask-image mask-mode mask-origin mask-position mask-repeat mask-size mask-type specifications specification status comment css masking module level 1 candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the definition of 'mask' in that specification.
The stacking context - CSS: Cascading Style Sheets
note: the hierarchy of stacking contexts is a subset of the hierarchy of html elements because only certain elements create stacking contexts.
CSS Properties Reference - CSS: Cascading Style Sheets
p overflow overflow padding padding padding-bottom paddingbottom padding-left paddingleft padding-right paddingright padding-top paddingtop page-break-after pagebreakafter page-break-before pagebreakbefore position position stroke-dasharray strokedasharray stroke-dashoffset strokedashoffset stroke-width strokewidth text-align textalign text-decoration textdecoration text-indent textindent text-transform texttransform top top vertical-align verticalalign visibility visibility width width z-index zindex ...
Shapes from box values - CSS: Cascading Style Sheets
the border-radius property has been used to create a circle by setting border-radius: 50%.
CSS Text Decoration - CSS: Cascading Style Sheets
reference properties letter-spacing text-align text-decoration text-decoration-color text-decoration-line text-decoration-offset text-decoration-skip-ink text-decoration-style text-decoration-thickness text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-rendering text-shadow text-transform white-space word-spacing guides none.
CSS data types - CSS: Cascading Style Sheets
WebCSSCSS Types
index the data types defined by the set of css specifications include the following: <angle> <angle-percentage> <angular-color-hint> <angular-color-stop> <attr-fallback> <attr-name> <basic-shape> <blend-mode> <calc-product> <calc-sum> <calc-value> <color> <color-stop> <color-stop-angle> <counter-style> <custom-ident> <dimension> <filter-function> <flex> <frequency> <frequency-percentage> <gradient> <ident> <image> <integer> <length> <length-percentage> <number> <number-percentage> <percentage> <pos...
Center an element - CSS: Cascading Style Sheets
then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis.
Pagination - CSS: Cascading Style Sheets
we have also added some additional content that would be read by a screenreader but is hidden visually, and set the aria-hidden attribute on the paging arrows.
Split Navigation - CSS: Cascading Style Sheets
we can use flexbox to achieve this, without needing to make the two sets of items into two separate flex containers.
Layout mode - CSS: Cascading Style Sheets
most of them apply to one or two of them and have no effect if they are set on an element participating in another layout mode.
Media queries - CSS: Cascading Style Sheets
testing media queries programmatically describes how to use media queries in your javascript code to determine the state of a device, and to set up listeners that notify your code when the results of media queries change (such as when the user rotates the screen or resizes the browser).
Paged media - CSS: Cascading Style Sheets
it allows you to set page breaks, control printable area, style left and right pages differently, and control breaks inside elements.
<alpha-value> - CSS: Cascading Style Sheets
examples setting text color opacity here an alpha value is used to set partially transparent text: /* <rgba()> */ color: rgba(34, 12, 64, 0.6); color: rgba(34.0 12 64 / 60%); setting shape image threshold here an alpha value is used to determine which parts of an image are considered part of a shape: /* shape-image-threshold */ shape-image-threshold: 70%; shape-image-threshold: 0.7; specifications ...
<angle> - CSS: Cascading Style Sheets
WebCSSangle
examples setting a clockwise right angle 90deg = 100grad = 0.25turn ≈ 1.5708rad setting a flat angle 180deg = 200grad = 0.5turn ≈ 3.1416rad setting a counterclockwise right angle -90deg = -100grad = -0.25turn ≈ -1.5708rad setting a null angle 0 = 0deg = 0grad = 0turn = 0rad specifications specification statu...
attr() - CSS: Cascading Style Sheets
WebCSSattr
if not set, css will use the default value defined for each <type-or-unit>.
backdrop-filter - CSS: Cascading Style Sheets
adow(4px 4px 10px blue); backdrop-filter: grayscale(30%); backdrop-filter: hue-rotate(120deg); backdrop-filter: invert(70%); backdrop-filter: opacity(20%); backdrop-filter: sepia(90%); backdrop-filter: saturate(80%); /* multiple filters */ backdrop-filter: url(filters.svg#filter) blur(4px) saturate(150%); /* global values */ backdrop-filter: inherit; backdrop-filter: initial; backdrop-filter: unset; syntax values none no filter is applied to the backdrop.
<blend-mode> - CSS: Cascading Style Sheets
examples blend mode comparison in the following example, we have a <div> with two background images set on it — a firefox logo on top of a linear gradient.
block-size - CSS: Cascading Style Sheets
syntax /* <length> values */ block-size: 300px; block-size: 25em; /* <percentage> values */ block-size: 75%; /* keyword values */ block-size: max-content; block-size: min-content; block-size: fit-content(20em); block-size: auto; /* global values */ block-size: inherit; block-size: initial; block-size: unset; if the writing mode is vertically oriented, the value of block-size relates to the width of the element; otherwise, it relates to the height of the element.
border-block-color - CSS: Cascading Style Sheets
border-block-color: yellow; border-block-color: #f5f6f7; the border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color.
border-block-style - CSS: Cascading Style Sheets
/* <'border-style'> values */ border-block-style: dashed; border-block-style: dotted; border-block-style: groove; the border style in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style.
border-block-width - CSS: Cascading Style Sheets
/* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width.
border-bottom-left-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-bottom-left-radius css property, the value of this property is then reset to its initial value by the shorthand property.
border-bottom-right-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-bottom-right-radius css property, the value of this property is then reset to its initial value by the shorthand property.
border-end-end-radius - CSS: Cascading Style Sheets
/* <length> values */ /* with one value the corner will be a circle */ border-end-end-radius: 10px; border-end-end-radius: 1em; /* with two values the corner will be an ellipse */ border-end-end-radius: 1em 2em; /* global values */ border-end-end-radius: inherit; border-end-end-radius: initial; border-end-end-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-bottom-right-radius property.
border-end-start-radius - CSS: Cascading Style Sheets
/* <length> values */ /* with one value the corner will be a circle */ border-end-start-radius: 10px; border-end-start-radius: 1em; /* with two values the corner will be an ellipse */ border-end-start-radius: 1em 2em; /* global values */ border-end-start-radius: inherit; border-end-start-radius: initial; border-end-start-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-right-radius property.
border-image-repeat - CSS: Cascading Style Sheets
syntax /* keyword value */ border-image-repeat: stretch; border-image-repeat: repeat; border-image-repeat: round; border-image-repeat: space; /* vertical | horizontal */ border-image-repeat: round stretch; /* global values */ border-image-repeat: inherit; border-image-repeat: initial; border-image-repeat: unset; the border-image-repeat property may be specified using one or two values chosen from the list of values below.
border-inline-color - CSS: Cascading Style Sheets
border-inline-color: yellow; border-inline-color: #f5f6f7; the border color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color.
border-inline-end - CSS: Cascading Style Sheets
the border-inline-end css property is a shorthand property for setting the individual logical inline-end border property values in a single place in the style sheet.
border-inline-start - CSS: Cascading Style Sheets
the border-inline-start css property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet.
border-inline-style - CSS: Cascading Style Sheets
/* <'border-style'> values */ border-inline-style: dashed; border-inline-style: dotted; border-inline-style: groove; the border style in the other dimension can be set with border-block-style, which sets border-block-start-style, and border-block-end-style.
border-inline-width - CSS: Cascading Style Sheets
/* <'border-width'> values */ border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width.
border-start-end-radius - CSS: Cascading Style Sheets
/* <length> values */ /* with one value the corner will be a circle */ border-start-end-radius: 10px; border-start-end-radius: 1em; /* with two values the corner will be an ellipse */ border-start-end-radius: 1em 2em; /* global values */ border-start-end-radius: inherit; border-start-end-radius: initial; border-start-end-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-bottom-left-radius property.
border-start-start-radius - CSS: Cascading Style Sheets
/* <length> values */ /* with one value the corner will be a circle */ border-start-start-radius: 10px; border-start-start-radius: 1em; /* with two values the corner will be an ellipse */ border-start-start-radius: 1em 2em; /* global values */ border-start-start-radius: inherit; border-start-start-radius: initial; border-start-start-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-left-radius property.
border-top-left-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-top-left-radius css property, the value of this property is then reset to its initial value by the shorthand property.
border-top-right-radius - CSS: Cascading Style Sheets
note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-top-right-radius css property, the value of this property is then reset to its initial value by the shorthand property.
box-decoration-break - CSS: Cascading Style Sheets
the specified value will impact the appearance of the following properties: background border border-image box-shadow clip-path margin padding syntax /* keyword values */ box-decoration-break: slice; box-decoration-break: clone; /* global values */ box-decoration-break: initial; box-decoration-break: inherit; box-decoration-break: unset; the box-decoration-break property is specified as one of the keyword values listed below.
box-flex-group - CSS: Cascading Style Sheets
/* <integer> values */ box-flex-group: 1; box-flex-group: 5; /* global values */ box-flex-group: inherit; box-flex-group: initial; box-flex-group: unset; for flexible elements assigned to flex groups, the first flex group is 1 and higher values specify subsequent flex groups.
box-lines - CSS: Cascading Style Sheets
WebCSSbox-lines
/* keyword values */ box-lines: single; box-lines: multiple; /* global values */ box-lines: inherit; box-lines: initial; box-lines: unset; by default a horizontal box will lay out its children in a single row, and a vertical box will lay out its children in a single column.
box-ordinal-group - CSS: Cascading Style Sheets
/* <integer> values */ box-ordinal-group: 1; box-ordinal-group: 5; /* global values */ box-ordinal-group: inherit; box-ordinal-group: initial; box-ordinal-group: unset; ordinal groups may be used in conjunction with the box-direction property to control the order in which the direct children of a box appear.
calc() - CSS: Cascading Style Sheets
WebCSScalc
examples positioning an object on screen with a margin calc() makes it easy to position an object with a set margin.
color-adjust - CSS: Cascading Style Sheets
the color-adjust css property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device.
column-fill - CSS: Cascading Style Sheets
syntax /* keyword values */ column-fill: auto; column-fill: balance; column-fill: balance-all; /* global values */ column-fill: inherit; column-fill: initial; column-fill: unset; the column-fill property is specified as one of the keyword values listed below.
Computed value - CSS: Cascading Style Sheets
it is calculated from the specified value by: handling the special values inherit, initial, unset, and revert.
conic-gradient() - CSS: Cascading Style Sheets
its concrete size will match the size of the element it applies to, or size of the <image> is set to something other than the element size.
contain - CSS: Cascading Style Sheets
WebCSScontain
syntax /* keyword values */ contain: none; contain: strict; contain: content; contain: size; contain: layout; contain: style; contain: paint; /* multiple keywords */ contain: size paint; contain: size layout paint; /* global values */ contain: inherit; contain: initial; contain: unset; the contain property is specified as either one of the following: using a single none, strict, or content keyword.
<display-box> - CSS: Cascading Style Sheets
more accessible markup with display: contents | hidde de vries display: contents is not a css reset | adrian roselli examples in this first example, the paragraph with a class of secret is set to display: none; the box and any content is now not rendered.
<display-inside> - CSS: Cascading Style Sheets
note: browsers that support the two value syntax, on finding the inner value only, such as when display: flex or display: grid is specified, will set their outer value to block.
blur() - CSS: Cascading Style Sheets
examples setting a blur with pixels and with rem blur(0) /* no effect */ blur(8px) /* blur with 8px radius */ blur(1.17rem) /* blur with 1.17rem radius */ specifications specification status filter effects module level 1the definition of 'blur()' in that specification.
brightness() - CSS: Cascading Style Sheets
examples setting brightness using numbers and percentages brightness(0%) /* completely black */ brightness(0.4) /* 40% brightness */ brightness(1) /* no effect */ brightness(200%) /* double brightness */ specifications specification status filter effects module level 1the definition of 'brightness()' in that specification.
contrast() - CSS: Cascading Style Sheets
examples setting contrast using numbers and percentages contrast(0) /* completely gray */ contrast(65%) /* 65% contrast */ contrast(1) /* no effect */ contrast(200%) /* double contrast */ specifications specification status filter effects module level 1the definition of 'contrast()' in that specification.
float - CSS: Cascading Style Sheets
WebCSSfloat
syntax /* keyword values */ float: left; float: right; float: none; float: inline-start; float: inline-end; /* global values */ float: inherit; float: initial; float: unset; the float property is specified as a single keyword, chosen from the list of values below.
font-kerning - CSS: Cascading Style Sheets
the font-kerning css property sets the use of the kerning information stored in a font.
grid-template-areas - CSS: Cascading Style Sheets
syntax /* keyword value */ grid-template-areas: none; /* <string> values */ grid-template-areas: "a b"; grid-template-areas: "a b b" "a c d"; /* global values */ grid-template-areas: inherit; grid-template-areas: initial; grid-template-areas: unset; values none the grid container doesn’t define any named grid areas.
image-orientation - CSS: Cascading Style Sheets
/* keyword values */ image-orientation: none; image-orientation: from-image; /* use exif data from the image */ /* global values */ image-orientation: inherit; image-orientation: initial; image-orientation: unset; /* obsolete values.
inherit - CSS: Cascading Style Sheets
WebCSSinherit
for non-inherited properties, this specifies a behavior that typically makes relatively little sense and you may consider using initial instead, or unset on the all property.
initial-letter-align - CSS: Cascading Style Sheets
/* keyword values */ initial-letter-align: auto; initial-letter-align: alphabetic; initial-letter-align: hanging; initial-letter-align: ideographic; /* global values */ initial-letter-align: inherit; initial-letter-align: initial; initial-letter-align: unset; syntax one of the keyword values listed below.
<integer> - CSS: Cascading Style Sheets
WebCSSinteger
during the css3 values cycle there was a lot of discussion about setting a minimum range to support: the latest decision, in april 2012 during the lc phase, was [-227-1; 227-1], but other values like 224-1 and 230-1 were also proposed.
isolation - CSS: Cascading Style Sheets
WebCSSisolation
syntax /* keyword values */ isolation: auto; isolation: isolate; /* global values */ isolation: inherit; isolation: initial; isolation: unset; the isolation property is specified as one of the keyword values listed below.
linear-gradient() - CSS: Cascading Style Sheets
you'll have to set the html height property to 100% or 100vh to render as depicted.
margin-inline-start - CSS: Cascading Style Sheets
formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting inline start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def...
mask-border-mode - CSS: Cascading Style Sheets
syntax /* keyword values */ mask-border-mode: luminance; mask-border-mode: alpha; /* global values */ mask-border-mode: inherit; mask-border-mode: initial; mask-border-mode: unset; values luminance the luminance values of the mask border image are used as the mask values.
mask-composite - CSS: Cascading Style Sheets
/* keyword values */ mask-composite: add; mask-composite: subtract; mask-composite: intersect; mask-composite: exclude; /* global values */ mask-composite: inherit; mask-composite: initial; mask-composite: unset; syntax one or more of the keyword values listed below, separated by commas.
minmax() - CSS: Cascading Style Sheets
WebCSSminmax
as a maximum, a <flex> value sets the flex factor of a grid track; it is invalid as a minimum.
overflow-anchor - CSS: Cascading Style Sheets
syntax /* keyword values */ overflow-anchor: auto; overflow-anchor: none; /* global values */ overflow-anchor: inherit; overflow-anchor: initial; overflow-anchor: unset; values auto the element becomes a potential anchor when adjusting scroll position.
perspective-origin - CSS: Cascading Style Sheets
syntax /* one-value syntax */ perspective-origin: x-position; /* two-value syntax */ perspective-origin: x-position y-position; /* when both x-position and y-position are keywords, the following is also valid */ perspective-origin: y-position x-position; /* global values */ perspective-origin: inherit; perspective-origin: initial; perspective-origin: unset; values x-position indicates the position of the abscissa of the vanishing point.
ruby-align - CSS: Cascading Style Sheets
/* keyword values */ ruby-align: start; ruby-align: center; ruby-align: space-between; ruby-align: space-around; /* global values */ ruby-align: inherit; ruby-align: initial; ruby-align: unset; syntax values start is a keyword indicating that the ruby will be aligned with the start of the base text.
ruby-position - CSS: Cascading Style Sheets
/* keyword values */ ruby-position: over; ruby-position: under; ruby-position: inter-character; /* global values */ ruby-position: inherit; ruby-position: initial; ruby-position: unset; syntax values over is a keyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for vertical scripts.
scroll-snap-align - CSS: Cascading Style Sheets
syntax /* keyword values */ scroll-snap-align: none; scroll-snap-align: start end; /* when two values set first is block, second inline */ scroll-snap-align: center; /* global values */ scroll-snap-align: inherit; scroll-snap-align: initial; scroll-snap-align: unset; values none the box does not define a snap position in that axis.
<string> - CSS: Cascading Style Sheets
WebCSSstring
however, to get new lines, you must also set the white-space property to appropriate value.
text-decoration-skip-ink - CSS: Cascading Style Sheets
syntax /* single keyword */ text-decoration-skip-ink: none; text-decoration-skip-ink: auto; text-decoration-skip-ink: all; /* global keywords */ text-decoration-skip: inherit; text-decoration-skip: initial; text-decoration-skip: unset; values none underlines and overlines are drawn across the full length of the text content, including parts that cross over glyph descenders and ascenders.
text-rendering - CSS: Cascading Style Sheets
/* keyword values */ text-rendering: auto; text-rendering: optimizespeed; text-rendering: optimizelegibility; text-rendering: geometricprecision; /* global values */ text-rendering: inherit; text-rendering: initial; text-rendering: unset; note: the text-rendering property is an svg property that is not defined in any css standard.
matrix3d() - CSS: Cascading Style Sheets
</div> css html { width: 100%; } body { height: 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.
perspective() - CSS: Cascading Style Sheets
the perspective() css function defines a transformation that sets the distance between the user and the z=0 plane, the perspective from which the viewer would be if the 2-dimensional interface were 3-dimensional.
rotate() - CSS: Cascading Style Sheets
this defaults to the center of the element, but you can set your own custom transform origin using the transform-origin property.
scaleZ() - CSS: Cascading Style Sheets
in the above interactive examples, perspective: 550px; (to create a 3d space) and transform-style: preserve-3d; (so the children, the 6 sides of the cube, are also positioned in the 3d space), have been set on the cube.
translate() - CSS: Cascading Style Sheets
the ordinate (vertical, y-coordinate) of the translating vector will be set to 0.
transform - CSS: Cascading Style Sheets
WebCSStransform
1.2, 0.3); transform: scalex(2); transform: scaley(0.5); transform: scalez(0.3); transform: skew(30deg, 20deg); transform: skewx(30deg); transform: skewy(1.07rad); /* multiple function values */ transform: translatex(10px) rotate(10deg) translatey(5px); transform: perspective(500px) translate(10px, 0, 20px) rotatey(3deg); /* global values */ transform: inherit; transform: initial; transform: unset; the transform property may be specified as either the keyword value none or as one or more <transform-function> values.
unicode-bidi - CSS: Cascading Style Sheets
/* keyword values */ unicode-bidi: normal; unicode-bidi: embed; unicode-bidi: isolate; unicode-bidi: bidi-override; unicode-bidi: isolate-override; unicode-bidi: plaintext; /* global values */ unicode-bidi: inherit; unicode-bidi: initial; unicode-bidi: unset; syntax values normal the element does not offer an additional level of embedding with respect to the bidirectional algorithm.
url() - CSS: Cascading Style Sheets
WebCSSurl()
s://example.com/images/myimg.jpg); url(data:image/png;base64,irxvb0…); url(myfont.woff); url(#idofsvgpath); /* associated properties */ background-image: url("https://mdn.mozillademos.org/files/16761/star.gif"); list-style-image: url('../images/bullet.jpg'); content: url("pdficon.jpg"); cursor: url(mycursor.cur); border-image-source: url(/media/diamonds.png); src: url('fantasticfont.woff'); offset-path: url(#path); mask-image: url("masks.svg#mask1"); /* properties with fallbacks */ cursor: url(pointer.cur), pointer; /* associated short-hand properties */ background: url('https://mdn.mozillademos.org/files/16761/star.gif') bottom right repeat-x blue; border-image: url("/media/diamonds.png") 30 fill / 30px / 30px space; /* as a parameter in another css function */ background-image: cross-...
user-modify - CSS: Cascading Style Sheets
/* keyword values */ user-modify: read-only; user-modify: read-write; user-modify: write-only; /* global values */ user-modify: inherit; user-modify: initial; user-modify: unset; this property has been replaced by the contenteditable attribute.
user-select - CSS: Cascading Style Sheets
/* keyword values */ user-select: none; user-select: auto; user-select: text; user-select: contain; user-select: all; /* global values */ user-select: inherit; user-select: initial; user-select: unset; /* mozilla-specific values */ -moz-user-select: none; -moz-user-select: text; -moz-user-select: all; /* webkit-specific values */ -webkit-user-select: none; -webkit-user-select: text; -webkit-user-select: all; /* doesn't work in safari; use only "none" or "text", or else it will allow typing in the <html> container */ /* microsoft-specific values */ -ms-user-select: none; -ms-user-se...
var() - CSS: Cascading Style Sheets
WebCSSvar
examples :root { --main-bg-color: pink; } body { background-color: var(--main-bg-color); } /* fallback */ /* in the component’s style: */ .component .header { color: var(--header-color, blue); /* header-color isn’t set, and so remains blue, the fallback value */ } .component .text { color: var(--text-color, black); } /* in the larger application’s style: */ .component { --text-color: #080; } specifications specification status comment css custom properties for cascading variables module level 1the definition of 'var()' in that specification.
Common (exsl) - EXSLT
WebEXSLTexsl
exsl:node-set()exsl:node-set() returns a node-set from a result tree fragment, which is what you get when you look at the xsl:variable instead of its select attribute to fetch a variable's value.
Math (math) - EXSLT
WebEXSLTmath
math:highest()math:highest() returns the node in the specified node-set with the highest value (where the highest value calculated using math:max()).math:lowest()math:lowest() returns the node in the specified node-set with the lowest value (where the lowest value calculated using math:min()).math:max()math:max() returns the maximum value of a node-set.math:min()math:min() returns the minimum value of a node-set.
regexp:match() - EXSLT
WebEXSLTregexpmatch
returns a node set of match elements, each of which has the string value equal to a portion of the first parameter string as captured by the regular expression.
Strings (str) - EXSLT
WebEXSLTstr
str:concat()str:concat() returns a string containing all the string values in a node-set concatenated together.str:split()str:split() splits a string using a pattern string to determine where the splits should occur, returning a node-set containing the resulting strings.str:tokenize()str:tokenize() splits a string using a set of characters as delimiters that determine where the splits should occur, returning a node-set containing the resulting strings.
Block formatting context - Developer guides
using overflow: auto setting overflow: auto or set other values than the initial value of overflow: visible created a new bfc containing the float.
Creating and triggering events - Developer guides
for example, the event could be created as follows: const event = new customevent('build', { detail: elem.dataset.time }); this will then allow you to access the additional data in the event listener: function eventhandler(e) { console.log('the time is: ' + e.detail); } the old-fashioned way the older approach to creating events uses apis inspired by java.
Event developer guide - Developer guides
WebGuideEvents
two common styles are: the generalized addeventlistener() and a set of specific on-event handlers.media eventsvarious events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful information about using them.mouse gesture eventsgecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures.
Graphics on the Web - Developer guides
static images can easily be displayed using the <img> element, or by setting the background of html elements using the background-image property.
Using HTML sections and outlines - Developer guides
unknown elements are styled as display: inline by default, so you'll want to set them to display: block: article, aside, footer, header, nav, section { display: block; } of course the web developer can style them differently, but keep in mind that in a non-html5 browser, the default styling is different from what is expected for such elements.
XHTML - Developer guides
WebGuideHTMLXHTML
html document content-type: text/html <!doctype html> <html lang=en> <head> <meta charset=utf-8> <title>html</title> </head> <body> <p>i am a html document</p> </body> </html> xhtml document content-type: application/xhtml+xml <?xml version="1.0" encoding="utf-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>xhtml</title> </head> <body> <p>i am a xhtml document</p> </body> </html> in practice, very few "xhtml" documents are served over the web with ...
Index - Developer guides
WebGuideIndex
12 setting up adaptive streaming media sources audio, hls, html5, http live streaming, mpeg-dash, video, adaptive streaming let's say you want to set up an adaptive streaming media source on a server, to be consumed inside an html5 media element.
Introduction to Web development - Developer guides
for another (overlapping) set of links to learning resources, see the mdn learning pages.
Separate sites for mobile and desktop - Developer guides
similarly, this increases the implementation time of any new site features, since you must now code two sets of front-end logic.
Parsing and serializing XML - Developer guides
ntelement.nodename); parsing url-addressable resources into dom trees using xmlhttprequest here is sample code that reads and parses a url-addressable xml file into a dom tree: var xhr = new xmlhttprequest(); xhr.onload = function() { dump(xhr.responsexml.documentelement.nodename); } xhr.onerror = function() { dump("error while getting xml."); } xhr.open("get", "example.xml"); xhr.responsetype = "document"; xhr.send(); the value returned in the xhr object's responsexml field is a document constructed by parsing the xml.
HTML attribute: capture - HTML: Hypertext Markup Language
examples when set on a file input type, operating systems with microphones and cameras will display a user interface allowing the selection from an existing file or the creating of a new one.
HTML attribute: max - HTML: Hypertext Markup Language
WebHTMLAttributesmax
e hh:mm <input type="time" max="17:00" step="900"> datetime-local yyyy-mm-ddthh:mm <input type="datetime-local" min="2019-12-25t23:59"> number <number> <input type="number" min="0" step="5" max="100"> range <number> <input type="range" min="60" step="5" max="100"> note: when the data entered by the user doesn't adhere to the maximum value set, the value is considered invalid in contraint validation and will match the :invalid and :out-of-range pseudoclasses see client-side validation and rangeoverflow for more information.
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
html <p>using <abbr>html</abbr> is fun and easy!</p> result styling abbreviations you can use css to set a custom style to be used for abbreviations, as seen in this simple example.
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
the result will be garbled: 1 - embedded-textst place if you know the directionality of embedded-text in advance, you can fix this problem by wrapping embedded-text in a <span> with the dir attribute set to the known directionality.
<bgsound>: The Background Sound element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementbgsound
the internet explorer only html background sound element (<bgsound>) sets up a sound file to play in the background while the page is used; use <audio> instead.
<br>: The Line Break element - HTML: Hypertext Markup Language
WebHTMLElementbr
you can set a margin on <br> elements themselves to increase the spacing between the lines of text in the block, but this is a bad practice — you should use the line-height property that was designed for that purpose.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
it is better to specify your canvas dimensions by setting the width and height attributes directly on the <canvas> elements, either directly in the html or by using javascript.
<center>: The Centered Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcenter
for centering blocks, use other css properties like margin-left and margin-right and set them to auto (or set margin to 0 auto).
<code>: The Inline Code element - HTML: Hypertext Markup Language
WebHTMLElementcode
preferences set by the user might take precedence over the specified css.
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
WebHTMLElementdatalist
the html <datalist> element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls.
<dd>: The Description Details element - HTML: Hypertext Markup Language
WebHTMLElementdd
nowrap if the value of this attribute is set to yes, the definition text will not wrap.
<del>: The Deleted Text element - HTML: Hypertext Markup Language
WebHTMLElementdel
del::before, del::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } del::before { content: " [deletion start] "; } del::after { content: " [deletion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
the <em> element represents stress emphasis of its contents, while the <i> element represents text that is set off from the normal prose, such a foreign word, fictional character thoughts, or when the text refers to the definition of a word instead of representing its semantic meaning.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
without it, screen readers will typically default to the operating system's set language, which may cause mispronunciations.
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
disabling and enabling a submit button to disable a submit button, simply specify the disabled global attribute on it, like so: <input type="submit" value="disabled" disabled> you can enable and disable buttons at run time by simply setting disabled to true or false; in javascript this looks like btn.disabled = true or btn.disabled = false.
<ins> - HTML: Hypertext Markup Language
WebHTMLElementins
ins::before, ins::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } ins::before { content: " [insertion start] "; } ins::after { content: " [insertion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
if a form, or a section of a form needs a title, use the <legend> element placed within a <fieldset>.
<li> - HTML: Hypertext Markup Language
WebHTMLElementli
list items that follow this one continue numbering from the value set.
<main> - HTML: Hypertext Markup Language
WebHTMLElementmain
content that is repeated across a set of documents or document sections such as sidebars, navigation links, copyright information, site logos, and search forms shouldn't be included unless the search form is the main function of the page.
<mark>: The Mark Text element - HTML: Hypertext Markup Language
WebHTMLElementmark
mark::before, mark::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } mark::before { content: " [highlight start] "; } mark::after { content: " [highlight end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
WebHTMLElementmeter
if this attribute is not set, the <button> is associated with its ancestor <form> element, if any.
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
type sets the numbering type: a for lowercase letters a for uppercase letters i for lowercase roman numerals i for uppercase roman numerals 1 for numbers (default) the specified type is used for the entire list unless a different type attribute is used on an enclosed <li> element.
<optgroup> - HTML: Hypertext Markup Language
WebHTMLElementoptgroup
disabled if this boolean attribute is set, none of the items in this option group is selectable.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
WebHTMLElementparam
deprecated attributes type only used if the valuetype is set to ref.
<s> - HTML: Hypertext Markup Language
WebHTMLElements
s::before, s::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } s::before { content: " [start of stricken text] "; } s::after { content: " [end of stricken text] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
type this attribute sets the bullet style for the list.
contenteditable - HTML: Hypertext Markup Language
you can set the color used to draw the text insertion caret with the css caret-color property.
hidden - HTML: Hypertext Markup Language
browsers won't render elements with the hidden attribute set.
tabindex - HTML: Hypertext Markup Language
if you set the tabindex attribute on a <div>, then its child content cannot be scrolled with the arrow keys unless you set tabindex on the content, too.
title - HTML: Hypertext Markup Language
if this attribute is set to the empty string, it means its ancestors' titles are irrelevant and shouldn't be used in the tooltip for this element.
Link types: noopener - HTML: Hypertext Markup Language
the noopener keyword for the rel attribute of the <a>, <area>, and <form> elements instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it — by not setting the window.opener property on the opened window (it returns null).
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
to ensure that your page uses full standards mode, make sure that your page has a doctype like in this example: <!doctype html> <html lang="en"> <head> <meta charset=utf-8> <title>hello world!</title> </head> <body> </body> </html> the doctype shown in the example, <!doctype html>, is the simplest possible, and the one recommended by html5.
HTTP authentication - HTTP
as both resource authentication and proxy authentication can coexist, a different set of headers and status codes is needed.
Resource URLs - HTTP
in the past, web content was able to access whatever resource: uris were desired — not only firefox’s internal resources, but also extensions’ assets.
Basics of HTTP - HTTP
content negotiation http introduces a set of headers, starting with accept as a way for a browser to announce the format, language, or encoding it prefers.
Reason: CORS header 'Access-Control-Allow-Origin' does not match 'xyz' - HTTP
header set access-control-allow-origin 'origin-list' for nginx, the command to set up this header is: add_header 'access-control-allow-origin' 'origin-list' ...
Reason: CORS disabled - HTTP
WebHTTPCORSErrorsCORSDisabled
setting this to true disables cors, so whenever that's the case, cors requests will always fail with this error.
Compression in HTTP - HTTP
in the 1990s, compression technology was advancing at a rapid pace and numerous successive algorithms have been added to the set of possible choices.
List of default Accept values - HTTP
edge text/html, application/xhtml+xml, image/jxr, */* opera text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/webp, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 values for an image when requesting an image, like through an html <img> element, user-agent often sets a specific list of media types to be welcomed.
Accept-CH-Lifetime - HTTP
the accept-ch-lifetime header is set by the server to specify the persistence of accept-ch header value that specifies for which client hints headers client should include in subsequent requests.
Accept-CH - HTTP
the accept-ch header is set by the server to specify which client hints headers a client should include in subsequent requests.
Accept-Encoding - HTTP
as long as the identity value, meaning no encoding, is not explicitly forbidden, by an identity;q=0 or a *;q=0 without another explicitly set value for identity, the server must never send back a 406 not acceptable error.
Accept-Language - HTTP
browsers set adequate values for this header according to their user interface language and even if a user can change it, this happens rarely (and is frowned upon as it leads to fingerprinting).
Accept-Patch - HTTP
header type response header forbidden header name yes syntax accept-patch: application/example, text/example accept-patch: text/example;charset=utf-8 accept-patch: application/merge-patch+json directives none examples accept-patch: application/example, text/example accept-patch: text/example;charset=utf-8 accept-patch: application/merge-patch+json specifications specification title rfc 5789, section 3.1: accept-patch http patch ...
Accept - HTTP
WebHTTPHeadersAccept
browsers set adequate values for this header depending on the context where the request is done: when fetching a css stylesheet a different value is set for the request than when fetching an image, video or a script.
Access-Control-Allow-Origin - HTTP
he browser to allow code from any origin to access a resource will include the following: access-control-allow-origin: * a response that tells the browser to allow requesting code from the origin https://developer.mozilla.org to access a resource will include the following: access-control-allow-origin: https://developer.mozilla.org limiting the possible access-control-allow-origin values to a set of allowed origins requires code on the server side to check the value of the origin request header, compare that to a list of allowed origins, and then if the origin value is in the list, to set the access-control-allow-origin value to the same value as the origin value.
Allow - HTTP
WebHTTPHeadersAllow
the allow header lists the set of methods supported by a resource.
Content-Encoding - HTTP
compression highly depends on server settings and used server modules.
Content-Language - HTTP
for example, if "content-language: de-de" is set, it says that the document is intended for german language speakers (however, it doesn't indicate the document is written in german.
CSP: referrer - HTTP
carefully consider the impact of this setting.
CSP: report-uri - HTTP
$log_file; mail($email_address, $email_subject, $message, 'content-type: text/plain;charset=utf-8'); } else if (filesize($log_file) > $log_file_size_limit) { exit(0); } file_put_contents($log_file, $json_data, file_append | lock_ex); } specifications specification status comment content security policy level 3the definition of 'report-uri' in that specification.
CSP: require-sri-for - HTTP
examples if you set your site to require sri for script and styles using this directive: content-security-policy: require-sri-for script style <script> elements like the following will be loaded as they use a valid integrity attribute.
CSP: trusted-types - HTTP
the http content-security-policy (csp) trusted-types directive instructs user agents to restrict usage of known dom xss sinks to a predefined set of functions that only accept non-spoofable, typed values in place of strings.
Feature-Policy: picture-in-picture - HTTP
default policy as of june 2019, the spec draft and google chrome set default allow list to *.
Feature-Policy: sync-xhr - HTTP
default policy by default the policy is set to *, which means synchronous requests are allowed in all frames.
Origin - HTTP
WebHTTPHeadersOrigin
note: the origin header is not set on fetch requests with a method of head or get (this behavior was corrected in firefox 65 — see bug 1508661).
Upgrade - HTTP
WebHTTPHeadersUpgrade
for example, the client might send a get request as shown, listing the preferred protocols to switch to (in this case "example/1" and "foo/2"): get /index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 note: connection: upgrade must be set whenever upgrade is sent.
Vary - HTTP
WebHTTPHeadersVary
the vary header should be set on a 304 not modified response exactly like it would have been set on an equivalent 200 ok response.
Warning - HTTP
WebHTTPHeadersWarning
code text description 110 response is stale a response provided by a cache is stale (the expiration time set for it has passed).
X-XSS-Protection - HTTP
example block pages from loading when they detect reflected xss attacks: x-xss-protection: 1; mode=block php header("x-xss-protection: 1; mode=block"); apache (.htaccess) <ifmodule mod_headers.c> header set x-xss-protection "1; mode=block" </ifmodule> nginx add_header "x-xss-protection" "1; mode=block"; specifications not part of any specifications or drafts.
PATCH - HTTP
WebHTTPMethodsPATCH
a patch request is considered a set of instructions on how to modify a resource.
HTTP request methods - HTTP
WebHTTPMethods
http defines a set of request methods to indicate the desired action to be performed for a given resource.
Protocol upgrade mechanism - HTTP
in essence, then, this key simply confirms that "yes, i really mean to open a websocket connection." this header is automatically added by clients that choose to use it; it cannot be added using the xmlhttprequest.setrequestheader() method.
HTTP resources and specifications - HTTP
draft spec http client hints ietf draft rfc 7578 returning values from forms: multipart/form-data proposed standard rfc 6266 use of the content-disposition header field in the hypertext transfer protocol (http) proposed standard rfc 2183 communicating presentation information in internet messages: the content-disposition header field only a subset of syntax of the content-disposition header can be used in the context of http messages.
302 Found - HTTP
WebHTTPStatus302
it is therefore recommended to set the 302 code only as a response for get or head methods and to use 307 temporary redirect instead, as the method change is explicitly prohibited in that case.
406 Not Acceptable - HTTP
WebHTTPStatus406
proactive content negotiation headers include: accept accept-charset accept-encoding accept-language in practice, this error is very rarely used.
HTTP response status codes - HTTP
WebHTTPStatus
205 reset content tells the user-agent to reset the document which sent this request.
CSS Houdini
houdini is a set of low-level apis that exposes parts of the css engine, giving developers the power to extend css by hooking into the styling and layout process of a browser’s rendering engine.
Enumerability and ownership of properties - JavaScript
enumerable properties are those properties whose internal enumerable flag is set to true, which is the default for properties created via simple assignment or via a property initializer (properties defined via object.defineproperty and such default enumerable to false).
Loops and iteration - JavaScript
for...of statement the for...of statement creates a loop iterating over iterable objects (including array, map, set, arguments object and so on), invoking a custom iteration hook with statements to be executed for the value of each distinct property.
JavaScript Guide - JavaScript
comparisons arithmetic operators bitwise & logical operators conditional (ternary) operator numbers and dates number literals number object math object date object text formatting string literals string object template literals internationalization regular expressions indexed collections arrays typed arrays keyed collections map weakmap set weakset working with objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iterators and generators iterators iterables generators meta programming pro...
Memory Management - JavaScript
this algorithm assumes the knowledge of a set of objects called roots.
Private class fields - JavaScript
private getters and setters are also possible: class classwithprivateaccessor { #message get #decoratedmessage() { return `✨${this.#message}✨` } set #decoratedmessage(msg) { this.#message = msg } constructor() { this.#decoratedmessage = 'hello world' console.log(this.#decoratedmessage) } } new classwithprivateaccessor(); // expected output: "✨hello worl​d✨" specifications ...
Classes - JavaScript
if you want to inherit from a regular object, you can instead use object.setprototypeof(): const animal = { speak() { console.log(`${this.name} makes a noise.`); } }; class dog { constructor(name) { this.name = name; } } // if you do not do this you will get a typeerror when you invoke speak object.setprototypeof(dog.prototype, animal); let d = new dog('mitzie'); d.speak(); // mitzie makes a noise.
Deprecated and obsolete features - JavaScript
date methods getyear and setyear are affected by the year-2000-problem and have been subsumed by getfullyear and setfullyear.
TypeError: can't redefine non-configurable property "x" - JavaScript
var obj = object.create({}); object.defineproperty(obj, "foo", {value: "bar"}); object.defineproperty(obj, "foo", {value: "baz"}); // typeerror: can't redefine non-configurable property "foo" you will need to set the "foo" property to configurable, if you intend to redefine it later in the code.
TypeError: cyclic object value - JavaScript
the snippet below illustrates how to find and filter (thus causing data loss) a cyclic reference by using the replacer parameter of json.stringify(): const getcircularreplacer = () => { const seen = new weakset(); return (key, value) => { if (typeof value === "object" && value !== null) { if (seen.has(value)) { return; } seen.add(value); } return value; }; }; json.stringify(circularreference, getcircularreplacer()); // {"otherdata":123} ...
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
delete x; // syntaxerror: applying the 'delete' operator to an unqualified name // is deprecated to free the contents of a variable, you can set it to null: 'use strict'; var x; // ...
Warning: expression closures are deprecated - JavaScript
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
//# 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 ...
SyntaxError: test for equality (==) mistyped as assignment (=)? - JavaScript
error type (firefox only) syntaxerror warning which is reported only if javascript.options.strict preference is set to true.
TypeError: invalid assignment to const "x" - JavaScript
const columns = 80; function setupbigscreenenvironment() { const columns = 120; } const and immutability the const declaration creates a read-only reference to a value.
SyntaxError: for-in loop head declarations may not have initializers - JavaScript
the for loop allows you to set an initializer then as well: var arr = [ "a", "b", "c" ] for (var i = 2; i < arr.length; i++) { console.log(arr[i]); } // "c" ...
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
maybe you intended to make 50 an offset value, in that case you could add it to the loop body, for example.
SyntaxError: missing formal parameter - JavaScript
examples provide proper function parameters function parameters must be identifiers when setting up a function.
TypeError: can't delete non-configurable array element - JavaScript
var arr = []; object.defineproperty(arr, 0, {value: 0}); object.defineproperty(arr, 1, {value: "1"}); arr.length = 1; // typeerror: can't delete non-configurable array element you will need to set the elements as configurable, if you intend to shorten the array.
TypeError: "x" is not a function - JavaScript
you will have to provide a function in order to have these methods working properly: when working with array or typedarray objects: array.prototype.every(), array.prototype.some(), array.prototype.foreach(), array.prototype.map(), array.prototype.filter(), array.prototype.reduce(), array.prototype.reduceright(), array.prototype.find() when working with map and set objects: map.prototype.foreach() and set.prototype.foreach() examples a typo in the function name in this case, which happens way too often, there is a typo in the method name: let x = document.getelementbyid('foo'); // typeerror: document.getelementbyid is not a function the correct function name is getelementbyid: let x = document.getelementbyid('foo'); function called on t...
ReferenceError: reference to undefined property "x" - JavaScript
message referenceerror: reference to undefined property "x" (firefox) error type (firefox only) referenceerror warning which is reported only if javascript.options.strict preference is set to true.
TypeError: 'x' is not iterable - JavaScript
var obj = { 'france': 'paris', 'england': 'london' }; // iterate over the property names: for (let country of object.keys(obj)) { var capital = obj[country]; console.log(country, capital); } for (const [country, capital] of object.entries(obj)) console.log(country, capital); another option for this use case might be to use a map: var map = new map; map.set('france', 'paris'); map.set('england', 'london'); // iterate over the property names: for (let country of map.keys()) { let capital = map[country]; console.log(country, capital); } for (let capital of map.values()) console.log(capital); for (const [country, capital] of map.entries()) console.log(country, capital); iterating over a generator generators are functions you call t...
JavaScript error reference - JavaScript
rable array elementtypeerror: can't redefine non-configurable property "x"typeerror: cannot use "in" operator to search for "x" in "y"typeerror: cyclic object valuetypeerror: invalid "instanceof" operand "x"typeerror: invalid array.prototype.sort argumenttypeerror: invalid argumentstypeerror: invalid assignment to const "x"typeerror: property "x" is non-configurable and can't be deletedtypeerror: setting getter-only property "x"typeerror: variable "x" redeclares argumenturierror: malformed uri sequencewarning: 08/09 is not a legal ecma-262 octal constantwarning: -file- is being assigned a //# sourcemappingurl, but already has onewarning: date.prototype.tolocaleformat is deprecatedwarning: javascript 1.6's for-each-in loops are deprecatedwarning: string.x is deprecated; use string.prototype.x ...
The arguments object - JavaScript
for example, if a function is passed 3 arguments, you can access them as follows: arguments[0] // first argument arguments[1] // second argument arguments[2] // third argument each argument can also be set or reassigned: arguments[1] = 'new value'; the arguments object is not an array.
Array.prototype[@@unscopables] - JavaScript
description the default array properties that are excluded from with bindings are: copywithin() entries() fill() find() findindex() includes() keys() values() see symbol.unscopables for how to set unscopables for your own objects.
Array.prototype.reduce() - JavaScript
ntained in initialvalue let allbooks = friends.reduce(function(accumulator, currentvalue) { return [...accumulator, ...currentvalue.books] }, ['alphabet']) // allbooks = [ // 'alphabet', 'bible', 'harry potter', 'war and peace', // 'romeo and juliet', 'the lord of the rings', // 'the shining' // ] remove duplicate items in an array note: if you are using an environment compatible with set and array.from(), you could use let orderedarray = array.from(new set(myarray)) to get an array where duplicate items have been removed.
Array.prototype.find() - JavaScript
if so, the elements processed by find are set before the first invocation of callback.
Array.prototype.findIndex() - JavaScript
the range of elements processed by findindex() is set before the first invocation of callback.
Array.prototype.forEach() - JavaScript
the range of elements processed by foreach() is set before the first invocation of callback.
Array.prototype.indexOf() - JavaScript
if the provided index value is a negative number, it is taken as the offset from the end of the array.
Array.prototype.lastIndexOf() - JavaScript
if negative, it is taken as the offset from the end of the array.
Array.prototype.some() - JavaScript
the range of elements processed by some() is set before the first invocation of callback.
Array.prototype.splice() - JavaScript
if greater than the length of the array, start will be set to the length of the array.
Array.prototype.unshift() - JavaScript
see example: let arr = [4, 5, 6] arr.unshift(1, 2, 3) console.log(arr); // [1, 2, 3, 4, 5, 6] arr = [4, 5, 6] // resetting the array arr.unshift(1) arr.unshift(2) arr.unshift(3) console.log(arr) // [3, 2, 1, 4, 5, 6] examples using unshift let arr = [1, 2] arr.unshift(0) // result of the call is 3, which is the new array length // arr is [0, 1, 2] arr.unshift(-2, -1) // the new array length is 5 // arr is [-2, -1, 0, 1, 2] arr.unshift([-4, -3]) // the new array length is 6 /...
ArrayBuffer.prototype.byteLength - JavaScript
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
AsyncFunction - JavaScript
examples creating an async function from an asyncfunction() constructor function resolveafter2seconds(x) { return new promise(resolve => { settimeout(() => { resolve(x); }, 2000); }); } let asyncfunction = object.getprototypeof(async function(){}).constructor let a = new asyncfunction('a', 'b', 'return await resolveafter2seconds(a) + await resolveafter2seconds(b);'); a(10, 20).then(v => { console.log(v); // prints 30 after 4 seconds }); specifications speci...
DataView.prototype.buffer - JavaScript
description the buffer property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
Date.now() - JavaScript
engines which have not been updated to support this method can work around the absence of this method using the following shim: if (!date.now) { date.now = function now() { return new date().gettime(); }; } examples reduced time precision to offer protection against timing attacks and fingerprinting, the precision of date.now() might get rounded depending on browser settings.
Date.prototype.toGMTString() - JavaScript
examples simple example in this example, the togmtstring() method converts the date to gmt (utc) using the operating system's time-zone offset and returns a string value that is similar to the following form.
Date.prototype.toISOString() - JavaScript
the timezone is always zero utc offset, as denoted by the suffix "z".
Error.prototype.message - JavaScript
description this property contains a brief description of the error if one is available or has been set.
Error - JavaScript
function customerror(foo, message, filename, linenumber) { var instance = new error(message, filename, linenumber); instance.name = 'customerror'; instance.foo = foo; object.setprototypeof(instance, object.getprototypeof(this)); if (error.capturestacktrace) { error.capturestacktrace(instance, customerror); } return instance; } customerror.prototype = object.create(error.prototype, { constructor: { value: error, enumerable: false, writable: true, configurable: true } }); if (object.setprototypeof){ object.setprototypeof(customerror, error...
Function.displayName - JavaScript
examples setting a displayname it is usually preferred by consoles and profilers over func.name to display the name of a function.
Function.prototype.toString() - JavaScript
"function* g(){}" a => a "a => a" ({ a(){} }.a) "a(){}" ({ *a(){} }.a) "*a(){}" ({ [0](){} }[0]) "[0](){}" object.getownpropertydescriptor({ get a(){} }, "a").get "get a(){}" object.getownpropertydescriptor({ set a(x){} }, "a").set "set a(x){}" function.prototype.tostring "function tostring() { [native code] }" (function f(){}.bind(0)) "function () { [native code] }" function("a", "b") "function anonymous(a\n) {\nb\n}" specifications specification ecmascript (ecma-262)...
Generator.prototype.return() - JavaScript
if an argument is provided, it will be set to the value of the value property of the returned object.
InternalError - JavaScript
function loop(x) { if (x >= 10) // "x >= 10" is the exit condition return; // do stuff loop(x + 1); // the recursive call } loop(0); setting this condition to an extremely high value, won't work: function loop(x) { if (x >= 1000000000000) return; // do stuff loop(x + 1); } loop(0); // internalerror: too much recursion for more information, see internalerror: too much recursion.
Intl.DateTimeFormat() constructor - JavaScript
implementations are required to support at least the following subsets: weekday, year, month, day, hour, minute, second weekday, year, month, day year, month, day year, month month, day hour, minute, second hour, minute implementations may support other subsets, and requests will be negotiated against all available subset-representation combinations to find the best match.
Intl.DateTimeFormat.prototype.format() - JavaScript
var a = [new date(2012, 08), new date(2012, 11), new date(2012, 03)]; var options = { year: 'numeric', month: 'long' }; var datetimeformat = new intl.datetimeformat('pt-br', options); var formatted = a.map(datetimeformat.format); console.log(formatted.join('; ')); // → "setembro de 2012; dezembro de 2012; abril de 2012" avoid comparing formatted date values to static values most of the time, the formatting returned by format() is consistent.
Intl.DateTimeFormat - JavaScript
use the browser's default locale, use 'default' console.log(new intl.datetimeformat('default', options).format(date)); // → "12/19/2012, 19:00:00" // sometimes it's helpful to include the period of the day options = {hour: "numeric", dayperiod: "short"}; console.log(new intl.datetimeformat('en-us', options).format(date)); // → 10 at night the used calendar and numbering formats can also be set independently via options arguments: var options = {calendar: 'chinese', numberingsystem: 'arab'}; var dateformat = new intl.datetimeformat('default', options); var usedoptions = dateformat.resolvedoptions(); console.log(usedoptions.calendar); // → "chinese" console.log(usedoptions.numberingsystem); // → "arab" console.log(usedoptions.timezone); // → "america/new_york" (the users defaul...
Intl.Locale() constructor - JavaScript
for example, set the hourcycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor: let us12hour = new intl.locale("en-us", {hourcycle: "h12"}); console.log(us12hour.hourcycle); // prints "h12" specifications specification ecmascript internationalization api (ecma-402) ...
Intl.Locale.prototype.calendar - JavaScript
set the calendar property of the configuration object to your desired calendar era, and then pass it into the constructor.
Intl.Locale.prototype.hourCycle - JavaScript
set the hourcycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor.
Intl.Locale.prototype.language - JavaScript
examples setting the language in the locale identifer string argument in order to be a valid unicode locale identifier, a string must start with the language subtag.
Intl.Locale - JavaScript
for example, set the hourcycle property of the configuration object to your desired hour cycle type, and then pass it into the constructor: let us12hour = new intl.locale("en-us", {hourcycle: "h12"}); console.log(us12hour.hourcycle); // prints "h12" specifications specification ecmascript internationalization api (ecma-402) ...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
this property is only present if the notation is set to "compact".
Intl.PluralRules() constructor - JavaScript
var pr = new intl.pluralrules(); pr.select(0); // → 'other' if in us english locale pr.select(1); // → 'one' if in us english locale pr.select(2); // → 'other' if in us english locale using options the results can be customized using the options argument, which has one property called type which you can set to ordinal.
Intl - JavaScript
each constructor or function supports only a subset of the keys defined for the unicode extension, and the supported values often depend on the language tag.
Map.prototype[@@iterator]() - JavaScript
examples using [@@iterator]() const mymap = new map() mymap.set('0', 'foo') mymap.set(1, 'bar') mymap.set({}, 'baz') const mapiter = mymap[symbol.iterator]() console.log(mapiter.next().value) // ["0", "foo"] console.log(mapiter.next().value) // [1, "bar"] console.log(mapiter.next().value) // [object, "baz"] using [@@iterator]() with for..of const mymap = new map() mymap.set('0', 'foo') mymap.set(1, 'bar') mymap.set({}, 'baz') for (const entry of mymap) ...
Map.prototype.clear() - JavaScript
examples using clear() var mymap = new map(); mymap.set('bar', 'baz'); mymap.set(1, 'foo'); mymap.size; // 2 mymap.has('bar'); // true mymap.clear(); mymap.size; // 0 mymap.has('bar') // false specifications specification ecmascript (ecma-262)the definition of 'map.prototype.clear' in that specification.
Map.prototype.delete() - JavaScript
examples using delete() var mymap = new map(); mymap.set('bar', 'foo'); mymap.delete('bar'); // returns true.
Map.prototype.entries() - JavaScript
examples using entries() let mymap = new map() mymap.set('0', 'foo') mymap.set(1, 'bar') mymap.set({}, 'baz') let mapiter = mymap.entries() console.log(mapiter.next().value) // ["0", "foo"] console.log(mapiter.next().value) // [1, "bar"] console.log(mapiter.next().value) // [object, "baz"] specifications specification ecmascript (ecma-262)the definition of 'map.prototype.entries' in that specification.
Map.prototype.get() - JavaScript
examples using get() let mymap = new map(); mymap.set('bar', 'foo'); mymap.get('bar'); // returns "foo" mymap.get('baz'); // returns undefined specifications specification ecmascript (ecma-262)the definition of 'map.prototype.get' in that specification.
Map.prototype.has() - JavaScript
examples using has() let mymap = new map() mymap.set('bar', "foo") mymap.has('bar') // returns true mymap.has('baz') // returns false specifications specification ecmascript (ecma-262)the definition of 'map.prototype.has' in that specification.
Map.prototype.keys() - JavaScript
examples using keys() var mymap = new map(); mymap.set('0', 'foo'); mymap.set(1, 'bar'); mymap.set({}, 'baz'); var mapiter = mymap.keys(); console.log(mapiter.next().value); // "0" console.log(mapiter.next().value); // 1 console.log(mapiter.next().value); // object specifications specification ecmascript (ecma-262)the definition of 'map.prototype.keys' in that specification.
Map.prototype.values() - JavaScript
examples using values() var mymap = new map(); mymap.set('0', 'foo'); mymap.set(1, 'bar'); mymap.set({}, 'baz'); var mapiter = mymap.values(); console.log(mapiter.next().value); // "foo" console.log(mapiter.next().value); // "bar" console.log(mapiter.next().value); // "baz" specifications specification ecmascript (ecma-262)the definition of 'map.prototype.values' in that specification.
Math.clz32() - JavaScript
the ctrz function below fills in all the high bits with the lowest filled bit, then negates the bits to erase all higher set bits so that clz can then be used.
Math.fround() - JavaScript
internally, javascript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to 0.
Math.random() - JavaScript
the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
Math.random() - JavaScript
the implementation selects the initial seed to the random number generation algorithm; it cannot be chosen or reset by the user.
Number.NEGATIVE_INFINITY - JavaScript
when the if statement executes, smallnumber has the value -infinity, so smallnumber is set to a more manageable value before continuing.
Number.POSITIVE_INFINITY - JavaScript
when the if statement executes, bignumber has the value infinity, so bignumber is set to a more manageable value before continuing.
Object.assign() - JavaScript
it uses [[get]] on the source and [[set]] on the target, so it will invoke getters and setters.
Object.getOwnPropertySymbols() - JavaScript
as all objects have no own symbol properties initially, object.getownpropertysymbols() returns an empty array unless you have set symbol properties on your object.
Object.prototype.hasOwnProperty() - JavaScript
perty name hasownproperty; thus, if the possibility exists that an object might have a property with this name, it is necessary to use an external hasownproperty to get correct results: var foo = { hasownproperty: function() { return false; }, bar: 'here be dragons' }; foo.hasownproperty('bar'); // always returns false // use another object's hasownproperty // and call it with 'this' set to foo ({}).hasownproperty.call(foo, 'bar'); // true // it's also possible to use the hasownproperty property // from the object prototype for this purpose object.prototype.hasownproperty.call(foo, 'bar'); // true note that in the last case there are no newly created objects.
Object.isFrozen() - JavaScript
description an object is frozen if and only if it is not extensible, all its properties are non-configurable, and all its data properties (that is, properties which are not accessor properties with getter or setter components) are non-writable.
Object.seal() - JavaScript
this has the effect of making the set of properties on the object fixed and immutable.
Object.prototype.toString() - JavaScript
by using radix you can also convert base 10 numbers (like 1,2,3,4,5,.........) to another base numbers, in example below we are converting base 10 number to a base 2 (binary) number let basetenint = 10; console.log(basetenint.tostring(2)); // expected output is "1010" and same for big integers let bignum = bigint(20); console.log(bignum.tostring(2)); // expected output is "10100" some common radix are 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers.
Object.prototype.valueOf() - JavaScript
bertype.prototype.valueof = function() { return this.number; }; var myobj = new mynumbertype(4); myobj + 3; // 7 using unary plus +"5" // 5 (string to number) +"" // 0 (string to number) +"1 + 2" // nan (doesn't evaluate) +new date() // same as (new date()).gettime() +"foo" // nan (string to number) +{} // nan +[] // 0 (tostring() returns an empty string list) +[1] // 1 +[1,2] // nan +new set([1]) // nan +bigint(1) // uncaught typeerror: cannot convert a bigint value to a number +undefined // nan +null // 0 +true // 1 +false // 0 specifications specification ecmascript (ecma-262)the definition of 'object.prototype.valueof' in that specification.
Promise.prototype.catch() - JavaScript
t fired due to the catch'); }); gotchas when throwing errors // throwing an error will call the catch method most of the time var p1 = new promise(function(resolve, reject) { throw new error('uh-oh!'); }); p1.catch(function(e) { console.error(e); // "uh-oh!" }); // errors thrown inside asynchronous functions will act like uncaught errors var p2 = new promise(function(resolve, reject) { settimeout(function() { throw new error('uncaught exception!'); }, 1000); }); p2.catch(function(e) { console.error(e); // this is never called }); // errors thrown after resolve is called will be silenced var p3 = new promise(function(resolve, reject) { resolve(); throw new error('silenced exception!'); }); p3.catch(function(e) { console.error(e); // this is never called }); if it ...
handler.defineProperty() - JavaScript
rue; } }); const desc = { configurable: true, enumerable: true, value: 10 }; object.defineproperty(p, 'a', desc); // "called: a" when calling object.defineproperty() or reflect.defineproperty(), the descriptor passed to defineproperty() trap has one restriction—only following properties are usable (non-standard properties will be ignored): enumerable configurable writable value get set const p = new proxy({}, { defineproperty(target, prop, descriptor) { console.log(descriptor); return reflect.defineproperty(target, prop, descriptor); } }); object.defineproperty(p, 'name', { value: 'proxy', type: 'custom' }); // { value: 'proxy' } specifications specification ecmascript (ecma-262)the definition of '[[defineownproperty]]' in that speci...
RangeError() constructor - JavaScript
the rangeerror() constructor creates an error when a value is not in the set or range of allowed values.
RangeError - JavaScript
the rangeerror object indicates an error when a value is not in the set or range of allowed values.
Reflect.preventExtensions() - JavaScript
return value a boolean indicating whether or not the target was successfully set to prevent extensions.
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).
RegExp.prototype.sticky - JavaScript
examples using a regular expression with the sticky flag var str = '#foo#'; var regex = /foo/y; regex.lastindex = 1; regex.test(str); // true regex.lastindex = 5; regex.test(str); // false (lastindex is taken into account with sticky flag) regex.lastindex; // 0 (reset after match failure) anchored sticky flag for several versions, firefox's spidermonkey engine had a bug with regard to the ^ assertion and the sticky flag which allowed expressions starting with the ^ assertion and using the sticky flag to match when they shouldn't.
RegExp - JavaScript
let str = '#foo#' let regex = /foo/y regex.lastindex = 1 regex.test(str) // true regex.lastindex = 5 regex.test(str) // false (lastindex is taken into account with sticky flag) regex.lastindex // 0 (reset after match failure) the difference between the sticky flag and the global flag with the sticky flag y, the next match has to happen at the lastindex position, while with the global flag g, the match can happen at the lastindex position or later: re = /\d/y; while (r = re.exec("123 456")) console.log(r, "and re.lastindex", re.lastindex); // [ '1', index: 0, input: '123 456', groups: undefined...
SharedArrayBuffer.prototype.byteLength - JavaScript
description the bytelength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
SharedArrayBuffer - JavaScript
for top-level documents, two headers will need to be set to cross-origin isolate your site: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp to check if cross origin isolation has been successful, you can test against the crossorig...
String.prototype.charAt() - JavaScript
the string object's charat() method returns a new string consisting of the single utf-16 code unit located at the specified offset into the string.
String.fromCharCode() - JavaScript
however, this set of characters, known as the base multilingual plane (bmp), is only 1/17th of the total addressable unicode code points.
String.prototype.indexOf() - JavaScript
const mystring = 'brie, pepper jack, cheddar' const mycapstring = 'brie, pepper jack, cheddar' console.log('mystring.indexof("cheddar") is ' + mystring.indexof('cheddar')) // logs 19 console.log('mycapstring.indexof("cheddar") is ' + mycapstring.indexof('cheddar')) // logs -1 using indexof() to count occurrences of a letter in a string the following example sets count to the number of occurrences of the letter e in the string str: const str = 'to be, or not to be, that is the question.' let count = 0 let position = str.indexof('e') while (position !== -1) { count++ position = str.indexof('e', position + 1) } console.log(count) // displays 4 specifications specification ecmascript (ecma-262)the definition of 'string.proto...
String.prototype.match() - JavaScript
if you want to obtain capture groups and the global flag is set, you need to use regexp.exec() or string.prototype.matchall() instead.
String.prototype.toUpperCase() - JavaScript
examples basic usage console.log('alphabet'.touppercase()); // 'alphabet' conversion of non-string this values to strings this method will convert any non-string value to a string, when you set its this to a value that is not a string: const a = string.prototype.touppercase.call({ tostring: function tostring() { return 'abcdef'; } }); const b = string.prototype.touppercase.call(true); // prints out 'abcdef true'.
String - JavaScript
they are of limited use, as they provide only a subset of the available html tags and attributes.
Symbol.iterator - JavaScript
the built-in types with a @@iterator method are: array.prototype[@@iterator]() typedarray.prototype[@@iterator]() string.prototype[@@iterator]() map.prototype[@@iterator]() set.prototype[@@iterator]() see also iteration protocols for more information.
Symbol.toStringTag - JavaScript
and more custom classes default to object tag when creating your own class, javascript defaults to the "object" tag: class validatorclass {} object.prototype.tostring.call(new validatorclass()); // "[object object]" custom tag with tostringtag now, with the help of tostringtag, you are able to set your own custom tag: class validatorclass { get [symbol.tostringtag]() { return 'validator'; } } object.prototype.tostring.call(new validatorclass()); // "[object validator]" tostringtag available on all dom prototype objects due to a webidl spec change in mid-2020, browsers are adding a symbol.tostringtag property to all dom prototype objects.
TypedArray.prototype.buffer - JavaScript
description the buffer property is an accessor property whose set accessor function is undefined, meaning that you can only read this property.
TypedArray.prototype.copyWithin() - JavaScript
examples using copywithin var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.set([1,2,3]); console.log(uint8); // uint8array [ 1, 2, 3, 0, 0, 0, 0, 0 ] uint8.copywithin(3,0,3); console.log(uint8); // uint8array [ 1, 2, 3, 1, 2, 3, 0, 0 ] specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.copywithin' in that specification.
TypedArray.prototype.filter() - JavaScript
the range of elements processed by filter() is set before the first invocation of callback.
TypedArray.prototype.find() - JavaScript
the range of elements processed by find is set before the first invocation of callback.
TypedArray.prototype.findIndex() - JavaScript
the range of elements processed by findindex is set before the first invocation of callback.
TypedArray.prototype.forEach() - JavaScript
the range of elements processed by foreach() is set before the first invocation of callback.
TypedArray.prototype.indexOf() - JavaScript
if the provided index value is a negative number, it is taken as the offset from the end of the typed array.
TypedArray.prototype.lastIndexOf() - JavaScript
if negative, it is taken as the offset from the end of the typed array.
TypedArray.prototype.map() - JavaScript
the range of elements processed by map() is set before the first invocation of mapfn.
TypedArray.of() - JavaScript
hence, when working with proxy objects, it calls handler.set to create new elements rather than handler.defineproperty.
WeakMap.prototype.clear() - JavaScript
syntax wm.clear(); examples using the clear method var wm = new weakmap(); var obj = {}; wm.set(obj, 'foo'); wm.set(window, 'bar'); wm.has(obj); // true wm.has(window); // true wm.clear(); wm.has(obj) // false wm.has(window) // false specifications not part of any standard.
WeakMap.prototype.delete() - JavaScript
examples using the delete method var wm = new weakmap(); wm.set(window, 'foo'); wm.delete(window); // returns true.
WeakMap.prototype.get() - JavaScript
examples using the get method var wm = new weakmap(); wm.set(window, 'foo'); wm.get(window); // returns "foo".
WeakMap.prototype.has() - JavaScript
examples using the has method var wm = new weakmap(); wm.set(window, 'foo'); wm.has(window); // returns true wm.has('baz'); // returns false specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.has' in that specification.
WeakRef - JavaScript
0; const tick = () => { // get the element from the weak reference, if it still exists const element = this.ref.deref(); if (element) { element.textcontent = ++this.count; } else { // the element doesn't exist anymore console.log("the element is gone."); this.stop(); this.ref = null; } }; tick(); this.timer = setinterval(tick, 1000); } stop() { if (this.timer) { clearinterval(this.timer); this.timer = 0; } } } const counter = new counter(document.getelementbyid("counter")); counter.start(); settimeout(() => { document.getelementbyid("counter").remove(); }, 5000); specifications specification weakrefsthe definition of 'weakref' in that specification.
WebAssembly.Global - JavaScript
global.prototype.value the value contained inside the global variable — this can be used to directly set and get the global's value.
WebAssembly.Module.exports() - JavaScript
var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread.
WebAssembly.Module - JavaScript
var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread.
WebAssembly.instantiate() - JavaScript
var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread.
Lexical grammar - JavaScript
they include: arguments get set literals null literal see also null for more information.
Comma operator (,) - JavaScript
in the following example, a is set to the value of b = 3 (which is 3), but the c = 4 expression still evaluates and its result returned to console (i.e., 4).
Destructuring assignment - JavaScript
setting a function parameter's default value function drawchart({size = 'big', coords = {x: 0, y: 0}, radius = 25} = {}) { console.log(size, coords, radius); // do some chart drawing } drawchart({ coords: {x: 18, y: 30}, radius: 30 }); in the function signature for drawchart above, the destructured left-hand side is assigned to an empty object literal on the right-hand side: {size = 'big'...
Logical AND (&&) - JavaScript
the logical and (&&) operator (logical conjunction) for a set of operands is true if and only if all of its operands are true.
Logical OR (||) - JavaScript
the logical or (||) operator (logical disjunction) for a set of operands is true if and only if one or more of its operands is true.
Logical OR assignment (||=) - JavaScript
examples setting default content if the "lyrics" element is empty, set the innerhtml to a default value: document.getelementbyid('lyrics').innerhtml ||= '<i>no lyrics.</i>' here the short-circuit is especially beneficial, since the element will not be updated unnecessarily and won't cause unwanted side-effects such as additional parsing or rendering work, or loss of focus, etc.
Optional chaining (?.) - JavaScript
let mymap = new map(); mymap.set("foo", {name: "baz", desc: "inga"}); let namebar = mymap.get("bar")?.name; short-circuiting evaluation when using optional chaining with expressions, if the left operand is null or undefined, the expression will not be evaluated.
Spread syntax (...) - JavaScript
const obj1 = { foo: 'bar', x: 42 }; const obj2 = { foo: 'baz', y: 13 }; const clonedobj = { ...obj1 }; // object { foo: "bar", x: 42 } const mergedobj = { ...obj1, ...obj2 }; // object { foo: "baz", x: 42, y: 13 } note that object.assign() triggers setters, whereas spread syntax doesn't.
async function expression - JavaScript
examples simple example function resolveafter2seconds(x) { return new promise(resolve => { settimeout(() => { resolve(x); }, 2000); }); }; const add = async function(x) { // async function expression assigned to a variable let a = await resolveafter2seconds(20); let b = await resolveafter2seconds(30); return x + a + b; }; add(10).then(v => { console.log(v); // prints 60 after 4 seconds.
delete operator - JavaScript
in explorer, while the property value is indeed set to undefined, if one later adds back a property with the same name, the property will be iterated in its old position--not at the end of the iteration sequence as one might expect after having deleted the property and then added it back.
in operator - JavaScript
let mycar = {make: 'honda', model: 'accord', year: 1998} delete mycar.make 'make' in mycar // returns false let trees = new array('redwood', 'bay', 'cedar', 'oak', 'maple') delete trees[3] 3 in trees // returns false if you set a property to undefined but do not delete it, the in operator returns true for that property.
instanceof - JavaScript
it can also be changed by changing an object's prototype using object.setprototypeof.
new operator - JavaScript
description the new keyword does the following things: creates a blank, plain javascript object; links (sets the constructor of) this object to another object; passes the newly created object from step 1 as the this context; returns this if the function doesn't return an object.
Expressions and operators - JavaScript
binary bitwise operators bitwise operators treat their operands as a set of 32 bits (zeros and ones) and return standard javascript numerical values.
block - JavaScript
variables introduced within a block are scoped to the containing function or script, and the effects of setting them persist beyond the block itself.
debugger - JavaScript
the debugger statement invokes any available debugging functionality, such as setting a breakpoint.
export - JavaScript
ame1, variable2 as name2, …, namen }; // exporting destructured assignments with renaming export const { name1, name2: bar } = o; // default exports export default expression; export default function (…) { … } // also class, function* export default function name1(…) { … } // also class, function* export { name1 as default, … }; // aggregating modules export * from …; // does not set the default export export * as name1 from …; // draft ecmascript® 2o21 export { name1, name2, …, namen } from …; export { import1 as name1, import2 as name2, …, namen } from …; export { default } from …; namen identifier to be exported (so that it can be imported via import in another script).
for await...of - JavaScript
the for await...of statement creates a loop iterating over async iterable objects as well as on sync iterables, including: built-in string, array, array-like objects (e.g., arguments or nodelist), typedarray, map, set, and user-defined async/sync iterables.
for...in - JavaScript
deleted, added, or modified properties a for...in loop iterates over the properties of an object in an arbitrary order (see the delete operator for more on why one cannot depend on the seeming orderliness of iteration, at least in a cross-browser setting).
import - JavaScript
the module: file.js function getjson(url, callback) { let xhr = new xmlhttprequest(); xhr.onload = function () { callback(this.responsetext) }; xhr.open('get', url, true); xhr.send(); } export function getusefulcontents(url, callback) { getjson(url, data => callback(json.parse(data))); } the main program: main.js import { getusefulcontents } from '/modules/file.js'; getusefulcontents('http://www.example.com', data => { dosomethinguseful(data); }); dynamic import this example shows how to load functionality on to ...
let - JavaScript
x = 'global'; let y = 'global'; console.log(this.x); // "global" console.log(this.y); // undefined emulating private members in dealing with constructors it is possible to use the let bindings to share one or more private members without using closures: var thing; { let privatescope = new weakmap(); let counter = 0; thing = function() { this.someproperty = 'foo'; privatescope.set(this, { hidden: ++counter, }); }; thing.prototype.showpublic = function() { return this.someproperty; }; thing.prototype.showprivate = function() { return privatescope.get(this).hidden; }; } console.log(typeof privatescope); // "undefined" var thing = new thing(); console.log(thing); // thing {someproperty: "foo"} thing.showpublic(); // "foo" thing.showprivate()...
try...catch - JavaScript
error exceptions } else if (e instanceof rangeerror) { // statements to handle rangeerror exceptions } else if (e instanceof evalerror) { // statements to handle evalerror exceptions } else { // statements to handle any unspecified exceptions logmyerrors(e); // pass exception object to error handler } } a common use case for this is to only catch (and silence) a small subset of expected errors, and then re-throw the error in other cases: try { myroutine(); } catch (e) { if (e instanceof rangeerror) { // statements to handle this very common expected error } else { throw e; // re-throw the error unchanged } } the exception identifier when an exception is thrown in the try-block, exception_var (i.e., the e in catch (e)) holds the exception value.
var - JavaScript
the property created on the global object for global variables, is set to be non-configurable because the identifier is to be treated as a variable, rather than a straightforward property of the global object.
JavaScript reference - JavaScript
nternalerror rangeerror referenceerror syntaxerror typeerror urierror numbers & dates number bigint math date text processing string regexp indexed collections array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array keyed collections map set weakmap weakset structured data arraybuffer sharedarraybuffer atomics dataview json control abstraction promise generator generatorfunction asyncfunction reflection reflect proxy internationalization intl intl.collator intl.datetimeformat intl.displaynames intl.listformat intl.locale intl.numberformat intl.pluralrules i...
dir - Web app manifests
WebManifestdir
the dir member can be set to one of the following values: auto — text direction is determined by the user agent ltr — left to right rtl — right to left the directionality-capable members are: name short_name description note: if the value is omitted or set to auto, the browser will use the unicode bidirectional algorithm to make a best guess about the text's direction.
display - Web app manifests
minimal-ui minimal-ui the application will look and feel like a standalone application, but will have a minimal set of ui elements for controlling navigation.
prefer_related_applications - Web app manifests
if the prefer_related_applications member is set to true, the user agent might suggest installing one of the related applications instead of this web app.
related_applications - Web app manifests
note: developer can specify that the native applications are preferred over the web application by setting prefer_related_applications to true.
serviceworker - Web app manifests
by default, the scope value for a service worker registration is set to the directory where the service worker script is located.
Web app manifests
note: if the manifest requires credentials to fetch - the crossorigin attribute must be set to use-credentials, even if the manifest file is in the same origin as the current page.
<maction> - MathML
href used to set a hyperlink to a specified uri.
<math> - MathML
WebMathMLElementmath
href used to set a hyperlink to a specified uri.
<menclose> - MathML
href used to set a hyperlink to a specified uri.
<merror> - MathML
WebMathMLElementmerror
href used to set a hyperlink to a specified uri.
<mglyph> - MathML
WebMathMLElementmglyph
href used to set a hyperlink to a specified uri.
<mi> - MathML
WebMathMLElementmi
href used to set a hyperlink to a specified uri.
<mlabeledtr> - MathML
groupalign href used to set a hyperlink to a specified uri.
<mmultiscripts> - MathML
href used to set a hyperlink to a specified uri.
<mn> - MathML
WebMathMLElementmn
href used to set a hyperlink to a specified uri.
<mover> - MathML
WebMathMLElementmover
href used to set a hyperlink to a specified uri.
<mroot> - MathML
WebMathMLElementmroot
href used to set a hyperlink to a specified url.
<mrow> - MathML
WebMathMLElementmrow
href used to set a hyperlink to a specified uri.
<mspace> - MathML
WebMathMLElementmspace
the mathml <mspace> element is used to display a blank space, whose size is set by its attributes.
<msqrt> - MathML
WebMathMLElementmsqrt
href used to set a hyperlink to a specified uri.
<msub> - MathML
WebMathMLElementmsub
href used to set a hyperlink to a specified uri.
<msubsup> - MathML
href used to set a hyperlink to a specified uri.
<msup> - MathML
WebMathMLElementmsup
href used to set a hyperlink to a specified uri.
<mtd> - MathML
WebMathMLElementmtd
groupalign unimplemented href used to set a hyperlink to a specified uri.
<mtext> - MathML
WebMathMLElementmtext
href used to set a hyperlink to a specified uri.
<mtr> - MathML
WebMathMLElementmtr
groupalign unimplemented href used to set a hyperlink to a specified uri.
<munder> - MathML
WebMathMLElementmunder
href used to set a hyperlink to a specified uri.
<munderover> - MathML
href used to set a hyperlink to a specified uri.
Examples - MathML
mathml torture test large set of test markup.
Using audio and video in HTML - Web media technologies
note: this guide is a planned update to integrate content from various scattered places on mdn into one cohesive document or document set.
OpenSearch description format
use about:config to set the pref 'browser.search.log' to true.
Animation performance and frame rate - Web Performance
there's also a video version of this walkthrough: animating using margin leaving the "use margin" option set, start the animation, open the performance tool, and make a recording.
Lazy loading - Web Performance
overview as the web has evolved, we have come to see huge increases in the number and size of assets sent to users.
Optimizing startup performance - Web Performance
if you need to decode asset files (for example, decoding jpeg files and turning them into raw texture data for later use by webgl), that's great to do in workers.
Performance Monitoring: RUM vs synthetic monitoring - Web Performance
it provides waterfall charts for every asset served by the host and cdn as well as every third party asset and asset requests generated by all third party scripts, such as ads and analytic services.
Using dns-prefetch - Web Performance
in such cases you should set the crossorigin attribute with the preconnect hint.
Progressive loading - Progressive web apps (PWAs)
loading via javascript the app.js file processes the data-src attributes like so: let imagestoload = document.queryselectorall('img[data-src]'); const loadimages = (image) => { image.setattribute('src', image.getattribute('data-src')); image.onload = () => { image.removeattribute('data-src'); }; }; the imagestoload variable contains references to all the images, while the loadimages function moves the path from data-src to src.
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
example: masking for example, you can make a gradient mask for html content using svg and css code similar to the following, inside your html document: <svg height="0"> <mask id="mask-1"> <lineargradient id="gradient-1" y2="1"> <stop stop-color="white" offset="0"/> <stop stop-opacity="0" offset="1"/> </lineargradient> <circle cx="0.25" cy="0.25" r="0.25" id="circle" fill="white"/> <rect x="0.5" y="0.2" width="300" height="100" fill="url(#gradient-1)"/> </mask> </svg> .target { mask: url(#mask-1); } p { width: 300px; border: 1px solid #000; display: inline-block; } note that in the css, the mask is specified using a url t...
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
externalresourcesrequired requiredextensions requiredfeatures systemlanguage attributes externalresourcesrequired deprecated since svg 2 if set to true, it indicates that the browser must wait for all the external resources necessary to render that element to be loaded before processing the associated element.
SVG Event Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeEvents
gend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, ontoggle, onvolumechange, onwaiting graphical event attributes onactivate, onfocusin, onfocusout ...
SVG Styling Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeStyling
class style attributes class assigns a class name or set of class names to an element.
additive - SVG: Scalable Vector Graphics
it is frequently useful to define animation as an offset or delta to an attribute's value, rather than as absolute values.
alphabetic - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system.
ascent - SVG: Scalable Vector Graphics
WebSVGAttributeascent
if the attribute is not specified, the effect is as if the attribute were set to the difference between the units-per-em value and the vert-origin-y value for the corresponding font.
attributeName - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated.
attributeType - SVG: Scalable Vector Graphics
four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indefinite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable.
by - SVG: Scalable Vector Graphics
WebSVGAttributeby
the by attribute specifies a relative offset value for an attribute that will be modified during an animation.
clip - SVG: Scalable Vector Graphics
WebSVGAttributeclip
the <top> and <bottom> values specify offsets from the top border edge of the element viewport, while <right> and <left> specify offsets from the left border edge of the element viewport.
color-rendering - SVG: Scalable Vector Graphics
eargradient>, <marker>, <mask>, <missing-glyph>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, and <use> html, body, svg { height: 100%; } <svg viewbox="0 0 480 200" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="gradient" cx="0.5" cy="0.5" r="0.5" fx="0.35" fy="0.35" fr="5%"> <stop offset="0%" stop-color="white"/> <stop offset="100%" stop-color="darkseagreen"/> </radialgradient> </defs> <circle cx="100" cy="100" r="100" fill="url(#gradient)" color-rendering="optimizequality" /> <text x="45" y="50%" color-rendering="optimizequality">quality-optimized</text> <circle cx="100" cy="100" r="100" color-rendering="optimizespeed" fill="url(#gradient)" style="trans...
contentScriptType - SVG: Scalable Vector Graphics
this attribute sets the default scripting language used to process the value strings in event attributes.
fill-opacity - SVG: Scalable Vector Graphics
city as a css property --> <circle cx="350" cy="50" r="40" style="fill-opacity: .25;" /> </svg> usage notes value [0-1] | <percentage> default value 1 animatable yes note: svg2 introduces percentage values for fill-opacity, however, it is not widely supported yet (see browser compatibility below) as a consequence, it is best practices to set opacity with a value in the range [0-1].
font-size - SVG: Scalable Vector Graphics
the font-size attribute refers to the size of the font from baseline to baseline when multiple lines of text are set solid in a multiline layout environment.
font-variant - SVG: Scalable Vector Graphics
" 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> || <contextual-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-va...
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
a value of 0deg indicates that all glyphs are set with the top of the glyphs oriented towards the reference orientation.
hanging - SVG: Scalable Vector Graphics
WebSVGAttributehanging
the value is an offset in the font coordinate system.
ideographic - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system.
in - SVG: Scalable Vector Graphics
WebSVGAttributein
fourteen elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <fegaussianblur>, <femergenode>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile> usage notes value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes sourcegraphic this keyword represents the graphics elements th...
keyPoints - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="m10,110 a120,120 -45 0,1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="motionpath"/> <circle cx="10" cy="110" r="3" fill="lightgrey"/> <circle cx="110" cy="10" r="3" fill="lightgrey"/> <circle r="5" fill="red"> <animatemotion dur="3s" repeatcount="indefinite" keypoints="0;0.5;1" keytimes="0;0.15;1" calcmode="linear"> <mpath xlink:href="#motionpath"/> </animatemotion> </circle>...
mathematical - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system.
max - SVG: Scalable Vector Graphics
WebSVGAttributemax
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" max="6s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" max="6s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value none animatable no <clock-value> specifie...
min - SVG: Scalable Vector Graphics
WebSVGAttributemin
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" min="2s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> <animate attributename="cy" dur="4s" min="2s" repeatcount="indefinite" values="10 ; 60 ; 110 ; 60 ; 10" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value 0 animatable no <clock-value> specifies t...
name - SVG: Scalable Vector Graphics
WebSVGAttributename
the name "srgb" is predefined; any color profile descriptions with <name> set to "srgb" (case-insensitively) will be ignored.
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
the overflow attribute sets what to do when an element's content is too big to fit in its block formatting context.
paint-order - SVG: Scalable Vector Graphics
example <svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"> <lineargradient id="g" x1="0" y1="0" x2="0" y2="1"> <stop stop-color="#888"/> <stop stop-color="#ccc" offset="1"/> </lineargradient> <rect width="400" height="200" fill="url(#g)"/> <g fill="crimson" stroke="white" stroke-width="6" stroke-linejoin="round" text-anchor="middle" font-family="sans-serif" font-size="50px" font-weight="bold"> <text x="200" y="75">stroke over</text> <text x="200" y="150" paint-order="stroke" id="stroke-under">stroke under</text> </g> </svg> the example wou...
panose-1 - SVG: Scalable Vector Graphics
the panose system consists of a set of ten numbers that categorize the key attributes of a latin typeface, a classification procedure for creating those numbers, and mapper software that determines the closest possible font match given a set of typefaces.
preserveAspectRatio - SVG: Scalable Vector Graphics
because the aspect ratio of an svg image is defined by the viewbox attribute, if this attribute isn't set, the preserveaspectratio attribute has no effect (with one exception, the <image> element, as described below).
r - SVG: Scalable Vector Graphics
WebSVGAttributer
two elements are using this attribute: <circle>, and <radialgradient> html,body,svg { height:100% } <svg viewbox="0 0 300 200" xmlns="http://www.w3.org/2000/svg"> <radialgradient r="0" id="mygradient000"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <radialgradient r="50%" id="mygradient050"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <radialgradient r="100%" id="mygradient100"> <stop offset="0" stop-color="white" /> <stop offset="100%" stop-color="black" /> </radialgradient> <circle cx="50" cy="50" r="0"/> <circle cx="150" cy="50" r="25"/> <circle cx="250" cy="50" r="50"/> <...
repeatCount - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="5"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indefinite"/> </rect> </svg> usage notes value <number> | indefinite default value none animatable no <number> this value specifies the num...
repeatDur - SVG: Scalable Vector Graphics
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="5s"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="indefinite"/> </rect> </svg> usage notes value <clock-value> | indefinite default values none animatable no <clock-value> this value specifies th...
requiredExtensions - SVG: Scalable Vector Graphics
language extensions are capabilities within a user agent that go beyond the feature set defined in this specification.
restart - SVG: Scalable Vector Graphics
WebSVGAttributerestart
five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } a { fill: blue; text-decoration: underline; cursor: pointer; } <svg viewbox="0 0 220 200" xmlns="http://www.w3.org/2000/svg"> <rect y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="always" /> </rect> <rect x="120" y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="whennotactive"/> </rect> <a id="restart"><text y="20">restart animation</text></a> </svg> document.g...
result - SVG: Scalable Vector Graphics
WebSVGAttributeresult
seventeen elements are using this attribute: <feblend>, <fecolormatrix>, <fecomponenttransfer>, <fecomposite>, <feconvolvematrix>, <fediffuselighting>, <fedisplacementmap>, <fedropshadow>, <feflood>, <fegaussianblur>, <feimage>, <femerge>, <femorphology>, <feoffset>, <fespecularlighting>, <fetile>, and <feturbulence> html, body, svg { height: 100%; } <svg viewbox="0 0 220 220" xmlns="http://www.w3.org/2000/svg"> <filter id="displacementfilter"> <feturbulence type="turbulence" basefrequency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychann...
rotate - SVG: Scalable Vector Graphics
WebSVGAttributerotate
setting rotate's value to a number specifies a constant rotation, in degrees, that does not change with the animation.
stroke-opacity - SVG: Scalable Vector Graphics
roperty --> <circle cx="35" cy="5" r="4" stroke="green" style="stroke-opacity: .3;" /> </svg> usage notes value [0-1] | <percentage> default value 1 animatable yes note: svg2 introduces percentage values for stroke-opacity, however, it is not widely supported yet (see browser compatibility below) as a consequence, it is best practices to set opacity with a value in the range [0-1].
stroke - SVG: Scalable Vector Graphics
WebSVGAttributestroke
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="green" /> <stop offset="100%" stop-color="white" /> </lineargradient> </defs> <circle cx="15" cy="5" r="4" fill="none" stroke="url(#mygradient)" /> </svg> usage notes value <paint> default value none animatable yes specifications specification status comment scalable vector g...
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.
tableValues - SVG: Scalable Vector Graphics
four elements are using this attribute: <fefunca>, <fefuncb>, <fefuncg>, and <fefuncr> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient" gradientunits="userspaceonuse" x1="0" y1="0" x2="200" y2="0"> <stop offset="0" stop-color="#ff0000" /> <stop offset="0.5" stop-color="#00ff00" /> <stop offset="1" stop-color="#0000ff" /> </lineargradient> </defs> <filter id="componenttransfer1" x="0" y="0" width="100%" height="100%"> <fecomponenttransfer> <fefuncr type="table" tablevalues="0 1"/> <fefuncg type="table" tablevalues="0 1"/> <fefuncb type="table" tablevalues="0 1"/...
textLength - SVG: Scalable Vector Graphics
when an "input" event occurs, we call svglength.newvaluespecifiedunits() to set the value of textlength to the slider's new value, using the svglength interface's svg_lengthtype_px unit type to indicate that the value represents pixels.
v-alphabetic - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute.
v-hanging - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute.
v-ideographic - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute.
v-mathematical - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute.
values - SVG: Scalable Vector Graphics
WebSVGAttributevalues
if this attribute is specified, any from, to, and by attribute values set on the element are ignored.
x1 - SVG: Scalable Vector Graphics
WebSVGAttributex1
by the gradientunits attributs value <length> | <percentage> default value 0% animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the left bounding limit of the shape it is applied to --> <lineargradient x1="0%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 80% of the left bounding limit of the shape it is applied to --> <lineargradient x1="80%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> <...
x2 - SVG: Scalable Vector Graphics
WebSVGAttributex2
the gradientunits attributs value <length> | <percentage> default value 100% animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the right bounding limit of the shape it is applied to --> <lineargradient x2="100%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 20% of the left bounding limit of the shape it is applied to --> <lineargradient x2="20%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> <...
xlink:arcrole - SVG: Scalable Vector Graphics
ular 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 reference that identifies some resource that describes the intended property.
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 specifies the title used to describe the meaning of the link or resource.
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.
xml:space - SVG: Scalable Vector Graphics
html, body, svg { height: 100%; } <svg viewbox="0 0 140 50" xmlns="http://www.w3.org/2000/svg"> <text y="20" xml:space="default">default spacing</text> <text y="40" xml:space="preserve">preserved spacing</text> </svg> usage notes value default | preserve default value default animatable no default with this value set, whitespace characters will be processed in this order: all newline characters are removed.
<altGlyphItem> - SVG: Scalable Vector Graphics
the <altglyphitem> element provides a set of candidates for glyph substitution by the <altglyph> element.
<clipPath> - SVG: Scalable Vector Graphics
WebSVGElementclipPath
e: userspaceonuse; animatable: yes global attributes core attributes most notably: id styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, 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 categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<text>, <use> specifications specification status comment css masking module level 1the definition o...
<feBlend> - SVG: Scalable Vector Graphics
WebSVGElementfeBlend
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 mode dom interface this element implements the svgfeblendelement interface.
<feColorMatrix> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in type values dom interface this element implements the svgfecolormatrixelement interface.
<feConvolveMatrix> - SVG: Scalable Vector Graphics
ligns perfectly with the kernel's pixel grid) and assuming default values for attributes ‘divisor’, ‘targetx’ and ‘targety’, then resulting color value will be: (9* 0 + 8* 20 + 7* 40 + 6*100 + 5*120 + 4*140 + 3*200 + 2*220 + 1*240) / (9+8+7+6+5+4+3+2+1) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in order kernelmatrix divisor bias targetx targety edgemode kernelunitlength preservealpha dom interface this element implements the svgfeconvolvematrixelement interface.
<feDisplacementMap> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in in2 scale xchannelselector ychannelselector dom interface this element implements the svgfedisplacementmapelement interface.
<feDistantLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes azimuth elevation dom interface this element implements the svgfedistantlightelement interface.
<feFlood> - SVG: Scalable Vector Graphics
WebSVGElementfeFlood
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes flood-color flood-opacity dom interface this element implements the svgfefloodelement interface.
<feFuncA> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncA
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncaelement interface.
<feFuncB> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncB
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncbelement interface.
<feFuncG> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncG
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncgelement interface.
<feFuncR> - SVG: Scalable Vector Graphics
WebSVGElementfeFuncR
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncrelement interface.
<feImage> - SVG: Scalable Vector Graphics
WebSVGElementfeImage
the <feimage> svg filter primitive fetches image data from an external source and provides the pixel data as output (meaning if the external source is an svg image, it is rasterized.) usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <animatetransform>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes xlink attributes class style externalresourcesrequired specific attributes preserveaspectratio xlink:href dom interface this element implements the svgfeimageelement interface.
<feMerge> - SVG: Scalable Vector Graphics
WebSVGElementfeMerge
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<femergenode> example svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> <filter id="feoffset" x="-40" y="-20" width="100" height="200"> <feoffset in="sourcegraphic" dx="60" dy="60" /> <fegaussianblur stddeviation="5" result="blur2" /> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> </svg> result ...
<feMergeNode> - SVG: Scalable Vector Graphics
usage context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> example <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <filter id="feoffset" x="-40" y="-20" width="100" height="200"> <feoffset in="sourcegraphic" dx="60" dy="60" /> <fegaussianblur in="sourcegraphic" stddeviation="5" result="blur2" /> <femerge> <femergenode in="blur2" /> <femergenode in="sourcegraphic" /> </femerge> </filter> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green; filter: url(#feoffset);" /> ...
<feMorphology> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in operator radius dom interface this element implements the svgfemorphologyelement interface.
<fePointLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z dom interface this element implements the svgfepointlightelement interface.
<feSpotLight> - SVG: Scalable Vector Graphics
usage context categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes x y z pointsatx pointsaty pointsatz specularexponent limitingconeangle dom interface this element implements the svgfespotlightelement interface.
<feTile> - SVG: Scalable Vector Graphics
WebSVGElementfeTile
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dom interface this element implements the svgfetileelement interface.
<feTurbulence> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes basefrequency numoctaves seed stitchtiles type dom interface this element implements the svgfeturbulenceelement interface.
<filter> - SVG: Scalable Vector Graphics
WebSVGElementfilter
usage context categoriesnonepermitted contentany number of the following elements, in any order:descriptive elementsfilter primitive elements<animate>, <set> attributes global attributes core attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes x y width height filterres filterunits primitiveunits xlink:href dom interface this element implements the svgfilterelement interface.
<hatchpath> - SVG: Scalable Vector Graphics
WebSVGElementhatchpath
usage context categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elements<script>, <style> attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes d offset dom interface this element implements the svghatchpathelement interface.
<mask> - SVG: Scalable Vector Graphics
WebSVGElementmask
fault value: 120%; animatable: yes global attributes core attributes most notably: id styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation attributes most notably: clip-path, clip-rule, color, display, fill, fill-opacity, fill-rule, filter, 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>, <fon...
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
ndom() * 255).tostring(16).padstart(2,'0') const b = math.round(math.random() * 255).tostring(16).padstart(2,'0') return `#${r}${g}${b}` } document.queryselector('circle').addeventlistener('click', (e) => { e.target.style.fill = getcolor() }) }) // ]]> </script> <circle cx="5" cy="5" r="4" /> </svg> attributes crossorigin this attribute defines cors settings as define for the html <script> element.
<solidcolor> - SVG: Scalable Vector Graphics
--> <lineargradient id="mygradient"> <stop offset="0" stop-color="green" /> </lineargradient> </defs> <text x="10" y="20">circles colored with solidcolor</text> <circle cx="150" cy="65" r="35" stroke-width="2" stroke="url(#mycolor)" fill="white"/> <circle cx="50" cy="65" r="35" fill="url(#mycolor)"/> <text x="10" y="120">circles colored with lineargradient</text> <circle cx="150" cy="165" r="35" stroke-width="2" stroke="u...
<tref> - SVG: Scalable Vector Graphics
WebSVGElementtref
usage context categoriestext content element, text content child elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatecolor>, <set> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgtrefelement interface.
<view> - SVG: Scalable Vector Graphics
WebSVGElementview
attributes aria attributes » core attributes » global event attributes » externalresourcesrequired specific attributes viewbox preserveaspectratio zoomandpan viewtarget example svg <svg width="600" height="200" viewbox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <radialgradient id="gradient"> <stop offset="0%" stop-color="#8cffa0" /> <stop offset="100%" stop-color="#8ca0ff" /> </radialgradient> </defs> <circle r="50" cx="180" cy="50" style="fill:url(#gradient)"/> <view id="halfsizeview" viewbox="0 0 1200 400"/> <view id="normalsizeview" viewbox="0 0 600 200"/> <view id="doublesizeview" viewbox="0 0 300 100"/> <a xlink:href="#halfsizeview"> <text x="5" y="20" font-size=...
Introduction - SVG: Scalable Vector Graphics
but all these extra features of the language rely on this relatively small set of elements to define the graphics area.
Other content in SVG - SVG: Scalable Vector Graphics
« previousnext » apart from graphic primitives like rectangles and circles, svg offers a set of elements to embed other types of content in images as well.
SVG fonts - SVG: Scalable Vector Graphics
the value 1000 sets a reasonable value to work with.
Tools for SVG - SVG: Scalable Vector Graphics
apache batik url: xmlgraphics.apache.org/batik/ batik is a set of open source tools under the roof of the apache software foundation.
SVG: Scalable Vector Graphics
WebSVG
some real eye-candy svg at svg-wow.org firefox extension (grafox) to add a subset of smil animation support interactive photos manipulation html transformations using svg's foreignobject mapping, charting, games & 3d experiments while a little svg can go a long way to enhanced web content, here are some examples of heavy svg usage.
How to fix a website with blocked mixed content - Web security
passive mixed content is displayed by default, but users can set a preference to block this type of content, as well.
Mixed content - Web security
starting in firefox 23, mixed active content is blocked by default (and mixed display content can be blocked by setting a preference).
Subresource Integrity - Web security
<script src="https://example.com/example-framework.js" integrity="sha384-oqvuafxrkap7fdgccy5uykm6+r9gqq8k/uxy9rx7hnqlgyl1kpzqho1wx4jwy8wc" crossorigin="anonymous"></script> note: for more details on the purpose of the crossorigin attribute, see cors settings attributes.
Web security
passive mixed content is displayed by default, but users can set a preference to block this type of content, as well.
XML introduction - XML: Extensible Markup Language
document must conform to semantic rules, which are usually set in an xml schema or a dtd (document type definition).
current - XPath
syntax current() returns a node-set containing only the current node.
last - XPath
WebXPathFunctionslast
notes this is often used with the position() function to determine if a particular node is the last in a node-set.
number - XPath
a node-set is first converted to a string as if by a call to the string() function and then converted in the same way as a string argument.
string - XPath
returns a string notes if the object is a node-set, the string value of the first node in the set is returned.
translate - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the translate function evaluates a string and a set of characters to translate and returns the translated string.
XPath
there are some cases in which the whole content of an xml document must be read from the javascript interpreter (like for web-apps languages or settings xml documents, for example).
<xsl:message> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementmessage
optional attributes terminate set to "yes", indicates that execution should be terminated.
<xsl:preserve-space> - XSLT: Extensible Stylesheet Language Transformations
preserving whitespace is the default setting, so this element only needs to be used to counteract an <xsl:strip-space> element.
<xsl:template> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtemplate
this element must have either the match attribute or the name attribute set.
<xsl:text> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementtext
if "yes" is set, for example, the character > is output as >, not as &gt;.
<xsl:value-of> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementvalue-of
if "yes" is set, for example, the character > is output as >, not as "&gt".
<xsl:with-param> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:with-param> element sets the value of a parameter to be passed into a template.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
elements xsl:apply-imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:names...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference elements xsl:apply-imports (supported) xsl:apply-templates (supported) xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not...
JavaScript/XSLT Bindings - XSLT: Extensible Stylesheet Language Transformations
figure 1 : instantiating an xsltprocessor var xsltprocessor = new xsltprocessor(); // load the xsl file using synchronous (third param is set to false) xmlhttprequest var myxmlhttprequest = new xmlhttprequest(); myxmlhttprequest.open("get", "example.xsl", false); myxmlhttprequest.send(null); var xslref = myxmlhttprequest.responsexml; // finally import the .xsl xsltprocessor.importstylesheet(xslref); for the actual transformation, xsltprocessor requires an xml document, which is used in conjunction with the imported xsl ...
The XSLT/JavaScript Interface in Gecko - XSLT: Extensible Stylesheet Language Transformations
introduction javascript/xslt bindings basic example setting parameters advanced example interface list resources ...
Web technology for developers
svg scalable vector graphics let you describe images as sets of vectors and shapes in order to allow them to scale smoothly regardless of the size at which they're drawn.
Converting WebAssembly text format to wasm - WebAssembly
go to https://github.com/webassembly/wabt — follow the instructions on this page to set up the tool.
Compiling an Existing C Module to WebAssembly - WebAssembly
that number to find the start of our buffer and copy the image data: const api = { version: module.cwrap('version', 'number', []), create_buffer: module.cwrap('create_buffer', 'number', ['number', 'number']), destroy_buffer: module.cwrap('destroy_buffer', '', ['number']), }; const image = await loadimage('./image.jpg'); const p = api.create_buffer(image.width, image.height); module.heap8.set(image.data, p); // ...
onunload - XUL
« xul reference home onunload type: script code specifies a set of scripts to execute when the browser window is closed by the user.